diff --git a/.azure-pipelines/client.yml b/.azure-pipelines/client.yml index 672651818c34..83b5b0969196 100644 --- a/.azure-pipelines/client.yml +++ b/.azure-pipelines/client.yml @@ -10,7 +10,8 @@ variables: PythonVersion: '3.6' ReleaseTag: 'RELEASE_CANDIDATE' TestMarkArgument: 'not cosmosEmulator' - + skipComponentGovernanceDetection: true + jobs: - job: 'Build' diff --git a/.azure-pipelines/docs.yml b/.azure-pipelines/docs.yml index 8609bfa6ba6f..33aa4790b7b2 100644 --- a/.azure-pipelines/docs.yml +++ b/.azure-pipelines/docs.yml @@ -6,6 +6,8 @@ variables: jobs: - job: 'DocGen' + variables: + skipComponentGovernanceDetection: true timeoutInMinutes: 120 pool: vmImage: 'vs2017-win2016' diff --git a/.azure-pipelines/tests-nightly-python.yml b/.azure-pipelines/tests-nightly-python.yml index 7b5fba1f00e4..89bfcd97f63d 100644 --- a/.azure-pipelines/tests-nightly-python.yml +++ b/.azure-pipelines/tests-nightly-python.yml @@ -4,6 +4,8 @@ trigger: jobs: - job: Validate_Nightly_Python_Build + variables: + skipComponentGovernanceDetection: true timeoutInMinutes: 90 diff --git a/.azure-pipelines/tests.yml b/.azure-pipelines/tests.yml index 632a16dd5b2c..db217c6cd6f8 100644 --- a/.azure-pipelines/tests.yml +++ b/.azure-pipelines/tests.yml @@ -3,7 +3,9 @@ jobs: - job: 'Test' - + variables: + skipComponentGovernanceDetection: true + timeoutInMinutes: 120 strategy: matrix: diff --git a/.azure-pipelines/update_pr.yml b/.azure-pipelines/update_pr.yml index 726664ed6176..36502cf89189 100644 --- a/.azure-pipelines/update_pr.yml +++ b/.azure-pipelines/update_pr.yml @@ -6,6 +6,9 @@ trigger: - master +variables: + skipComponentGovernanceDetection: true + pool: vmImage: 'ubuntu-latest' @@ -15,7 +18,7 @@ steps: inputs: versionSpec: 3.7 -- script: python3 -m pip install -e "git+https://github.com/Azure/azure-sdk-for-python#subdirectory=azure-sdk-tools&egg=azure-sdk-tools" +- script: python3 -m pip install -e "git+https://github.com/Azure/azure-sdk-for-python#subdirectory=tools/azure-sdk-tools&egg=azure-sdk-tools" displayName: 'Install Azure SDK tools' - script: python3 -m packaging_tools.update_pr -v --pr-number $(System.PullRequest.PullRequestNumber) --repo $(Build.Repository.Name) diff --git a/.docsettings.yml b/.docsettings.yml index ae16437e2814..2ea5b4568e8c 100644 --- a/.docsettings.yml +++ b/.docsettings.yml @@ -1,5 +1,5 @@ omitted_paths: - - azure-sdk-tools/* + - tools/* - scripts/* - azure-mgmt-netapp/tests/* - "azure-mgmt*/*" diff --git a/scripts/dev_setup.py b/scripts/dev_setup.py index a545ea829c72..eda83ccd80a8 100644 --- a/scripts/dev_setup.py +++ b/scripts/dev_setup.py @@ -14,29 +14,40 @@ from collections import Counter from subprocess import check_call, CalledProcessError -root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..')) +root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "..")) -def pip_command(command, additional_dir='.', error_ok=False): + +def pip_command(command, additional_dir=".", error_ok=False): try: - print('Executing: {} from {}'.format(command, additional_dir)) - check_call([sys.executable, '-m', 'pip'] + command.split(), cwd=os.path.join(root_dir, additional_dir)) + print("Executing: {} from {}".format(command, additional_dir)) + check_call( + [sys.executable, "-m", "pip"] + command.split(), + cwd=os.path.join(root_dir, additional_dir), + ) print() except CalledProcessError as err: print(err, file=sys.stderr) if not error_ok: sys.exit(1) + # optional argument in a situation where we want to build a variable subset of packages -parser = argparse.ArgumentParser(description='Set up the dev environment for selected packages.') -parser.add_argument('--packageList', '-p', - dest='packageList', - default='', - help='Comma separated list of targeted packages. Used to limit the number of packages that dependencies will be installed for.') +parser = argparse.ArgumentParser( + description="Set up the dev environment for selected packages." +) +parser.add_argument( + "--packageList", + "-p", + dest="packageList", + default="", + help="Comma separated list of targeted packages. Used to limit the number of packages that dependencies will be installed for.", +) args = parser.parse_args() -packages = {('.', os.path.dirname(p)) for p in glob.glob('azure*/setup.py')} -# Handle the SDK folder as well -packages.update({tuple(os.path.dirname(f).rsplit(os.sep, 1)) for f in glob.glob('sdk/*/azure*/setup.py')}) +packages = { + tuple(os.path.dirname(f).rsplit(os.sep, 1)) + for f in glob.glob("sdk/*/azure*/setup.py") + glob.glob("tools/azure*/setup.py") +} # [(base_folder, package_name), ...] to {package_name: base_folder, ...} packages = {package_name: base_folder for (base_folder, package_name) in packages} @@ -44,51 +55,77 @@ def pip_command(command, additional_dir='.', error_ok=False): if not args.packageList: targeted_packages = list(packages.keys()) else: - targeted_packages = [os.path.relpath(x.strip()) for x in args.packageList.split(',')] + targeted_packages = [ + os.path.relpath(x.strip()) for x in args.packageList.split(",") + ] # Extract nspkg and sort nspkg by number of "-" -nspkg_packages = [p for p in packages.keys() if 'nspkg' in p] -nspkg_packages.sort(key = lambda x: len([c for c in x if c == '-'])) +nspkg_packages = [p for p in packages.keys() if "nspkg" in p] +nspkg_packages.sort(key=lambda x: len([c for c in x if c == "-"])) # Manually push meta-packages at the end, in reverse dependency order -meta_packages = ['azure-mgmt', 'azure'] +meta_packages = ["azure-mgmt", "azure"] -content_packages = sorted([p for p in packages.keys() if p not in nspkg_packages+meta_packages and p in targeted_packages]) +content_packages = sorted( + [ + p + for p in packages.keys() + if p not in nspkg_packages + meta_packages and p in targeted_packages + ] +) -# Put azure-common in front -if 'azure-common' in content_packages: - content_packages.remove('azure-common') -content_packages.insert(0, 'azure-common') +# Install tests dep first +if "azure-devtools" in content_packages: + content_packages.remove("azure-devtools") +content_packages.insert(0, "azure-devtools") -if 'azure-sdk-tools' in content_packages: - content_packages.remove('azure-sdk-tools') -content_packages.insert(1, 'azure-sdk-tools') +if "azure-sdk-tools" in content_packages: + content_packages.remove("azure-sdk-tools") +content_packages.insert(1, "azure-sdk-tools") -print('Running dev setup...') -print('Root directory \'{}\'\n'.format(root_dir)) +# Put azure-common in front of content package +if "azure-common" in content_packages: + content_packages.remove("azure-common") +content_packages.insert(2, "azure-common") + +print("Running dev setup...") +print("Root directory '{}'\n".format(root_dir)) # install private whls if there are any -privates_dir = os.path.join(root_dir, 'privates') +privates_dir = os.path.join(root_dir, "privates") if os.path.isdir(privates_dir) and os.listdir(privates_dir): - whl_list = ' '.join([os.path.join(privates_dir, f) for f in os.listdir(privates_dir)]) - pip_command('install {}'.format(whl_list)) + whl_list = " ".join( + [os.path.join(privates_dir, f) for f in os.listdir(privates_dir)] + ) + pip_command("install {}".format(whl_list)) # install nspkg only on py2, but in wheel mode (not editable mode) -if sys.version_info < (3, ): +if sys.version_info < (3,): for package_name in nspkg_packages: - pip_command('install {}/{}/'.format(packages[package_name], package_name)) + pip_command("install {}/{}/".format(packages[package_name], package_name)) # install packages +print("Packages to install: {}".format(content_packages)) for package_name in content_packages: - print("Installing {}".format(package_name)) + print("\nInstalling {}".format(package_name)) # if we are running dev_setup with no arguments. going after dev_requirements will be a pointless exercise # and waste of cycles as all the dependencies will be installed regardless. - if os.path.isfile('{}/{}/dev_requirements.txt'.format(packages[package_name], package_name)): - pip_command('install -r dev_requirements.txt', os.path.join(packages[package_name], package_name)) - pip_command('install --ignore-requires-python -e {}'.format(os.path.join(packages[package_name], package_name))) + if os.path.isfile( + "{}/{}/dev_requirements.txt".format(packages[package_name], package_name) + ): + pip_command( + "install -r dev_requirements.txt", + os.path.join(packages[package_name], package_name), + ) + pip_command( + "install --ignore-requires-python -e {}".format( + os.path.join(packages[package_name], package_name) + ) + ) # On Python 3, uninstall azure-nspkg if he got installed -if sys.version_info >= (3, ): - pip_command('uninstall -y azure-nspkg', error_ok=True) +if sys.version_info >= (3,): + pip_command("uninstall -y azure-nspkg", error_ok=True) + +print("Finished dev setup.") -print('Finished dev setup.') \ No newline at end of file diff --git a/scripts/devops_tasks/common_tasks.py b/scripts/devops_tasks/common_tasks.py index 1e39482f25b4..d797cc7f7f0c 100644 --- a/scripts/devops_tasks/common_tasks.py +++ b/scripts/devops_tasks/common_tasks.py @@ -33,10 +33,14 @@ def process_glob_string(glob_string, target_root_dir): # dedup, in case we have double coverage from the glob strings. Example: "azure-mgmt-keyvault,azure-mgmt-*" return list(set(collected_top_level_directories)) -def run_check_call(command_array, working_directory, acceptable_return_codes = []): - print('Command Array: {0}, Target Working Directory: {1}'.format(command_array, working_directory)) +def run_check_call(command_array, working_directory, acceptable_return_codes = [], run_as_shell = False): try: - check_call(command_array, cwd = working_directory) + if run_as_shell: + print('Command Array: {0}, Target Working Directory: {1}'.format(' '.join(command_array), working_directory)) + check_call(' '.join(command_array), cwd = working_directory, shell = True) + else: + print('Command Array: {0}, Target Working Directory: {1}'.format(command_array, working_directory)) + check_call(command_array, cwd = working_directory) except CalledProcessError as err: if err.returncode not in acceptable_return_codes: print(err) #, file = sys.stderr diff --git a/scripts/devops_tasks/setup_execute_tests.py b/scripts/devops_tasks/setup_execute_tests.py index 8cf9c1334c19..8a7e5419d116 100644 --- a/scripts/devops_tasks/setup_execute_tests.py +++ b/scripts/devops_tasks/setup_execute_tests.py @@ -38,7 +38,7 @@ def prep_and_run_tests(targeted_packages, python_version, test_res): command_array = [python_version, '-m', 'pytest'] command_array.extend(test_res) command_array.extend(targeted_packages) - run_check_call(command_array, root_dir, ALLOWED_RETURN_CODES) + run_check_call(command_array, root_dir, ALLOWED_RETURN_CODES, True) if __name__ == '__main__': parser = argparse.ArgumentParser(description = 'Install Dependencies, Install Packages, Test Azure Packages, Called from DevOps YAML Pipeline') diff --git a/scripts/multiapi_init_gen.py b/scripts/multiapi_init_gen.py index d79ab3105f37..a542e48334b8 100644 --- a/scripts/multiapi_init_gen.py +++ b/scripts/multiapi_init_gen.py @@ -1,32 +1,47 @@ import ast import importlib import inspect -import ast import logging import os import pkgutil import re import sys -import types -import glob +import shutil from pathlib import Path -from unittest.mock import MagicMock, patch + +from typing import List, Tuple, Any try: import msrestazure except: # Install msrestazure. Would be best to mock it, since we don't need it, but all scenarios I know are fine with a pip install for now import subprocess - subprocess.call(sys.executable + " -m pip install msrestazure", shell=True) # Use shell to use venv if available + + subprocess.call( + sys.executable + " -m pip install msrestazure", shell=True + ) # Use shell to use venv if available + +try: + from jinja2 import Template, FileSystemLoader, Environment +except: + import subprocess + + subprocess.call( + sys.executable + " -m pip install jinja2", shell=True + ) # Use shell to use venv if available + from jinja2 import Template, FileSystemLoader, Environment + try: import azure.common except: - sdk_root = Path(__file__).parents[1] - sys.path.append(str((sdk_root / "sdk" / "core" / "azure-common").resolve())) + sys.path.append( + str((Path(__file__).parents[1] / "sdk" / "core" / "azure-common").resolve()) + ) import azure.common import pkg_resources -pkg_resources.declare_namespace('azure') + +pkg_resources.declare_namespace("azure") _GENERATE_MARKER = "############ Generated from here ############\n" @@ -37,25 +52,40 @@ def parse_input(input_parameter): """From a syntax like package_name#submodule, build a package name and complete module name. """ - split_package_name = input_parameter.split('#') + split_package_name = input_parameter.split("#") package_name = split_package_name[0] module_name = package_name.replace("-", ".") if len(split_package_name) >= 2: module_name = ".".join([module_name, split_package_name[1]]) return package_name, module_name + # given an input of a name, we need to return the appropriate relative diff between the sdk_root and the actual package directory -def resolve_package_directory(package_name, sdk_root): - packages = [os.path.dirname(p) for p in (glob.glob('{}/setup.py'.format(package_name)) + glob.glob('sdk/*/{}/setup.py'.format(package_name)))] +def resolve_package_directory(package_name, sdk_root=None): + packages = [ + os.path.dirname(p) + for p in ( + list(sdk_root.glob("{}/setup.py".format(package_name))) + + list(sdk_root.glob("sdk/*/{}/setup.py".format(package_name))) + ) + ] if len(packages) > 1: - print('There should only be a single package matched in either repository structure. The following were found: {}'.format(packages)) + print( + "There should only be a single package matched in either repository structure. The following were found: {}".format( + packages + ) + ) sys.exit(1) return os.path.relpath(packages[0], sdk_root) -def get_versioned_modules(package_name, module_name, sdk_root=None): +def get_versioned_modules( + package_name: str, module_name: str, sdk_root: Path = None +) -> List[Tuple[str, Any]]: + """Get (label, submodule) where label starts with "v20" and submodule is the corresponding imported module. + """ if not sdk_root: sdk_root = Path(__file__).parents[1] @@ -65,9 +95,12 @@ def get_versioned_modules(package_name, module_name, sdk_root=None): # Doesn't work with namespace package # sys.path.append(str((sdk_root / package_name).resolve())) module_to_generate = importlib.import_module(module_name) - return [(label, importlib.import_module('.'+label, module_to_generate.__name__)) - for (_, label, ispkg) in pkgutil.iter_modules(module_to_generate.__path__) - if label.startswith("v20") and ispkg] + return { + label: importlib.import_module("." + label, module_to_generate.__name__) + for (_, label, ispkg) in pkgutil.iter_modules(module_to_generate.__path__) + if label.startswith("v20") and ispkg + } + class ApiVersionExtractor(ast.NodeVisitor): def __init__(self, *args, **kwargs): @@ -90,7 +123,7 @@ def extract_api_version_from_code(function): try: ast_tree = ast.parse(srccode) except IndentationError: - ast_tree = ast.parse('with 0:\n'+srccode) + ast_tree = ast.parse("with 0:\n" + srccode) api_version_visitor = ApiVersionExtractor() api_version_visitor.visit(ast_tree) @@ -98,13 +131,38 @@ def extract_api_version_from_code(function): except Exception: raise + +def get_client_class_name_from_module(module): + """Being a module that is an Autorest generation, get the client name.""" + # Using the fact that Client is always the first element in __all__ + # I externalize that code in a class in case we need to be smarter later + return module.__all__[0] + + def build_operation_meta(versioned_modules): + """Introspect the client: + + version_dict => { + 'application_gateways': [ + ('v2018_05_01', 'ApplicationGatewaysOperations') + ] + } + mod_to_api_version => {'v2018_05_01': '2018-05-01'} + """ + version_dict = {} mod_to_api_version = {} - for versionned_label, versionned_mod in versioned_modules: + for versionned_label, versionned_mod in versioned_modules.items(): extracted_api_versions = set() - client_doc = versionned_mod.__dict__[versionned_mod.__all__[0]].__doc__ - operations = list(re.finditer(r':ivar (?P[a-z_]+): \w+ operations\n\s+:vartype (?P=attr): .*.operations.(?P\w+)\n', client_doc)) + client_doc = versionned_mod.__dict__[ + get_client_class_name_from_module(versionned_mod) + ].__doc__ + operations = list( + re.finditer( + r":ivar (?P[a-z_]+): \w+ operations\n\s+:vartype (?P=attr): .*.operations.(?P\w+)\n", + client_doc, + ) + ) for operation in operations: attr, clsname = operation.groups() _LOGGER.debug("Class name: %s", clsname) @@ -113,33 +171,58 @@ def build_operation_meta(versioned_modules): # Create a fake operation group to extract easily the real api version extracted_api_version = None try: - extracted_api_version = versionned_mod.operations.__dict__[clsname](None, None, None, None).api_version + extracted_api_version = versionned_mod.operations.__dict__[clsname]( + None, None, None, None + ).api_version _LOGGER.debug("Found an obvious API version: %s", extracted_api_version) if extracted_api_version: extracted_api_versions.add(extracted_api_version) except Exception: - _LOGGER.debug("Should not happen. I guess it mixed operation groups like VMSS Network...") - for func_name, function in versionned_mod.operations.__dict__[clsname].__dict__.items(): + _LOGGER.debug( + "Should not happen. I guess it mixed operation groups like VMSS Network..." + ) + for func_name, function in versionned_mod.operations.__dict__[ + clsname + ].__dict__.items(): if not func_name.startswith("__"): _LOGGER.debug("Try to extract API version from: %s", func_name) extracted_api_version = extract_api_version_from_code(function) - _LOGGER.debug("Extracted API version: %s", extracted_api_version) + _LOGGER.debug( + "Extracted API version: %s", extracted_api_version + ) if extracted_api_version: extracted_api_versions.add(extracted_api_version) if not extracted_api_versions: - sys.exit("Was not able to extract api_version of {}".format(versionned_label)) + sys.exit( + "Was not able to extract api_version of {}".format(versionned_label) + ) if len(extracted_api_versions) >= 2: # Mixed operation group, try to figure out what we want to use final_api_version = None - _LOGGER.warning("Found too much API version: {} in label {}".format(extracted_api_versions, versionned_label)) + _LOGGER.warning( + "Found too much API version: {} in label {}".format( + extracted_api_versions, versionned_label + ) + ) for candidate_api_version in extracted_api_versions: - if "v{}".format(candidate_api_version.replace("-", "_")) == versionned_label: + if ( + "v{}".format(candidate_api_version.replace("-", "_")) + == versionned_label + ): final_api_version = candidate_api_version - _LOGGER.warning("Guessing you want {} based on label {}".format(final_api_version, versionned_label)) + _LOGGER.warning( + "Guessing you want {} based on label {}".format( + final_api_version, versionned_label + ) + ) break else: - sys.exit("Unble to match {} to label {}".format(extracted_api_versions, versionned_label)) + sys.exit( + "Unble to match {} to label {}".format( + extracted_api_versions, versionned_label + ) + ) extracted_api_versions = {final_api_version} mod_to_api_version[versionned_label] = extracted_api_versions.pop() @@ -148,120 +231,168 @@ def build_operation_meta(versioned_modules): return version_dict, mod_to_api_version -def build_models_string(module_name, mod_to_api_version): - result = """ @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): -""" - - template_models_if = """ - {first}if api_version == '{api_version}': - from .{api_version_module} import models - return models""" - template_models_end_def = """ raise NotImplementedError("APIVersion {} is not available".format(api_version)) -""" - - template_intro_doc= ' """Module depends on the API version:\n' - template_inside_doc=" * {api_version}: :mod:`{api_version_module}.models<{module_name}.{api_version_module}.models>`" - template_end_doc=' """' - - result += template_intro_doc - for attr in sorted(mod_to_api_version.keys()): - result += "\n" - result += template_inside_doc.format( - module_name=module_name, - api_version=mod_to_api_version[attr], - api_version_module=attr) - result += "\n" - result += template_end_doc - - first = True - for attr in sorted(mod_to_api_version.keys()): - result += template_models_if.format( - first='' if first else 'el', - api_version=mod_to_api_version[attr], - api_version_module=attr) - first = False - result += "\n" - result += template_models_end_def - return result - - -def build_operation_group(module_name, operation_name, versions): - - template_def = " @property\n def {attr}(self):\n" - template_intro_doc= ' """Instance depends on the API version:\n\n' - template_inside_doc=" * {api_version}: :class:`{clsname}<{module_name}.{api_version_module}.operations.{clsname}>`\n" - template_end_doc=' """\n' - template_code_prefix=" api_version = self._get_api_version('{attr}')" - template_if = """ {first}if api_version == '{api_version}': - from .{api_version_module}.operations import {clsname} as OperationClass""" - template_end_def = """ 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))) -""" - result = template_def.format(attr=operation_name) - result += template_intro_doc - for version in versions: - result += template_inside_doc.format( - api_version=mod_to_api_version[version[0]], - api_version_module=version[0], - module_name=module_name, - clsname=version[1]) - result += template_end_doc - result += template_code_prefix.format(attr=operation_name) - first = True - for version in versions: - result += "\n" - result += template_if.format( - first='' if first else 'el', - api_version=mod_to_api_version[version[0]], - api_version_module=version[0], - clsname=version[1]) - first = False - result += "\n" - result += template_end_def - return result +def build_operation_mixin_meta(versioned_modules): + """Introspect the client: -def find_client_file(package_name, module_name): - path_to_package = resolve_package_directory(package_name, Path(__file__).parents[1]) - module_path = Path(path_to_package) / Path(module_name.replace(".", os.sep)) + version_dict => { + 'check_dns_name_availability': { + 'doc': 'docstring', + 'signature': '(self, p1, p2, **operation_config), + 'call': 'p1, p2', + 'available_apis': [ + 'v2018_05_01' + ] + } + } + """ + mixin_operations = {} - return next(module_path.glob('*_client.py')) + for versionned_label, versionned_mod in sorted(versioned_modules.items()): -_CODE_PREFIX = """ - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + client_name = get_client_class_name_from_module(versionned_mod) + client_class = versionned_mod.__dict__[client_name] -""" + # Detect if this client is using an operation mixin (Network) + # Operation mixins are available since Autorest.Python 4.x + operations_mixin = next( + (c for c in client_class.__mro__ if "OperationsMixin" in c.__name__), None + ) + if not operations_mixin: + continue -if __name__ == "__main__": - logging.basicConfig(level=logging.INFO) + for func_name, func in operations_mixin.__dict__.items(): + # Work only on functions + if func_name.startswith("_"): + continue + + signature = inspect.signature(func) + mixin_operations.setdefault(func_name, {}).setdefault( + "available_apis", [] + ).append(versionned_label) + mixin_operations[func_name]["doc"] = func.__doc__ + mixin_operations[func_name]["signature"] = str(signature) + mixin_operations[func_name]["call"] = ", ".join( + list(signature.parameters)[1:-1] + ) + + return mixin_operations + + +def find_module_folder(package_name, module_name): + sdk_root = Path(__file__).parents[1] + _LOGGER.debug("SDK root is: %s", sdk_root) + path_to_package = resolve_package_directory(package_name, sdk_root) + module_path = ( + sdk_root / Path(path_to_package) / Path(module_name.replace(".", os.sep)) + ) + _LOGGER.debug("Module path is: %s", module_path) + return module_path - package_name, module_name = parse_input(sys.argv[1]) + +def find_client_file(package_name, module_name): + module_path = find_module_folder(package_name, module_name) + return next(module_path.glob("*_client.py")) + + +def main(input_str): + package_name, module_name = parse_input(input_str) versioned_modules = get_versioned_modules(package_name, module_name) - version_dict, mod_to_api_version = build_operation_meta(versioned_modules) - model_string = build_models_string(module_name, mod_to_api_version) - - operations_string = [] - for attr in sorted(version_dict.keys()): - versions = version_dict[attr] - operations_string.append(build_operation_group(module_name, attr, versions)) - - client_file = find_client_file(package_name, module_name) - with open(client_file, "r") as read_client: - lines = read_client.readlines() - with open(client_file, "w", newline='\n') as write_client: - for line in lines: - write_client.write(line) - if line == _GENERATE_MARKER: - break + versioned_operations_dict, mod_to_api_version = build_operation_meta( + versioned_modules + ) + + client_folder = find_module_folder(package_name, module_name) + last_api_version = sorted(mod_to_api_version.keys())[-1] + last_api_path = client_folder / last_api_version + + _LOGGER.info("Copy _configuration.py if possible") + + shutil.copy( + client_folder / last_api_version / "_configuration.py", + client_folder / "_configuration.py", + ) + shutil.copy( + client_folder / last_api_version / "__init__.py", client_folder / "__init__.py" + ) + + versionned_mod = versioned_modules[last_api_version] + client_name = get_client_class_name_from_module(versionned_mod) + client_class = versionned_mod.__dict__[client_name] + + # Detect if this client is using an operation mixin (Network) + # Operation mixins are available since Autorest.Python 4.x + mixin_operations = build_operation_mixin_meta(versioned_modules) + + # If we get a StopIteration here, means the API version folder is broken + client_file_name = next(last_api_path.glob("*_client.py")).name + + # versioned_operations_dict => { + # 'application_gateways': [ + # ('v2018-05-01', 'ApplicationGatewaysOperations') + # ] + # } + # mod_to_api_version => {'v2018-05-01': '2018-05-01'} + # mixin_operations => { + # 'check_dns_name_availability': { + # 'doc': 'docstring', + # 'signature': '(self, p1, p2, **operation_config), + # 'call': 'p1, p2', + # 'available_apis': [ + # 'v2018_05_01' + # ] + # } + # } + + last_rt_list = {} + for operation, operation_metadata in versioned_operations_dict.items(): + local_last_api_version = sorted(operation_metadata)[-1][0] + if local_last_api_version == last_api_version: + continue + last_rt_list[operation] = mod_to_api_version[local_last_api_version] + + for operation, operation_metadata in mixin_operations.items(): + local_last_api_version = sorted(operation_metadata['available_apis'])[-1] + if local_last_api_version == last_api_version: + continue + last_rt_list[operation] = mod_to_api_version[local_last_api_version] + + conf = { + "api_version_modules": sorted(mod_to_api_version.keys()), + "client_name": client_name, + "module_name": module_name, + "operations": versioned_operations_dict, + "mixin_operations": mixin_operations, + "mod_to_api_version": mod_to_api_version, + "last_api_version": mod_to_api_version[last_api_version], + "client_doc": client_class.__doc__.split("\n")[0], + "last_rt_list": last_rt_list, + } + + env = Environment( + loader=FileSystemLoader(str(Path(__file__).parents[0] / "templates")), + keep_trailing_newline=True, + ) + + for template_name in env.list_templates(): + # Don't generate files if they is not operations mixins + if template_name == "_operations_mixin.py" and not mixin_operations: + continue + + # Some file doesn't use the template name + if template_name == "_multiapi_client.py": + output_filename = client_file_name else: - sys.exit("Didn't find generate lines!!!!") + output_filename = template_name + + future_filepath = client_folder / output_filename - write_client.write(_CODE_PREFIX) - write_client.write(model_string) - for operation in operations_string: - write_client.write("\n") - write_client.write(operation) + template = env.get_template(template_name) + result = template.render(**conf) + with open(future_filepath, "w") as fd: + fd.write(result) + + +if __name__ == "__main__": + logging.basicConfig(level=logging.INFO) + main(sys.argv[1]) diff --git a/scripts/templates/_multiapi_client.py b/scripts/templates/_multiapi_client.py new file mode 100644 index 000000000000..5ad0fcae2762 --- /dev/null +++ b/scripts/templates/_multiapi_client.py @@ -0,0 +1,104 @@ +# 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 azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin +from .version import VERSION +from ._configuration import {{ client_name }}Configuration +{% if mixin_operations %}from ._operations_mixin import {{ client_name }}OperationsMixin{% endif %} + + +class {{ client_name }}({% if mixin_operations %}{{ client_name }}OperationsMixin, {% endif %}MultiApiClientMixin, SDKClient): + """{{ client_doc }} + + This ready contains multiple API versions, to help you deal with all Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, uses latest API version available on public Azure. + For production, you should stick a particular api-version and/or profile. + The profile sets a mapping between the operation group and an API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + + :ivar config: Configuration for client. + :vartype config: {{ client_name }}Configuration + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :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 profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles + """ + + DEFAULT_API_VERSION = '{{ last_api_version }}' + _PROFILE_TAG = "{{ module_name }}.{{ client_name }}" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { +{%- for rt_name, api_version in last_rt_list|dictsort %} + '{{ rt_name }}': '{{ api_version }}', +{%- endfor %} + None: DEFAULT_API_VERSION + }}, + _PROFILE_TAG + " latest" + ) + + def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): + self.config = {{ client_name }}Configuration(credentials, subscription_id, base_url) + super({{ client_name }}, self).__init__( + credentials, + self.config, + api_version=api_version, + profile=profile + ) + + @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: +{% for mod_api_version, api_version in mod_to_api_version|dictsort %} + * {{ api_version }}: :mod:`{{ mod_api_version }}.models<{{ module_name }}.{{ mod_api_version }}.models>` +{%- endfor %} + """ +{%- for mod_api_version, api_version in mod_to_api_version|dictsort %} + {% if not loop.first %}el{% endif %}if api_version == '{{ api_version }}': + from .{{ mod_api_version }} import models + return models +{%- endfor %} + raise NotImplementedError("APIVersion {} is not available".format(api_version)) +{% for operation_name, available_apis in operations|dictsort %} + @property + def {{ operation_name }}(self): + """Instance depends on the API version: +{% for api in available_apis %} + * {{ mod_to_api_version[api[0]] }}: :class:`{{ api[1] }}<{{ module_name }}.{{ api[0] }}.operations.{{ api[1] }}>` +{%- endfor %} + """ + api_version = self._get_api_version('{{ operation_name }}') +{%- for api in available_apis %} + {% if not loop.first %}el{% endif %}if api_version == '{{ mod_to_api_version[api[0]] }}': + from .{{ api[0] }}.operations import {{ api[1] }} as OperationClass +{%- endfor %} + 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))) +{% endfor %} \ No newline at end of file diff --git a/scripts/templates/_operations_mixin.py b/scripts/templates/_operations_mixin.py new file mode 100644 index 000000000000..a270606d592e --- /dev/null +++ b/scripts/templates/_operations_mixin.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 import Serializer, Deserializer + + +class {{ client_name }}OperationsMixin(object): + +{% for operation_name, metadata in mixin_operations|dictsort %} + def {{ operation_name }}{{ metadata['signature'] }}: + """{{ metadata['doc'] }} + """ + api_version = self._get_api_version('{{ operation_name }}') +{%- for api in metadata['available_apis'] %} + {% if not loop.first %}el{% endif %}if api_version == '{{ mod_to_api_version[api] }}': + from .{{ api }}.operations import {{ client_name }}OperationsMixin as OperationClass +{%- endfor %} + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + mixin_instance = OperationClass() + mixin_instance._client = self._client + mixin_instance.config = self.config + mixin_instance._serialize = Serializer(self._models_dict(api_version)) + mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) + return mixin_instance.{{ operation_name }}({{ metadata['call'] }}, **operation_config) +{% endfor %} \ No newline at end of file diff --git a/scripts/templates/models.py b/scripts/templates/models.py new file mode 100644 index 000000000000..55b7454f814b --- /dev/null +++ b/scripts/templates/models.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- +{%- for mod_api_version, _ in mod_to_api_version|dictsort %} +from .{{ mod_api_version }}.models import * +{%- endfor %} diff --git a/sdk/advisor/azure-mgmt-advisor/dev_requirements.txt b/sdk/advisor/azure-mgmt-advisor/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/advisor/azure-mgmt-advisor/dev_requirements.txt +++ b/sdk/advisor/azure-mgmt-advisor/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/applicationinsights/azure-applicationinsights/dev_requirements.txt b/sdk/applicationinsights/azure-applicationinsights/dev_requirements.txt index 8ffd9e3035d1..f6457a93d5e8 100644 --- a/sdk/applicationinsights/azure-applicationinsights/dev_requirements.txt +++ b/sdk/applicationinsights/azure-applicationinsights/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/appservice/azure-mgmt-web/dev_requirements.txt b/sdk/appservice/azure-mgmt-web/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/appservice/azure-mgmt-web/dev_requirements.txt +++ b/sdk/appservice/azure-mgmt-web/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/authorization/azure-mgmt-authorization/dev_requirements.txt b/sdk/authorization/azure-mgmt-authorization/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/authorization/azure-mgmt-authorization/dev_requirements.txt +++ b/sdk/authorization/azure-mgmt-authorization/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/batch/azure-batch/dev_requirements.txt b/sdk/batch/azure-batch/dev_requirements.txt index 3dca377c573d..baa07e3425ec 100644 --- a/sdk/batch/azure-batch/dev_requirements.txt +++ b/sdk/batch/azure-batch/dev_requirements.txt @@ -1,2 +1,2 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools -e ../azure-mgmt-batch \ No newline at end of file diff --git a/sdk/batch/azure-mgmt-batch/dev_requirements.txt b/sdk/batch/azure-mgmt-batch/dev_requirements.txt index d71f4cafccc8..cdf8192e82c6 100644 --- a/sdk/batch/azure-mgmt-batch/dev_requirements.txt +++ b/sdk/batch/azure-mgmt-batch/dev_requirements.txt @@ -1,2 +1,2 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools -e ../../keyvault/azure-mgmt-keyvault diff --git a/sdk/billing/azure-mgmt-billing/dev_requirements.txt b/sdk/billing/azure-mgmt-billing/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/billing/azure-mgmt-billing/dev_requirements.txt +++ b/sdk/billing/azure-mgmt-billing/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/botservice/azure-mgmt-botservice/dev_requirements.txt b/sdk/botservice/azure-mgmt-botservice/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/botservice/azure-mgmt-botservice/dev_requirements.txt +++ b/sdk/botservice/azure-mgmt-botservice/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/cdn/azure-mgmt-cdn/dev_requirements.txt b/sdk/cdn/azure-mgmt-cdn/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/cdn/azure-mgmt-cdn/dev_requirements.txt +++ b/sdk/cdn/azure-mgmt-cdn/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-spellcheck/dev_requirements.txt b/sdk/cognitiveservices/azure-cognitiveservices-language-spellcheck/dev_requirements.txt index 8ffd9e3035d1..f6457a93d5e8 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-spellcheck/dev_requirements.txt +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-spellcheck/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/dev_requirements.txt b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/dev_requirements.txt index 8ffd9e3035d1..f6457a93d5e8 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/dev_requirements.txt +++ b/sdk/cognitiveservices/azure-cognitiveservices-language-textanalytics/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/cognitiveservices/azure-cognitiveservices-search-entitysearch/dev_requirements.txt b/sdk/cognitiveservices/azure-cognitiveservices-search-entitysearch/dev_requirements.txt index 8ffd9e3035d1..f6457a93d5e8 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-entitysearch/dev_requirements.txt +++ b/sdk/cognitiveservices/azure-cognitiveservices-search-entitysearch/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/cognitiveservices/azure-cognitiveservices-search-videosearch/dev_requirements.txt b/sdk/cognitiveservices/azure-cognitiveservices-search-videosearch/dev_requirements.txt index 8ffd9e3035d1..f6457a93d5e8 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-videosearch/dev_requirements.txt +++ b/sdk/cognitiveservices/azure-cognitiveservices-search-videosearch/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/dev_requirements.txt b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/dev_requirements.txt index 8ffd9e3035d1..f6457a93d5e8 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-vision-face/dev_requirements.txt +++ b/sdk/cognitiveservices/azure-cognitiveservices-vision-face/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/commerce/azure-mgmt-commerce/dev_requirements.txt b/sdk/commerce/azure-mgmt-commerce/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/commerce/azure-mgmt-commerce/dev_requirements.txt +++ b/sdk/commerce/azure-mgmt-commerce/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/compute/azure-mgmt-compute/dev_requirements.txt b/sdk/compute/azure-mgmt-compute/dev_requirements.txt index ba1af994a35d..60f1ae3f3300 100644 --- a/sdk/compute/azure-mgmt-compute/dev_requirements.txt +++ b/sdk/compute/azure-mgmt-compute/dev_requirements.txt @@ -1,4 +1,4 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools -e ../../authorization/azure-mgmt-authorization -e ../../storage/azure-mgmt-storage -e ../../network/azure-mgmt-network diff --git a/sdk/consumption/azure-mgmt-consumption/dev_requirements.txt b/sdk/consumption/azure-mgmt-consumption/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/consumption/azure-mgmt-consumption/dev_requirements.txt +++ b/sdk/consumption/azure-mgmt-consumption/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/dev_requirements.txt b/sdk/containerinstance/azure-mgmt-containerinstance/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/dev_requirements.txt +++ b/sdk/containerinstance/azure-mgmt-containerinstance/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/HISTORY.rst b/sdk/containerregistry/azure-mgmt-containerregistry/HISTORY.rst index b6c5bd887e8d..51b064e49399 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/HISTORY.rst +++ b/sdk/containerregistry/azure-mgmt-containerregistry/HISTORY.rst @@ -3,6 +3,27 @@ Release History =============== +3.0.0rc2 (2019-06-12) ++++++++++++++++++++++ + +**Features** + +- Model Run has a new parameter timer_trigger + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes while using imports. +In summary, some modules were incorrectly visible/importable and have been renamed. This fixed several issues caused by usage of classes that were not supposed to be used in the first place. + +- ContainerRegistryManagementClient cannot be imported from `azure.mgmt.containerregistry.containerregistry_management_client` anymore (import from `azure.mgmt.containerregistry` works like before) +- ContainerRegistryManagementClientConfiguration import has been moved from `azure.mgmt.containerregistry.containerregistry_management_client` to `azure.mgmt.containerregistry` +- ContainerRegistryManagementClient cannot be imported from `azure.mgmt.containerregistry.v20xx_yy_zz.containerregistry_management_client` anymore (import from `azure.mgmt.containerregistry.v20xx_yy_zz` works like before) +- ContainerRegistryManagementClientConfiguration import has been moved from `azure.mgmt.containerregistry.v20xx_yy_zz.containerregistry_management_client` to `azure.mgmt.containerregistry.v20xx_yy_zz` +- A model `MyClass` from a "models" sub-module cannot be imported anymore using `azure.mgmt.containerregistry.v20xx_yy_zz.models.my_class` (import from `azure.mgmt.containerregistry.v20xx_yy_zz.models` works like before) +- An operation class `MyClassOperations` from an `operations` sub-module cannot be imported anymore using `azure.mgmt.containerregistry.v20xx_yy_zz.operations.my_class_operations` (import from `azure.mgmt.containerregistry.v20xx_yy_zz.operations` works like before) + +Last but not least, HTTP connection pooling is now enabled by default. You should always use a client as a context manager, or call close(), or use no more than one containerregistry mgmt client per process. + 3.0.0rc1 (2019-05-24) +++++++++++++++++++++ @@ -14,7 +35,7 @@ Release History **Breaking changes** -- Model RegistryUpdateParameters no longer has parameter storage_account +- Model RegistryUpdateParameters no longer has parameter containerregistry_account - Removed operation RegistriesOperations.update_policies - Removed operation RegistriesOperations.list_policies @@ -57,14 +78,14 @@ Release History **Bugfixes** -- Rename incorrect "id" to "virtual_network_resource_id" +- Rename incorrect "id" to "virtual_containerregistry_resource_id" 2.5.0 (2018-12-10) ++++++++++++++++++ **Features** -- Add network rule set to registry properties +- Add containerregistry rule set to registry properties 2.4.0 (2018-11-05) ++++++++++++++++++ diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/__init__.py old mode 100755 new mode 100644 index 511d3d37a4aa..81ad2ac1ed64 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .container_registry_management_client import ContainerRegistryManagementClient -from .version import VERSION +from ._configuration import ContainerRegistryManagementClientConfiguration +from ._container_registry_management_client import ContainerRegistryManagementClient +__all__ = ['ContainerRegistryManagementClient', 'ContainerRegistryManagementClientConfiguration'] -__all__ = ['ContainerRegistryManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_configuration.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_configuration.py new file mode 100644 index 000000000000..4e021787210f --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +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) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + 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 diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_container_registry_management_client.py new file mode 100644 index 000000000000..55db61c453ae --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_container_registry_management_client.py @@ -0,0 +1,331 @@ +# 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 azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin +from .version import VERSION +from ._configuration import ContainerRegistryManagementClientConfiguration + + + +class ContainerRegistryManagementClient(MultiApiClientMixin, SDKClient): + """ContainerRegistryManagementClient + + This ready contains multiple API versions, to help you deal with all Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, uses latest API version available on public Azure. + For production, you should stick a particular api-version and/or profile. + The profile sets a mapping between the operation group and an API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + + :ivar config: Configuration for client. + :vartype config: ContainerRegistryManagementClientConfiguration + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :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 profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles + """ + + DEFAULT_API_VERSION = '2019-05-01-preview' + _PROFILE_TAG = "azure.mgmt.containerregistry.ContainerRegistryManagementClient" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { + 'build_steps': '2018-02-01-preview', + 'build_tasks': '2018-02-01-preview', + 'builds': '2018-02-01-preview', + 'runs': '2019-05-01', + 'tasks': '2019-05-01', + None: DEFAULT_API_VERSION + }}, + _PROFILE_TAG + " latest" + ) + + def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): + self.config = ContainerRegistryManagementClientConfiguration(credentials, subscription_id, base_url) + super(ContainerRegistryManagementClient, self).__init__( + credentials, + self.config, + api_version=api_version, + profile=profile + ) + + @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` + * 2018-02-01-preview: :mod:`v2018_02_01_preview.models` + * 2018-09-01: :mod:`v2018_09_01.models` + * 2019-04-01: :mod:`v2019_04_01.models` + * 2019-05-01: :mod:`v2019_05_01.models` + * 2019-05-01-preview: :mod:`v2019_05_01_preview.models` + """ + if api_version == '2017-03-01': + from .v2017_03_01 import models + return models + elif api_version == '2017-10-01': + from .v2017_10_01 import models + return models + elif api_version == '2018-02-01-preview': + from .v2018_02_01_preview import models + return models + elif api_version == '2018-09-01': + from .v2018_09_01 import models + return models + elif api_version == '2019-04-01': + from .v2019_04_01 import models + return models + elif api_version == '2019-05-01': + from .v2019_05_01 import models + return models + elif api_version == '2019-05-01-preview': + from .v2019_05_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: + + * 2018-02-01-preview: :class:`BuildStepsOperations` + """ + api_version = self._get_api_version('build_steps') + if api_version == '2018-02-01-preview': + 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: + + * 2018-02-01-preview: :class:`BuildTasksOperations` + """ + api_version = self._get_api_version('build_tasks') + if api_version == '2018-02-01-preview': + 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: + + * 2018-02-01-preview: :class:`BuildsOperations` + """ + api_version = self._get_api_version('builds') + if api_version == '2018-02-01-preview': + 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): + """Instance depends on the API version: + + * 2017-03-01: :class:`Operations` + * 2017-10-01: :class:`Operations` + * 2018-02-01-preview: :class:`Operations` + * 2018-09-01: :class:`Operations` + * 2019-04-01: :class:`Operations` + * 2019-05-01: :class:`Operations` + * 2019-05-01-preview: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2017-03-01': + from .v2017_03_01.operations import Operations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import Operations as OperationClass + elif api_version == '2018-02-01-preview': + from .v2018_02_01_preview.operations import Operations as OperationClass + elif api_version == '2018-09-01': + from .v2018_09_01.operations import Operations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import Operations as OperationClass + elif api_version == '2019-05-01': + from .v2019_05_01.operations import Operations as OperationClass + elif api_version == '2019-05-01-preview': + from .v2019_05_01_preview.operations import Operations 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 registries(self): + """Instance depends on the API version: + + * 2017-03-01: :class:`RegistriesOperations` + * 2017-10-01: :class:`RegistriesOperations` + * 2018-02-01-preview: :class:`RegistriesOperations` + * 2018-09-01: :class:`RegistriesOperations` + * 2019-04-01: :class:`RegistriesOperations` + * 2019-05-01: :class:`RegistriesOperations` + * 2019-05-01-preview: :class:`RegistriesOperations` + """ + api_version = self._get_api_version('registries') + if api_version == '2017-03-01': + from .v2017_03_01.operations import RegistriesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import RegistriesOperations as OperationClass + elif api_version == '2018-02-01-preview': + from .v2018_02_01_preview.operations import RegistriesOperations as OperationClass + elif api_version == '2018-09-01': + from .v2018_09_01.operations import RegistriesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import RegistriesOperations as OperationClass + elif api_version == '2019-05-01': + from .v2019_05_01.operations import RegistriesOperations as OperationClass + elif api_version == '2019-05-01-preview': + from .v2019_05_01_preview.operations import RegistriesOperations 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 replications(self): + """Instance depends on the API version: + + * 2017-10-01: :class:`ReplicationsOperations` + * 2018-02-01-preview: :class:`ReplicationsOperations` + * 2018-09-01: :class:`ReplicationsOperations` + * 2019-04-01: :class:`ReplicationsOperations` + * 2019-05-01: :class:`ReplicationsOperations` + * 2019-05-01-preview: :class:`ReplicationsOperations` + """ + api_version = self._get_api_version('replications') + if api_version == '2017-10-01': + from .v2017_10_01.operations import ReplicationsOperations as OperationClass + elif api_version == '2018-02-01-preview': + from .v2018_02_01_preview.operations import ReplicationsOperations as OperationClass + elif api_version == '2018-09-01': + from .v2018_09_01.operations import ReplicationsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ReplicationsOperations as OperationClass + elif api_version == '2019-05-01': + from .v2019_05_01.operations import ReplicationsOperations as OperationClass + elif api_version == '2019-05-01-preview': + from .v2019_05_01_preview.operations import ReplicationsOperations 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 runs(self): + """Instance depends on the API version: + + * 2018-09-01: :class:`RunsOperations` + * 2019-04-01: :class:`RunsOperations` + * 2019-05-01: :class:`RunsOperations` + """ + api_version = self._get_api_version('runs') + if api_version == '2018-09-01': + from .v2018_09_01.operations import RunsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import RunsOperations as OperationClass + elif api_version == '2019-05-01': + from .v2019_05_01.operations import RunsOperations 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 scope_maps(self): + """Instance depends on the API version: + + * 2019-05-01-preview: :class:`ScopeMapsOperations` + """ + api_version = self._get_api_version('scope_maps') + if api_version == '2019-05-01-preview': + from .v2019_05_01_preview.operations import ScopeMapsOperations 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 tasks(self): + """Instance depends on the API version: + + * 2018-09-01: :class:`TasksOperations` + * 2019-04-01: :class:`TasksOperations` + * 2019-05-01: :class:`TasksOperations` + """ + api_version = self._get_api_version('tasks') + if api_version == '2018-09-01': + from .v2018_09_01.operations import TasksOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import TasksOperations as OperationClass + elif api_version == '2019-05-01': + from .v2019_05_01.operations import TasksOperations 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 tokens(self): + """Instance depends on the API version: + + * 2019-05-01-preview: :class:`TokensOperations` + """ + api_version = self._get_api_version('tokens') + if api_version == '2019-05-01-preview': + from .v2019_05_01_preview.operations import TokensOperations 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 webhooks(self): + """Instance depends on the API version: + + * 2017-10-01: :class:`WebhooksOperations` + * 2018-02-01-preview: :class:`WebhooksOperations` + * 2018-09-01: :class:`WebhooksOperations` + * 2019-04-01: :class:`WebhooksOperations` + * 2019-05-01: :class:`WebhooksOperations` + * 2019-05-01-preview: :class:`WebhooksOperations` + """ + api_version = self._get_api_version('webhooks') + if api_version == '2017-10-01': + from .v2017_10_01.operations import WebhooksOperations as OperationClass + elif api_version == '2018-02-01-preview': + from .v2018_02_01_preview.operations import WebhooksOperations as OperationClass + elif api_version == '2018-09-01': + from .v2018_09_01.operations import WebhooksOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import WebhooksOperations as OperationClass + elif api_version == '2019-05-01': + from .v2019_05_01.operations import WebhooksOperations as OperationClass + elif api_version == '2019-05-01-preview': + from .v2019_05_01_preview.operations import WebhooksOperations 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))) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/container_registry_management_client.py deleted file mode 100644 index 463d9a46924f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/container_registry_management_client.py +++ /dev/null @@ -1,354 +0,0 @@ -# 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 azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin -from .version import VERSION - - -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('containerregistrymanagementclient/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class ContainerRegistryManagementClient(MultiApiClientMixin, SDKClient): - """ContainerRegistryManagementClient - - :ivar config: Configuration for client. - :vartype config: ContainerRegistryManagementClientConfiguration - - :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 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 = '2019-05-01' - _PROFILE_TAG = "azure.mgmt.containerregistry.ContainerRegistryManagementClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - 'scope_maps': '2019-05-01-preview', - 'tokens': '2019-05-01-preview', - 'build_steps': '2018-02-01-preview', - 'build_taks': '2018-02-01-preview', - 'builds': '2018-02-01-preview', - }}, - _PROFILE_TAG + " latest" - ) - - def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): - self.config = ContainerRegistryManagementClientConfiguration(credentials, subscription_id, base_url) - super(ContainerRegistryManagementClient, self).__init__( - credentials, - self.config, - api_version=api_version, - profile=profile - ) - -############ 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` - * 2018-02-01-preview: :mod:`v2018_02_01_preview.models` - * 2018-09-01: :mod:`v2018_09_01.models` - * 2019-04-01: :mod:`v2019_04_01.models` - * 2019-05-01: :mod:`v2019_05_01.models` - * 2019-05-01-preview: :mod:`v2019_05_01_preview.models` - """ - if api_version == '2017-03-01': - from .v2017_03_01 import models - return models - elif api_version == '2017-10-01': - from .v2017_10_01 import models - return models - elif api_version == '2018-02-01-preview': - from .v2018_02_01_preview import models - return models - elif api_version == '2018-09-01': - from .v2018_09_01 import models - return models - elif api_version == '2019-04-01': - from .v2019_04_01 import models - return models - elif api_version == '2019-05-01': - from .v2019_05_01 import models - return models - elif api_version == '2019-05-01-preview': - from .v2019_05_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: - - * 2018-02-01-preview: :class:`BuildStepsOperations` - """ - api_version = self._get_api_version('build_steps') - if api_version == '2018-02-01-preview': - 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: - - * 2018-02-01-preview: :class:`BuildTasksOperations` - """ - api_version = self._get_api_version('build_tasks') - if api_version == '2018-02-01-preview': - 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: - - * 2018-02-01-preview: :class:`BuildsOperations` - """ - api_version = self._get_api_version('builds') - if api_version == '2018-02-01-preview': - 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): - """Instance depends on the API version: - - * 2017-03-01: :class:`Operations` - * 2017-10-01: :class:`Operations` - * 2018-02-01-preview: :class:`Operations` - * 2018-09-01: :class:`Operations` - * 2019-04-01: :class:`Operations` - * 2019-05-01: :class:`Operations` - * 2019-05-01-preview: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2017-03-01': - from .v2017_03_01.operations import Operations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import Operations as OperationClass - elif api_version == '2018-02-01-preview': - from .v2018_02_01_preview.operations import Operations as OperationClass - elif api_version == '2018-09-01': - from .v2018_09_01.operations import Operations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import Operations as OperationClass - elif api_version == '2019-05-01': - from .v2019_05_01.operations import Operations as OperationClass - elif api_version == '2019-05-01-preview': - from .v2019_05_01_preview.operations import Operations 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 registries(self): - """Instance depends on the API version: - - * 2017-03-01: :class:`RegistriesOperations` - * 2017-10-01: :class:`RegistriesOperations` - * 2018-02-01-preview: :class:`RegistriesOperations` - * 2018-09-01: :class:`RegistriesOperations` - * 2019-04-01: :class:`RegistriesOperations` - * 2019-05-01: :class:`RegistriesOperations` - * 2019-05-01-preview: :class:`RegistriesOperations` - """ - api_version = self._get_api_version('registries') - if api_version == '2017-03-01': - from .v2017_03_01.operations import RegistriesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import RegistriesOperations as OperationClass - elif api_version == '2018-02-01-preview': - from .v2018_02_01_preview.operations import RegistriesOperations as OperationClass - elif api_version == '2018-09-01': - from .v2018_09_01.operations import RegistriesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import RegistriesOperations as OperationClass - elif api_version == '2019-05-01': - from .v2019_05_01.operations import RegistriesOperations as OperationClass - elif api_version == '2019-05-01-preview': - from .v2019_05_01_preview.operations import RegistriesOperations 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 replications(self): - """Instance depends on the API version: - - * 2017-10-01: :class:`ReplicationsOperations` - * 2018-02-01-preview: :class:`ReplicationsOperations` - * 2018-09-01: :class:`ReplicationsOperations` - * 2019-04-01: :class:`ReplicationsOperations` - * 2019-05-01: :class:`ReplicationsOperations` - * 2019-05-01-preview: :class:`ReplicationsOperations` - """ - api_version = self._get_api_version('replications') - if api_version == '2017-10-01': - from .v2017_10_01.operations import ReplicationsOperations as OperationClass - elif api_version == '2018-02-01-preview': - from .v2018_02_01_preview.operations import ReplicationsOperations as OperationClass - elif api_version == '2018-09-01': - from .v2018_09_01.operations import ReplicationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ReplicationsOperations as OperationClass - elif api_version == '2019-05-01': - from .v2019_05_01.operations import ReplicationsOperations as OperationClass - elif api_version == '2019-05-01-preview': - from .v2019_05_01_preview.operations import ReplicationsOperations 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 runs(self): - """Instance depends on the API version: - - * 2018-09-01: :class:`RunsOperations` - * 2019-04-01: :class:`RunsOperations` - * 2019-05-01: :class:`RunsOperations` - """ - api_version = self._get_api_version('runs') - if api_version == '2018-09-01': - from .v2018_09_01.operations import RunsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import RunsOperations as OperationClass - elif api_version == '2019-05-01': - from .v2019_05_01.operations import RunsOperations 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 scope_maps(self): - """Instance depends on the API version: - - * 2019-05-01-preview: :class:`ScopeMapsOperations` - """ - api_version = self._get_api_version('scope_maps') - if api_version == '2019-05-01-preview': - from .v2019_05_01_preview.operations import ScopeMapsOperations 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 tasks(self): - """Instance depends on the API version: - - * 2018-09-01: :class:`TasksOperations` - * 2019-04-01: :class:`TasksOperations` - * 2019-05-01: :class:`TasksOperations` - """ - api_version = self._get_api_version('tasks') - if api_version == '2018-09-01': - from .v2018_09_01.operations import TasksOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import TasksOperations as OperationClass - elif api_version == '2019-05-01': - from .v2019_05_01.operations import TasksOperations 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 tokens(self): - """Instance depends on the API version: - - * 2019-05-01-preview: :class:`TokensOperations` - """ - api_version = self._get_api_version('tokens') - if api_version == '2019-05-01-preview': - from .v2019_05_01_preview.operations import TokensOperations 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 webhooks(self): - """Instance depends on the API version: - - * 2017-10-01: :class:`WebhooksOperations` - * 2018-02-01-preview: :class:`WebhooksOperations` - * 2018-09-01: :class:`WebhooksOperations` - * 2019-04-01: :class:`WebhooksOperations` - * 2019-05-01: :class:`WebhooksOperations` - * 2019-05-01-preview: :class:`WebhooksOperations` - """ - api_version = self._get_api_version('webhooks') - if api_version == '2017-10-01': - from .v2017_10_01.operations import WebhooksOperations as OperationClass - elif api_version == '2018-02-01-preview': - from .v2018_02_01_preview.operations import WebhooksOperations as OperationClass - elif api_version == '2018-09-01': - from .v2018_09_01.operations import WebhooksOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import WebhooksOperations as OperationClass - elif api_version == '2019-05-01': - from .v2019_05_01.operations import WebhooksOperations as OperationClass - elif api_version == '2019-05-01-preview': - from .v2019_05_01_preview.operations import WebhooksOperations 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))) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models.py index 2d3d74ac0b6c..c4eea73d1838 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/models.py @@ -4,4 +4,10 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from .v2019_05_01.models import * \ No newline at end of file +from .v2017_03_01.models import * +from .v2017_10_01.models import * +from .v2018_02_01_preview.models import * +from .v2018_09_01.models import * +from .v2019_04_01.models import * +from .v2019_05_01.models import * +from .v2019_05_01_preview.models import * diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/__init__.py index 511d3d37a4aa..81ad2ac1ed64 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .container_registry_management_client import ContainerRegistryManagementClient -from .version import VERSION +from ._configuration import ContainerRegistryManagementClientConfiguration +from ._container_registry_management_client import ContainerRegistryManagementClient +__all__ = ['ContainerRegistryManagementClient', 'ContainerRegistryManagementClientConfiguration'] -__all__ = ['ContainerRegistryManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/_configuration.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/_configuration.py new file mode 100644 index 000000000000..4e021787210f --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +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) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + 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 diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/_container_registry_management_client.py new file mode 100644 index 000000000000..4bfab1cfb7ef --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/_container_registry_management_client.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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import ContainerRegistryManagementClientConfiguration +from .operations import RegistriesOperations +from .operations import Operations +from . import models + + +class ContainerRegistryManagementClient(SDKClient): + """ContainerRegistryManagementClient + + :ivar config: Configuration for client. + :vartype config: ContainerRegistryManagementClientConfiguration + + :ivar registries: Registries operations + :vartype registries: azure.mgmt.containerregistry.v2017_03_01.operations.RegistriesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerregistry.v2017_03_01.operations.Operations + + :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.api_version = '2017-03-01' + 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) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/container_registry_management_client.py deleted file mode 100644 index 000827e1428c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/container_registry_management_client.py +++ /dev/null @@ -1,86 +0,0 @@ -# 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 . 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.v2017_03_01.operations.RegistriesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.containerregistry.v2017_03_01.operations.Operations - - :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.api_version = '2017-03-01' - 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) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/__init__.py index 1558231f6b05..af8fa8eaa0c4 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/__init__.py @@ -10,58 +10,58 @@ # -------------------------------------------------------------------------- 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 + from ._models_py3 import OperationDefinition + from ._models_py3 import OperationDisplayDefinition + from ._models_py3 import RegenerateCredentialParameters + from ._models_py3 import Registry + from ._models_py3 import RegistryCreateParameters + from ._models_py3 import RegistryListCredentialsResult + from ._models_py3 import RegistryNameCheckRequest + from ._models_py3 import RegistryNameStatus + from ._models_py3 import RegistryPassword + from ._models_py3 import RegistryUpdateParameters + from ._models_py3 import Resource + from ._models_py3 import Sku + from ._models_py3 import StorageAccountParameters + from ._models_py3 import StorageAccountProperties 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 ( + from ._models import OperationDefinition + from ._models import OperationDisplayDefinition + from ._models import RegenerateCredentialParameters + from ._models import Registry + from ._models import RegistryCreateParameters + from ._models import RegistryListCredentialsResult + from ._models import RegistryNameCheckRequest + from ._models import RegistryNameStatus + from ._models import RegistryPassword + from ._models import RegistryUpdateParameters + from ._models import Resource + from ._models import Sku + from ._models import StorageAccountParameters + from ._models import StorageAccountProperties +from ._paged_models import OperationDefinitionPaged +from ._paged_models import RegistryPaged +from ._container_registry_management_client_enums import ( SkuTier, ProvisioningState, PasswordName, ) __all__ = [ - 'RegistryNameCheckRequest', - 'RegistryNameStatus', - 'OperationDisplayDefinition', 'OperationDefinition', - 'Sku', - 'StorageAccountProperties', + 'OperationDisplayDefinition', + 'RegenerateCredentialParameters', 'Registry', - 'StorageAccountParameters', 'RegistryCreateParameters', - 'RegistryUpdateParameters', - 'RegistryPassword', 'RegistryListCredentialsResult', - 'RegenerateCredentialParameters', + 'RegistryNameCheckRequest', + 'RegistryNameStatus', + 'RegistryPassword', + 'RegistryUpdateParameters', 'Resource', + 'Sku', + 'StorageAccountParameters', + 'StorageAccountProperties', 'RegistryPaged', 'OperationDefinitionPaged', 'SkuTier', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/container_registry_management_client_enums.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/_container_registry_management_client_enums.py similarity index 100% rename from sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/container_registry_management_client_enums.py rename to sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/_container_registry_management_client_enums.py diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/_models.py new file mode 100644 index 000000000000..5d12912ad615 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/_models.py @@ -0,0 +1,468 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +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, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +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) + + +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, **kwargs): + super(RegenerateCredentialParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +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) + + +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, **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 = kwargs.get('admin_user_enabled', False) + self.storage_account = kwargs.get('storage_account', None) + + +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, **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) + + +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, **kwargs): + super(RegistryListCredentialsResult, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.passwords = kwargs.get('passwords', None) + + +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) + + +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) + + +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, **kwargs): + super(RegistryPassword, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +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, **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) + + +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, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + + +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, **kwargs): + super(StorageAccountParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.access_key = kwargs.get('access_key', None) + + +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, **kwargs): + super(StorageAccountProperties, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/_models_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/_models_py3.py new file mode 100644 index 000000000000..526103b45183 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/_models_py3.py @@ -0,0 +1,468 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/_paged_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/_paged_models.py new file mode 100644 index 000000000000..cd94326b5c81 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/_paged_models.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.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) +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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition.py deleted file mode 100644 index bf626f313f10..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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, **kwargs): - super(OperationDefinition, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition_paged.py deleted file mode 100644 index d2da48d2e29b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition_py3.py deleted file mode 100644 index f95ac74f01e7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_definition_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition.py deleted file mode 100644 index 6cb8463b21fc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition_py3.py deleted file mode 100644 index 98abb699335c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/operation_display_definition_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters.py deleted file mode 100644 index 369d12cf09e7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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, **kwargs): - super(RegenerateCredentialParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters_py3.py deleted file mode 100644 index 4b290d4e53e3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/regenerate_credential_parameters_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry.py deleted file mode 100644 index 144dc80248be..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry.py +++ /dev/null @@ -1,88 +0,0 @@ -# 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, **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 = kwargs.get('admin_user_enabled', False) - self.storage_account = kwargs.get('storage_account', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters.py deleted file mode 100644 index 23fe20120594..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters_py3.py deleted file mode 100644 index 6eeecd4cc8fa..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_create_parameters_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result.py deleted file mode 100644 index 78e594f3a99b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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, **kwargs): - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.passwords = kwargs.get('passwords', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result_py3.py deleted file mode 100644 index f66ca4006ed7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_list_credentials_result_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request.py deleted file mode 100644 index 9d4a575eac04..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request_py3.py deleted file mode 100644 index 67f5ff9be671..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_check_request_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status.py deleted file mode 100644 index 94345ba6d549..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status_py3.py deleted file mode 100644 index 8b7b264c2d0d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_name_status_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_paged.py deleted file mode 100644 index 09ec73b6169a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password.py deleted file mode 100644 index 695e0c9078a9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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, **kwargs): - super(RegistryPassword, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.value = kwargs.get('value', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password_py3.py deleted file mode 100644 index ef46326e9bc0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_password_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_py3.py deleted file mode 100644 index ba79fa81afd7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_py3.py +++ /dev/null @@ -1,88 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters.py deleted file mode 100644 index df0974b20539..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters_py3.py deleted file mode 100644 index 86c8fa769696..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_update_parameters_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource.py deleted file mode 100644 index 3965a6f0cf40..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource_py3.py deleted file mode 100644 index 3a1d4bc4edd1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/resource_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku.py deleted file mode 100644 index 71d20c90052f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku_py3.py deleted file mode 100644 index f4c58ea254e3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/sku_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters.py deleted file mode 100644 index fcad011732ae..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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, **kwargs): - super(StorageAccountParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.access_key = kwargs.get('access_key', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters_py3.py deleted file mode 100644 index cc1656726e04..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_parameters_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties.py deleted file mode 100644 index dc929f094999..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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, **kwargs): - super(StorageAccountProperties, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties_py3.py deleted file mode 100644 index c23352eedb94..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/storage_account_properties_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/__init__.py index a4048c69987b..dab7f4574b93 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .registries_operations import RegistriesOperations -from .operations import Operations +from ._registries_operations import RegistriesOperations +from ._operations import Operations __all__ = [ 'RegistriesOperations', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/_operations.py new file mode 100644 index 000000000000..9a0d316ac461 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/_operations.py @@ -0,0 +1,103 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-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.v2017_03_01.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2017_03_01.models.OperationDefinition] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.ContainerRegistry/operations'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/_registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/_registries_operations.py new file mode 100644 index 000000000000..600c97eae207 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/_registries_operations.py @@ -0,0 +1,673 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01" + + 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.v2017_03_01.models.RegistryNameStatus or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + registry_name_check_request = models.RegistryNameCheckRequest(name=name) + + # 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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2017_03_01.models.Registry 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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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_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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_create_parameters, 'RegistryCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('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_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 + ) + + 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( + 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + 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): + """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.v2017_03_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Registry or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerregistry.v2017_03_01.models.Registry or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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 + 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.v2017_03_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2017_03_01.models.Registry] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2017_03_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2017_03_01.models.Registry] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2017_03_01.models.RegistryListCredentialsResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2017_03_01.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.v2017_03_01.models.RegistryListCredentialsResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_credential_parameters = models.RegenerateCredentialParameters(name=name) + + # 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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/operations.py deleted file mode 100644 index 3fdb96944162..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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-03-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-03-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.v2017_03_01.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2017_03_01.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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/registries_operations.py deleted file mode 100644 index 146d80f519d1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/registries_operations.py +++ /dev/null @@ -1,672 +0,0 @@ -# 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. - :ivar api_version: The client API version. Constant value: "2017-03-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-03-01" - - 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.v2017_03_01.models.RegistryNameStatus or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - registry_name_check_request = models.RegistryNameCheckRequest(name=name) - - # 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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2017_03_01.models.Registry 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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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_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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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_create_parameters, 'RegistryCreateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('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_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 - ) - - 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( - 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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # 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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - 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): - """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.v2017_03_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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Registry or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerregistry.v2017_03_01.models.Registry or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # 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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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 - 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.v2017_03_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2017_03_01.models.Registry] - :raises: :class:`CloudError` - """ - 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', min_length=1) - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2017_03_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2017_03_01.models.Registry] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2017_03_01.models.RegistryListCredentialsResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # 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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2017_03_01.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.v2017_03_01.models.RegistryListCredentialsResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_credential_parameters = models.RegenerateCredentialParameters(name=name) - - # 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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/__init__.py index 511d3d37a4aa..81ad2ac1ed64 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .container_registry_management_client import ContainerRegistryManagementClient -from .version import VERSION +from ._configuration import ContainerRegistryManagementClientConfiguration +from ._container_registry_management_client import ContainerRegistryManagementClient +__all__ = ['ContainerRegistryManagementClient', 'ContainerRegistryManagementClientConfiguration'] -__all__ = ['ContainerRegistryManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/_configuration.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/_configuration.py new file mode 100644 index 000000000000..4e021787210f --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +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) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + 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 diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/_container_registry_management_client.py new file mode 100644 index 000000000000..a30310e721c4 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/_container_registry_management_client.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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import ContainerRegistryManagementClientConfiguration +from .operations import RegistriesOperations +from .operations import Operations +from .operations import ReplicationsOperations +from .operations import WebhooksOperations +from . import models + + +class ContainerRegistryManagementClient(SDKClient): + """ContainerRegistryManagementClient + + :ivar config: Configuration for client. + :vartype config: ContainerRegistryManagementClientConfiguration + + :ivar registries: Registries operations + :vartype registries: azure.mgmt.containerregistry.v2017_10_01.operations.RegistriesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerregistry.v2017_10_01.operations.Operations + :ivar replications: Replications operations + :vartype replications: azure.mgmt.containerregistry.v2017_10_01.operations.ReplicationsOperations + :ivar webhooks: Webhooks operations + :vartype webhooks: azure.mgmt.containerregistry.v2017_10_01.operations.WebhooksOperations + + :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.api_version = '2017-10-01' + 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) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/container_registry_management_client.py deleted file mode 100644 index 8ed2eae442ff..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/container_registry_management_client.py +++ /dev/null @@ -1,96 +0,0 @@ -# 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 . 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.v2017_10_01.operations.RegistriesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.containerregistry.v2017_10_01.operations.Operations - :ivar replications: Replications operations - :vartype replications: azure.mgmt.containerregistry.v2017_10_01.operations.ReplicationsOperations - :ivar webhooks: Webhooks operations - :vartype webhooks: azure.mgmt.containerregistry.v2017_10_01.operations.WebhooksOperations - - :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.api_version = '2017-10-01' - 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) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/__init__.py index 41a1b0766c10..b5057df80b65 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/__init__.py @@ -10,95 +10,95 @@ # -------------------------------------------------------------------------- try: - from .import_source_credentials_py3 import ImportSourceCredentials - from .import_source_py3 import ImportSource - from .import_image_parameters_py3 import ImportImageParameters - from .registry_name_check_request_py3 import RegistryNameCheckRequest - from .registry_name_status_py3 import RegistryNameStatus - from .operation_display_definition_py3 import OperationDisplayDefinition - from .operation_metric_specification_definition_py3 import OperationMetricSpecificationDefinition - from .operation_service_specification_definition_py3 import OperationServiceSpecificationDefinition - from .operation_definition_py3 import OperationDefinition - from .sku_py3 import Sku - from .status_py3 import Status - from .storage_account_properties_py3 import StorageAccountProperties - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - 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 .quarantine_policy_py3 import QuarantinePolicy - from .trust_policy_py3 import TrustPolicy - from .registry_policies_py3 import RegistryPolicies - 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 ._models_py3 import Actor + from ._models_py3 import CallbackConfig + from ._models_py3 import Event + from ._models_py3 import EventContent + from ._models_py3 import EventInfo + from ._models_py3 import EventRequestMessage + from ._models_py3 import EventResponseMessage + from ._models_py3 import ImportImageParameters + from ._models_py3 import ImportSource + from ._models_py3 import ImportSourceCredentials + from ._models_py3 import IPRule + from ._models_py3 import NetworkRuleSet + from ._models_py3 import OperationDefinition + from ._models_py3 import OperationDisplayDefinition + from ._models_py3 import OperationMetricSpecificationDefinition + from ._models_py3 import OperationServiceSpecificationDefinition + from ._models_py3 import QuarantinePolicy + from ._models_py3 import RegenerateCredentialParameters + from ._models_py3 import Registry + from ._models_py3 import RegistryListCredentialsResult + from ._models_py3 import RegistryNameCheckRequest + from ._models_py3 import RegistryNameStatus + from ._models_py3 import RegistryPassword + from ._models_py3 import RegistryPolicies + from ._models_py3 import RegistryUpdateParameters + from ._models_py3 import RegistryUsage + from ._models_py3 import RegistryUsageListResult + from ._models_py3 import Replication + from ._models_py3 import ReplicationUpdateParameters + from ._models_py3 import Request + from ._models_py3 import Resource + from ._models_py3 import Sku + from ._models_py3 import Source + from ._models_py3 import Status + from ._models_py3 import StorageAccountProperties + from ._models_py3 import Target + from ._models_py3 import TrustPolicy + from ._models_py3 import VirtualNetworkRule + from ._models_py3 import Webhook + from ._models_py3 import WebhookCreateParameters + from ._models_py3 import WebhookUpdateParameters except (SyntaxError, ImportError): - from .import_source_credentials import ImportSourceCredentials - from .import_source import ImportSource - from .import_image_parameters import ImportImageParameters - from .registry_name_check_request import RegistryNameCheckRequest - from .registry_name_status import RegistryNameStatus - from .operation_display_definition import OperationDisplayDefinition - from .operation_metric_specification_definition import OperationMetricSpecificationDefinition - from .operation_service_specification_definition import OperationServiceSpecificationDefinition - from .operation_definition import OperationDefinition - from .sku import Sku - from .status import Status - from .storage_account_properties import StorageAccountProperties - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - 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 .quarantine_policy import QuarantinePolicy - from .trust_policy import TrustPolicy - from .registry_policies import RegistryPolicies - 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 -from .webhook_paged import WebhookPaged -from .event_paged import EventPaged -from .container_registry_management_client_enums import ( + from ._models import Actor + from ._models import CallbackConfig + from ._models import Event + from ._models import EventContent + from ._models import EventInfo + from ._models import EventRequestMessage + from ._models import EventResponseMessage + from ._models import ImportImageParameters + from ._models import ImportSource + from ._models import ImportSourceCredentials + from ._models import IPRule + from ._models import NetworkRuleSet + from ._models import OperationDefinition + from ._models import OperationDisplayDefinition + from ._models import OperationMetricSpecificationDefinition + from ._models import OperationServiceSpecificationDefinition + from ._models import QuarantinePolicy + from ._models import RegenerateCredentialParameters + from ._models import Registry + from ._models import RegistryListCredentialsResult + from ._models import RegistryNameCheckRequest + from ._models import RegistryNameStatus + from ._models import RegistryPassword + from ._models import RegistryPolicies + from ._models import RegistryUpdateParameters + from ._models import RegistryUsage + from ._models import RegistryUsageListResult + from ._models import Replication + from ._models import ReplicationUpdateParameters + from ._models import Request + from ._models import Resource + from ._models import Sku + from ._models import Source + from ._models import Status + from ._models import StorageAccountProperties + from ._models import Target + from ._models import TrustPolicy + from ._models import VirtualNetworkRule + from ._models import Webhook + from ._models import WebhookCreateParameters + from ._models import WebhookUpdateParameters +from ._paged_models import EventPaged +from ._paged_models import OperationDefinitionPaged +from ._paged_models import RegistryPaged +from ._paged_models import ReplicationPaged +from ._paged_models import WebhookPaged +from ._container_registry_management_client_enums import ( ImportMode, SkuName, SkuTier, @@ -114,47 +114,47 @@ ) __all__ = [ - 'ImportSourceCredentials', - 'ImportSource', + 'Actor', + 'CallbackConfig', + 'Event', + 'EventContent', + 'EventInfo', + 'EventRequestMessage', + 'EventResponseMessage', 'ImportImageParameters', - 'RegistryNameCheckRequest', - 'RegistryNameStatus', + 'ImportSource', + 'ImportSourceCredentials', + 'IPRule', + 'NetworkRuleSet', + 'OperationDefinition', 'OperationDisplayDefinition', 'OperationMetricSpecificationDefinition', 'OperationServiceSpecificationDefinition', - 'OperationDefinition', - 'Sku', - 'Status', - 'StorageAccountProperties', - 'VirtualNetworkRule', - 'IPRule', - 'NetworkRuleSet', + 'QuarantinePolicy', + 'RegenerateCredentialParameters', 'Registry', - 'RegistryUpdateParameters', - 'RegistryPassword', 'RegistryListCredentialsResult', - 'RegenerateCredentialParameters', + 'RegistryNameCheckRequest', + 'RegistryNameStatus', + 'RegistryPassword', + 'RegistryPolicies', + 'RegistryUpdateParameters', 'RegistryUsage', 'RegistryUsageListResult', - 'QuarantinePolicy', - 'TrustPolicy', - 'RegistryPolicies', 'Replication', 'ReplicationUpdateParameters', + 'Request', + 'Resource', + 'Sku', + 'Source', + 'Status', + 'StorageAccountProperties', + 'Target', + 'TrustPolicy', + 'VirtualNetworkRule', 'Webhook', 'WebhookCreateParameters', 'WebhookUpdateParameters', - 'EventInfo', - 'CallbackConfig', - 'Target', - 'Request', - 'Actor', - 'Source', - 'EventContent', - 'EventRequestMessage', - 'EventResponseMessage', - 'Event', - 'Resource', 'RegistryPaged', 'OperationDefinitionPaged', 'ReplicationPaged', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/container_registry_management_client_enums.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/_container_registry_management_client_enums.py similarity index 100% rename from sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/container_registry_management_client_enums.py rename to sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/_container_registry_management_client_enums.py diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/_models.py new file mode 100644 index 000000000000..6013e3dbb15f --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/_models.py @@ -0,0 +1,1385 @@ +# 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) + + +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) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +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) + + +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, **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) + + +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, **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) + + +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, **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) + + +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) + + +class ImportImageParameters(Model): + """ImportImageParameters. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the image. + :type source: + ~azure.mgmt.containerregistry.v2017_10_01.models.ImportSource + :param target_tags: List of strings of the form repo[:tag]. When tag is + omitted the source will be used (or 'latest' if source tag is also + omitted). + :type target_tags: list[str] + :param untagged_target_repositories: List of strings of repository names + to do a manifest only copy. No tag will be created. + :type untagged_target_repositories: list[str] + :param mode: When Force, any existing target tags will be overwritten. + When NoForce, any existing target tags will fail the operation before any + copying begins. Possible values include: 'NoForce', 'Force'. Default + value: "NoForce" . + :type mode: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.ImportMode + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ImportSource'}, + 'target_tags': {'key': 'targetTags', 'type': '[str]'}, + 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportImageParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.target_tags = kwargs.get('target_tags', None) + self.untagged_target_repositories = kwargs.get('untagged_target_repositories', None) + self.mode = kwargs.get('mode', "NoForce") + + +class ImportSource(Model): + """ImportSource. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: The resource identifier of the source Azure Container + Registry. + :type resource_id: str + :param registry_uri: The address of the source registry (e.g. + 'mcr.microsoft.com'). + :type registry_uri: str + :param credentials: Credentials used when importing from a registry uri. + :type credentials: + ~azure.mgmt.containerregistry.v2017_10_01.models.ImportSourceCredentials + :param source_image: Required. Repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' + tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest + ('hello-world@sha256:abc123'). + :type source_image: str + """ + + _validation = { + 'source_image': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'registry_uri': {'key': 'registryUri', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, + 'source_image': {'key': 'sourceImage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportSource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.registry_uri = kwargs.get('registry_uri', None) + self.credentials = kwargs.get('credentials', None) + self.source_image = kwargs.get('source_image', None) + + +class ImportSourceCredentials(Model): + """ImportSourceCredentials. + + All required parameters must be populated in order to send to Azure. + + :param username: The username to authenticate with the source registry. + :type username: str + :param password: Required. The password used to authenticate with the + source registry. + :type password: str + """ + + _validation = { + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportSourceCredentials, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.Action + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.action = kwargs.get('action', "Allow") + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + + +class NetworkRuleSet(Model): + """The network rule set for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Required. The default action of allow or deny when + no other rules match. Possible values include: 'Allow', 'Deny'. Default + value: "Allow" . + :type default_action: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.DefaultAction + :param virtual_network_rules: The virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.containerregistry.v2017_10_01.models.VirtualNetworkRule] + :param ip_rules: The IP ACL rules. + :type ip_rules: + list[~azure.mgmt.containerregistry.v2017_10_01.models.IPRule] + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = kwargs.get('default_action', "Allow") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param origin: The origin information of the container registry operation. + :type origin: str + :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 + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2017_10_01.models.OperationServiceSpecificationDefinition + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, + } + + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.origin = kwargs.get('origin', None) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.service_specification = kwargs.get('service_specification', None) + + +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) + + +class OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) + + +class OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2017_10_01.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, **kwargs): + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + +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, **kwargs): + super(RegenerateCredentialParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +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) + + +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 + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2017_10_01.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + 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) + self.network_rule_set = kwargs.get('network_rule_set', None) + + +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, **kwargs): + super(RegistryListCredentialsResult, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.passwords = kwargs.get('passwords', None) + + +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) + + +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) + + +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, **kwargs): + super(RegistryPassword, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2017_10_01.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, **kwargs): + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = kwargs.get('quarantine_policy', None) + self.trust_policy = kwargs.get('trust_policy', None) + + +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 + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2017_10_01.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + 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) + self.network_rule_set = kwargs.get('network_rule_set', None) + + +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, **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) + + +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, **kwargs): + super(RegistryUsageListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +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, **kwargs): + super(Replication, self).__init__(**kwargs) + self.provisioning_state = None + self.status = None + + +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) + + +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) + + +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, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + + +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) + + +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 + + +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) + + +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 + :param name: The name of the artifact. + :type name: str + :param version: The version of the artifact. + :type version: 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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', '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) + self.name = kwargs.get('name', None) + self.version = kwargs.get('version', None) + + +class TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrustPolicy, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.status = kwargs.get('status', None) + + +class VirtualNetworkRule(Model): + """Virtual network rule. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.Action + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.action = kwargs.get('action', "Allow") + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + + +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, **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 + + +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, **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) + + +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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/_models_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/_models_py3.py new file mode 100644 index 000000000000..d1df6b37c5f8 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/_models_py3.py @@ -0,0 +1,1385 @@ +# 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 + + +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 + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +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 + + +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 + + +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 + + +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 + + +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 + + +class ImportImageParameters(Model): + """ImportImageParameters. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the image. + :type source: + ~azure.mgmt.containerregistry.v2017_10_01.models.ImportSource + :param target_tags: List of strings of the form repo[:tag]. When tag is + omitted the source will be used (or 'latest' if source tag is also + omitted). + :type target_tags: list[str] + :param untagged_target_repositories: List of strings of repository names + to do a manifest only copy. No tag will be created. + :type untagged_target_repositories: list[str] + :param mode: When Force, any existing target tags will be overwritten. + When NoForce, any existing target tags will fail the operation before any + copying begins. Possible values include: 'NoForce', 'Force'. Default + value: "NoForce" . + :type mode: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.ImportMode + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ImportSource'}, + 'target_tags': {'key': 'targetTags', 'type': '[str]'}, + 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, *, source, target_tags=None, untagged_target_repositories=None, mode="NoForce", **kwargs) -> None: + super(ImportImageParameters, self).__init__(**kwargs) + self.source = source + self.target_tags = target_tags + self.untagged_target_repositories = untagged_target_repositories + self.mode = mode + + +class ImportSource(Model): + """ImportSource. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: The resource identifier of the source Azure Container + Registry. + :type resource_id: str + :param registry_uri: The address of the source registry (e.g. + 'mcr.microsoft.com'). + :type registry_uri: str + :param credentials: Credentials used when importing from a registry uri. + :type credentials: + ~azure.mgmt.containerregistry.v2017_10_01.models.ImportSourceCredentials + :param source_image: Required. Repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' + tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest + ('hello-world@sha256:abc123'). + :type source_image: str + """ + + _validation = { + 'source_image': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'registry_uri': {'key': 'registryUri', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, + 'source_image': {'key': 'sourceImage', 'type': 'str'}, + } + + def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None: + super(ImportSource, self).__init__(**kwargs) + self.resource_id = resource_id + self.registry_uri = registry_uri + self.credentials = credentials + self.source_image = source_image + + +class ImportSourceCredentials(Model): + """ImportSourceCredentials. + + All required parameters must be populated in order to send to Azure. + + :param username: The username to authenticate with the source registry. + :type username: str + :param password: Required. The password used to authenticate with the + source registry. + :type password: str + """ + + _validation = { + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, password: str, username: str=None, **kwargs) -> None: + super(ImportSourceCredentials, self).__init__(**kwargs) + self.username = username + self.password = password + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.Action + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.action = action + self.ip_address_or_range = ip_address_or_range + + +class NetworkRuleSet(Model): + """The network rule set for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Required. The default action of allow or deny when + no other rules match. Possible values include: 'Allow', 'Deny'. Default + value: "Allow" . + :type default_action: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.DefaultAction + :param virtual_network_rules: The virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.containerregistry.v2017_10_01.models.VirtualNetworkRule] + :param ip_rules: The IP ACL rules. + :type ip_rules: + list[~azure.mgmt.containerregistry.v2017_10_01.models.IPRule] + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + } + + def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = default_action + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param origin: The origin information of the container registry operation. + :type origin: str + :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 + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2017_10_01.models.OperationServiceSpecificationDefinition + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, + } + + def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.origin = origin + self.name = name + self.display = display + self.service_specification = service_specification + + +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 + + +class OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.internal_metric_name = internal_metric_name + + +class OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2017_10_01.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status=None, **kwargs) -> None: + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = status + + +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 + + +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 + + +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 + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2017_10_01.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=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 + self.network_rule_set = network_rule_set + + +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 + + +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 + + +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 + + +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 + + +class RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2017_10_01.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, *, quarantine_policy=None, trust_policy=None, **kwargs) -> None: + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = quarantine_policy + self.trust_policy = trust_policy + + +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 + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2017_10_01.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, network_rule_set=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 + self.network_rule_set = network_rule_set + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + :param name: The name of the artifact. + :type name: str + :param version: The version of the artifact. + :type version: 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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', '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, name: str=None, version: 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 + self.name = name + self.version = version + + +class TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, type=None, status=None, **kwargs) -> None: + super(TrustPolicy, self).__init__(**kwargs) + self.type = type + self.status = status + + +class VirtualNetworkRule(Model): + """Virtual network rule. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.Action + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.action = action + self.virtual_network_resource_id = virtual_network_resource_id + + +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 + + +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 + + +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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/_paged_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/_paged_models.py new file mode 100644 index 000000000000..779140482352 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/_paged_models.py @@ -0,0 +1,79 @@ +# 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) +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) +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) +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) +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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor.py deleted file mode 100644 index a662f9008a31..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor_py3.py deleted file mode 100644 index fdd8b96dda52..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/actor_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config.py deleted file mode 100644 index 8ad43a9f785a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config_py3.py deleted file mode 100644 index 27ffc7825431..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/callback_config_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event.py deleted file mode 100644 index d112cef92241..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content.py deleted file mode 100644 index d6ee2394c8b8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content_py3.py deleted file mode 100644 index 2d7323c2b636..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_content_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info.py deleted file mode 100644 index 7199044b2e39..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info_py3.py deleted file mode 100644 index 192990067407..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_info_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_paged.py deleted file mode 100644 index 3260fdd5d1e7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_py3.py deleted file mode 100644 index 852342efcd4b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message.py deleted file mode 100644 index 3a16ad64c8e3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message_py3.py deleted file mode 100644 index 70d3b783c69c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_request_message_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message.py deleted file mode 100644 index ffb8feb12a1e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message_py3.py deleted file mode 100644 index 4b1351377b4b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_response_message_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_image_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_image_parameters.py deleted file mode 100644 index a6e1d9081cb7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_image_parameters.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportImageParameters(Model): - """ImportImageParameters. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. The source of the image. - :type source: - ~azure.mgmt.containerregistry.v2017_10_01.models.ImportSource - :param target_tags: List of strings of the form repo[:tag]. When tag is - omitted the source will be used (or 'latest' if source tag is also - omitted). - :type target_tags: list[str] - :param untagged_target_repositories: List of strings of repository names - to do a manifest only copy. No tag will be created. - :type untagged_target_repositories: list[str] - :param mode: When Force, any existing target tags will be overwritten. - When NoForce, any existing target tags will fail the operation before any - copying begins. Possible values include: 'NoForce', 'Force'. Default - value: "NoForce" . - :type mode: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.ImportMode - """ - - _validation = { - 'source': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ImportSource'}, - 'target_tags': {'key': 'targetTags', 'type': '[str]'}, - 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportImageParameters, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.target_tags = kwargs.get('target_tags', None) - self.untagged_target_repositories = kwargs.get('untagged_target_repositories', None) - self.mode = kwargs.get('mode', "NoForce") diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_image_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_image_parameters_py3.py deleted file mode 100644 index 5fa7efcc6547..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_image_parameters_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportImageParameters(Model): - """ImportImageParameters. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. The source of the image. - :type source: - ~azure.mgmt.containerregistry.v2017_10_01.models.ImportSource - :param target_tags: List of strings of the form repo[:tag]. When tag is - omitted the source will be used (or 'latest' if source tag is also - omitted). - :type target_tags: list[str] - :param untagged_target_repositories: List of strings of repository names - to do a manifest only copy. No tag will be created. - :type untagged_target_repositories: list[str] - :param mode: When Force, any existing target tags will be overwritten. - When NoForce, any existing target tags will fail the operation before any - copying begins. Possible values include: 'NoForce', 'Force'. Default - value: "NoForce" . - :type mode: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.ImportMode - """ - - _validation = { - 'source': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ImportSource'}, - 'target_tags': {'key': 'targetTags', 'type': '[str]'}, - 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__(self, *, source, target_tags=None, untagged_target_repositories=None, mode="NoForce", **kwargs) -> None: - super(ImportImageParameters, self).__init__(**kwargs) - self.source = source - self.target_tags = target_tags - self.untagged_target_repositories = untagged_target_repositories - self.mode = mode diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_source.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_source.py deleted file mode 100644 index f45c51cb6cd9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_source.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportSource(Model): - """ImportSource. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource identifier of the source Azure Container - Registry. - :type resource_id: str - :param registry_uri: The address of the source registry (e.g. - 'mcr.microsoft.com'). - :type registry_uri: str - :param credentials: Credentials used when importing from a registry uri. - :type credentials: - ~azure.mgmt.containerregistry.v2017_10_01.models.ImportSourceCredentials - :param source_image: Required. Repository name of the source image. - Specify an image by repository ('hello-world'). This will use the 'latest' - tag. - Specify an image by tag ('hello-world:latest'). - Specify an image by sha256-based manifest digest - ('hello-world@sha256:abc123'). - :type source_image: str - """ - - _validation = { - 'source_image': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'registry_uri': {'key': 'registryUri', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, - 'source_image': {'key': 'sourceImage', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportSource, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.registry_uri = kwargs.get('registry_uri', None) - self.credentials = kwargs.get('credentials', None) - self.source_image = kwargs.get('source_image', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_source_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_source_credentials.py deleted file mode 100644 index b31e5f7e8405..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_source_credentials.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ImportSourceCredentials(Model): - """ImportSourceCredentials. - - All required parameters must be populated in order to send to Azure. - - :param username: The username to authenticate with the source registry. - :type username: str - :param password: Required. The password used to authenticate with the - source registry. - :type password: str - """ - - _validation = { - 'password': {'required': True}, - } - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportSourceCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_source_credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_source_credentials_py3.py deleted file mode 100644 index 4a610e022f88..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_source_credentials_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ImportSourceCredentials(Model): - """ImportSourceCredentials. - - All required parameters must be populated in order to send to Azure. - - :param username: The username to authenticate with the source registry. - :type username: str - :param password: Required. The password used to authenticate with the - source registry. - :type password: str - """ - - _validation = { - 'password': {'required': True}, - } - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__(self, *, password: str, username: str=None, **kwargs) -> None: - super(ImportSourceCredentials, self).__init__(**kwargs) - self.username = username - self.password = password diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_source_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_source_py3.py deleted file mode 100644 index 7d09ecbb64f5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/import_source_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportSource(Model): - """ImportSource. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource identifier of the source Azure Container - Registry. - :type resource_id: str - :param registry_uri: The address of the source registry (e.g. - 'mcr.microsoft.com'). - :type registry_uri: str - :param credentials: Credentials used when importing from a registry uri. - :type credentials: - ~azure.mgmt.containerregistry.v2017_10_01.models.ImportSourceCredentials - :param source_image: Required. Repository name of the source image. - Specify an image by repository ('hello-world'). This will use the 'latest' - tag. - Specify an image by tag ('hello-world:latest'). - Specify an image by sha256-based manifest digest - ('hello-world@sha256:abc123'). - :type source_image: str - """ - - _validation = { - 'source_image': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'registry_uri': {'key': 'registryUri', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, - 'source_image': {'key': 'sourceImage', 'type': 'str'}, - } - - def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None: - super(ImportSource, self).__init__(**kwargs) - self.resource_id = resource_id - self.registry_uri = registry_uri - self.credentials = credentials - self.source_image = source_image diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/ip_rule.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/ip_rule.py deleted file mode 100644 index 770060dc29aa..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/ip_rule.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.Action - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.action = kwargs.get('action', "Allow") - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/ip_rule_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/ip_rule_py3.py deleted file mode 100644 index 6a40b118b246..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/ip_rule_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.Action - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.action = action - self.ip_address_or_range = ip_address_or_range diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/network_rule_set.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/network_rule_set.py deleted file mode 100644 index f2f05345b47f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/network_rule_set.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 NetworkRuleSet(Model): - """The network rule set for a container registry. - - All required parameters must be populated in order to send to Azure. - - :param default_action: Required. The default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . - :type default_action: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.DefaultAction - :param virtual_network_rules: The virtual network rules. - :type virtual_network_rules: - list[~azure.mgmt.containerregistry.v2017_10_01.models.VirtualNetworkRule] - :param ip_rules: The IP ACL rules. - :type ip_rules: - list[~azure.mgmt.containerregistry.v2017_10_01.models.IPRule] - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.default_action = kwargs.get('default_action', "Allow") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/network_rule_set_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/network_rule_set_py3.py deleted file mode 100644 index 7242ec1c746f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/network_rule_set_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 NetworkRuleSet(Model): - """The network rule set for a container registry. - - All required parameters must be populated in order to send to Azure. - - :param default_action: Required. The default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . - :type default_action: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.DefaultAction - :param virtual_network_rules: The virtual network rules. - :type virtual_network_rules: - list[~azure.mgmt.containerregistry.v2017_10_01.models.VirtualNetworkRule] - :param ip_rules: The IP ACL rules. - :type ip_rules: - list[~azure.mgmt.containerregistry.v2017_10_01.models.IPRule] - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.default_action = default_action - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition.py deleted file mode 100644 index c6a3a7eb8ffe..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 origin: The origin information of the container registry operation. - :type origin: str - :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 - :param service_specification: The definition of Azure Monitoring service. - :type service_specification: - ~azure.mgmt.containerregistry.v2017_10_01.models.OperationServiceSpecificationDefinition - """ - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, - } - - def __init__(self, **kwargs): - super(OperationDefinition, self).__init__(**kwargs) - self.origin = kwargs.get('origin', None) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_paged.py deleted file mode 100644 index be0fce16a1be..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_py3.py deleted file mode 100644 index 9dcc5c41ab11..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 origin: The origin information of the container registry operation. - :type origin: str - :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 - :param service_specification: The definition of Azure Monitoring service. - :type service_specification: - ~azure.mgmt.containerregistry.v2017_10_01.models.OperationServiceSpecificationDefinition - """ - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, - } - - def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: - super(OperationDefinition, self).__init__(**kwargs) - self.origin = origin - self.name = name - self.display = display - self.service_specification = service_specification diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition.py deleted file mode 100644 index 6cb8463b21fc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition_py3.py deleted file mode 100644 index 98abb699335c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_display_definition_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_metric_specification_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_metric_specification_definition.py deleted file mode 100644 index 8b40b3b4d6f1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_metric_specification_definition.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 OperationMetricSpecificationDefinition(Model): - """The definition of Azure Monitoring metric. - - :param name: Metric name. - :type name: str - :param display_name: Metric display name. - :type display_name: str - :param display_description: Metric description. - :type display_description: str - :param unit: Metric unit. - :type unit: str - :param aggregation_type: Metric aggregation type. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.internal_metric_name = kwargs.get('internal_metric_name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_metric_specification_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_metric_specification_definition_py3.py deleted file mode 100644 index db4f31c14a17..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_metric_specification_definition_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 OperationMetricSpecificationDefinition(Model): - """The definition of Azure Monitoring metric. - - :param name: Metric name. - :type name: str - :param display_name: Metric display name. - :type display_name: str - :param display_description: Metric description. - :type display_description: str - :param unit: Metric unit. - :type unit: str - :param aggregation_type: Metric aggregation type. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: - super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.internal_metric_name = internal_metric_name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_service_specification_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_service_specification_definition.py deleted file mode 100644 index a7d9b567970c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_service_specification_definition.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 OperationServiceSpecificationDefinition(Model): - """The definition of Azure Monitoring metrics list. - - :param metric_specifications: A list of Azure Monitoring metrics - definition. - :type metric_specifications: - list[~azure.mgmt.containerregistry.v2017_10_01.models.OperationMetricSpecificationDefinition] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, - } - - def __init__(self, **kwargs): - super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_service_specification_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_service_specification_definition_py3.py deleted file mode 100644 index 4244eadaed6f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_service_specification_definition_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 OperationServiceSpecificationDefinition(Model): - """The definition of Azure Monitoring metrics list. - - :param metric_specifications: A list of Azure Monitoring metrics - definition. - :type metric_specifications: - list[~azure.mgmt.containerregistry.v2017_10_01.models.OperationMetricSpecificationDefinition] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/quarantine_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/quarantine_policy.py deleted file mode 100644 index 005993e2025d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/quarantine_policy.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 QuarantinePolicy(Model): - """An object that represents quarantine policy for a container registry. - - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.PolicyStatus - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(QuarantinePolicy, self).__init__(**kwargs) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/quarantine_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/quarantine_policy_py3.py deleted file mode 100644 index 3a8ab60d0aa1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/quarantine_policy_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 QuarantinePolicy(Model): - """An object that represents quarantine policy for a container registry. - - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.PolicyStatus - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, status=None, **kwargs) -> None: - super(QuarantinePolicy, self).__init__(**kwargs) - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters.py deleted file mode 100644 index bf56b8462b6d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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, **kwargs): - super(RegenerateCredentialParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters_py3.py deleted file mode 100644 index cc6a695c1180..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/regenerate_credential_parameters_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry.py deleted file mode 100644 index 665a6f3adf3c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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 - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2017_10_01.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - 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) - self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result.py deleted file mode 100644 index e71ee8881a9c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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, **kwargs): - super(RegistryListCredentialsResult, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.passwords = kwargs.get('passwords', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result_py3.py deleted file mode 100644 index 7c6381ae9aac..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_list_credentials_result_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request.py deleted file mode 100644 index 9d4a575eac04..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request_py3.py deleted file mode 100644 index 67f5ff9be671..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_check_request_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status.py deleted file mode 100644 index 94345ba6d549..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status_py3.py deleted file mode 100644 index 8b7b264c2d0d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_name_status_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_paged.py deleted file mode 100644 index 24c3ad95e37e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password.py deleted file mode 100644 index 0c66463a1ef3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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, **kwargs): - super(RegistryPassword, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.value = kwargs.get('value', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password_py3.py deleted file mode 100644 index 7e49069eb5d2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_password_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_policies.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_policies.py deleted file mode 100644 index 5fb9da276d8b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_policies.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 RegistryPolicies(Model): - """An object that represents policies for a container registry. - - :param quarantine_policy: An object that represents quarantine policy for - a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2017_10_01.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy for a - container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicy - """ - - _attribute_map = { - 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, - 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, - } - - def __init__(self, **kwargs): - super(RegistryPolicies, self).__init__(**kwargs) - self.quarantine_policy = kwargs.get('quarantine_policy', None) - self.trust_policy = kwargs.get('trust_policy', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_policies_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_policies_py3.py deleted file mode 100644 index 478414895fc8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_policies_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 RegistryPolicies(Model): - """An object that represents policies for a container registry. - - :param quarantine_policy: An object that represents quarantine policy for - a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2017_10_01.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy for a - container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicy - """ - - _attribute_map = { - 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, - 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, - } - - def __init__(self, *, quarantine_policy=None, trust_policy=None, **kwargs) -> None: - super(RegistryPolicies, self).__init__(**kwargs) - self.quarantine_policy = quarantine_policy - self.trust_policy = trust_policy diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_py3.py deleted file mode 100644 index f75dd233428a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_py3.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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_py3 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 - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2017_10_01.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=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 - self.network_rule_set = network_rule_set diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters.py deleted file mode 100644 index 11317a0df58b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2017_10_01.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - 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) - self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters_py3.py deleted file mode 100644 index 92f3d34bb8c9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_update_parameters_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2017_10_01.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, network_rule_set=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 - self.network_rule_set = network_rule_set diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage.py deleted file mode 100644 index 87346ec9933e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result.py deleted file mode 100644 index c30676853b1a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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, **kwargs): - super(RegistryUsageListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result_py3.py deleted file mode 100644 index 9eab053f50a8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_list_result_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_py3.py deleted file mode 100644 index 22f745553ad1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_usage_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication.py deleted file mode 100644 index 2c41180924e5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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, **kwargs): - super(Replication, self).__init__(**kwargs) - self.provisioning_state = None - self.status = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_paged.py deleted file mode 100644 index 0295ae67e860..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_py3.py deleted file mode 100644 index 7024913b8b59..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_py3.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters.py deleted file mode 100644 index 003b15583a55..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters_py3.py deleted file mode 100644 index 5497bcdbc1f7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_update_parameters_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request.py deleted file mode 100644 index e08090f53205..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request_py3.py deleted file mode 100644 index f42dae28c955..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/request_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource.py deleted file mode 100644 index 3965a6f0cf40..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource_py3.py deleted file mode 100644 index 3a1d4bc4edd1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/resource_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku.py deleted file mode 100644 index c0d18e913544..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku_py3.py deleted file mode 100644 index 9451e13be1fd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/sku_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source.py deleted file mode 100644 index 132f4b2c1324..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source_py3.py deleted file mode 100644 index 5aadcd407862..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/source_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status.py deleted file mode 100644 index 76444c500634..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status_py3.py deleted file mode 100644 index 1f4611c49912..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/status_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties.py deleted file mode 100644 index 0541b7651cbd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties_py3.py deleted file mode 100644 index 5714fde0fcd2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/storage_account_properties_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target.py deleted file mode 100644 index 228df1d19f00..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', '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) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target_py3.py deleted file mode 100644 index 3b312ee2c0da..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/target_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', '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, name: str=None, version: 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 - self.name = name - self.version = version diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/trust_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/trust_policy.py deleted file mode 100644 index f01b9e4e6560..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/trust_policy.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TrustPolicy(Model): - """An object that represents content trust policy for a container registry. - - :param type: The type of trust policy. Possible values include: 'Notary' - :type type: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicyType - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.PolicyStatus - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrustPolicy, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/trust_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/trust_policy_py3.py deleted file mode 100644 index 0ecc57d83c51..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/trust_policy_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TrustPolicy(Model): - """An object that represents content trust policy for a container registry. - - :param type: The type of trust policy. Possible values include: 'Notary' - :type type: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicyType - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.PolicyStatus - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, type=None, status=None, **kwargs) -> None: - super(TrustPolicy, self).__init__(**kwargs) - self.type = type - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/virtual_network_rule.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/virtual_network_rule.py deleted file mode 100644 index 11acf066faca..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/virtual_network_rule.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual network rule. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.Action - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.action = kwargs.get('action', "Allow") - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/virtual_network_rule_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/virtual_network_rule_py3.py deleted file mode 100644 index 7ba12d1851f5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual network rule. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2017_10_01.models.Action - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.action = action - self.virtual_network_resource_id = virtual_network_resource_id diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook.py deleted file mode 100644 index 9777a3f7c907..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters.py deleted file mode 100644 index 3194208c2309..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters_py3.py deleted file mode 100644 index 4278678a34ca..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_create_parameters_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_paged.py deleted file mode 100644 index a1952e2749f4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_py3.py deleted file mode 100644 index db1f752a8b3b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters.py deleted file mode 100644 index 120a18bd2506..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters_py3.py deleted file mode 100644 index 8e35f6bc9407..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_update_parameters_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/__init__.py index 3e583ae9a985..a0464d6c8584 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/__init__.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .registries_operations import RegistriesOperations -from .operations import Operations -from .replications_operations import ReplicationsOperations -from .webhooks_operations import WebhooksOperations +from ._registries_operations import RegistriesOperations +from ._operations import Operations +from ._replications_operations import ReplicationsOperations +from ._webhooks_operations import WebhooksOperations __all__ = [ 'RegistriesOperations', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_operations.py new file mode 100644 index 000000000000..f4358d232eed --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_operations.py @@ -0,0 +1,103 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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.v2017_10_01.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2017_10_01.models.OperationDefinition] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.ContainerRegistry/operations'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_registries_operations.py new file mode 100644 index 000000000000..ad2250a030a1 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_registries_operations.py @@ -0,0 +1,1061 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 _import_image_initial( + self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.import_image.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', min_length=1), + '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') + + # 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(parameters, 'ImportImageParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 import_image( + self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Copies an image to this container registry from 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 parameters: The parameters specifying the image to copy and the + source container registry. + :type parameters: + ~azure.mgmt.containerregistry.v2017_10_01.models.ImportImageParameters + :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._import_image_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + parameters=parameters, + 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) + import_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage'} + + 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.v2017_10_01.models.RegistryNameStatus or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + registry_name_check_request = models.RegistryNameCheckRequest(name=name) + + # 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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2017_10_01.models.Registry 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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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): + # 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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.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) + 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): + # 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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, 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): + # 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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.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 + ) + + 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.v2017_10_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2017_10_01.models.Registry] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2017_10_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2017_10_01.models.Registry] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2017_10_01.models.RegistryListCredentialsResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2017_10_01.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.v2017_10_01.models.RegistryListCredentialsResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_credential_parameters = models.RegenerateCredentialParameters(name=name) + + # 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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2017_10_01.models.RegistryUsageListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 list_policies( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists the policies 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: RegistryPolicies or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2017_10_01.models.RegistryPolicies or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_policies.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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'} + + + def _update_policies_initial( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, **operation_config): + registry_policies_update_parameters = models.RegistryPolicies(quarantine_policy=quarantine_policy, trust_policy=trust_policy) + + # Construct URL + url = self.update_policies.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', min_length=1), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_policies_update_parameters, 'RegistryPolicies') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_policies( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the policies 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 quarantine_policy: An object that represents quarantine policy + for a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2017_10_01.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy + for a container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicy + :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 RegistryPolicies or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.RegistryPolicies] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2017_10_01.models.RegistryPolicies]] + :raises: :class:`CloudError` + """ + raw_result = self._update_policies_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + quarantine_policy=quarantine_policy, + trust_policy=trust_policy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RegistryPolicies', 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_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_replications_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_replications_operations.py new file mode 100644 index 000000000000..27f491af91b4 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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.v2017_10_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.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 = 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.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 + ) + + 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.v2017_10_01.models.ReplicationPaged[~azure.mgmt.containerregistry.v2017_10_01.models.Replication] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.ReplicationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_webhooks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_webhooks_operations.py new file mode 100644 index 000000000000..80af8558f9dd --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_webhooks_operations.py @@ -0,0 +1,691 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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.v2017_10_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2017_10_01.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.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 = 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.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 + ) + + 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.v2017_10_01.models.WebhookPaged[~azure.mgmt.containerregistry.v2017_10_01.models.Webhook] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.WebhookPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2017_10_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2017_10_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2017_10_01.models.EventPaged[~azure.mgmt.containerregistry.v2017_10_01.models.Event] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.EventPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_events.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/operations.py deleted file mode 100644 index 5a7cc0c5c02b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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.v2017_10_01.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2017_10_01.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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/registries_operations.py deleted file mode 100644 index efb8cf96cb78..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/registries_operations.py +++ /dev/null @@ -1,1061 +0,0 @@ -# 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. - :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 _import_image_initial( - self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.import_image.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', min_length=1), - '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') - - # 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(parameters, 'ImportImageParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 import_image( - self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Copies an image to this container registry from 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 parameters: The parameters specifying the image to copy and the - source container registry. - :type parameters: - ~azure.mgmt.containerregistry.v2017_10_01.models.ImportImageParameters - :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._import_image_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - parameters=parameters, - 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) - import_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage'} - - 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.v2017_10_01.models.RegistryNameStatus or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - registry_name_check_request = models.RegistryNameCheckRequest(name=name) - - # 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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2017_10_01.models.Registry 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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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): - # 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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.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) - 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): - # 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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, 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): - # 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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.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 - ) - - 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.v2017_10_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2017_10_01.models.Registry] - :raises: :class:`CloudError` - """ - 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', min_length=1) - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2017_10_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2017_10_01.models.Registry] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2017_10_01.models.RegistryListCredentialsResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # 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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2017_10_01.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.v2017_10_01.models.RegistryListCredentialsResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_credential_parameters = models.RegenerateCredentialParameters(name=name) - - # 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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2017_10_01.models.RegistryUsageListResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # 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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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 list_policies( - self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): - """Lists the policies 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: RegistryPolicies or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerregistry.v2017_10_01.models.RegistryPolicies or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_policies.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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('RegistryPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'} - - - def _update_policies_initial( - self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, **operation_config): - registry_policies_update_parameters = models.RegistryPolicies(quarantine_policy=quarantine_policy, trust_policy=trust_policy) - - # Construct URL - url = self.update_policies.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', min_length=1), - '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') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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_policies_update_parameters, 'RegistryPolicies') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('RegistryPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update_policies( - self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates the policies 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 quarantine_policy: An object that represents quarantine policy - for a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2017_10_01.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy - for a container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicy - :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 RegistryPolicies or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.RegistryPolicies] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2017_10_01.models.RegistryPolicies]] - :raises: :class:`CloudError` - """ - raw_result = self._update_policies_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - quarantine_policy=quarantine_policy, - trust_policy=trust_policy, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('RegistryPolicies', 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_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/replications_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/replications_operations.py deleted file mode 100644 index 9b06b310ac36..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/replications_operations.py +++ /dev/null @@ -1,485 +0,0 @@ -# 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.v2017_10_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.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 = 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.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 - ) - - 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.v2017_10_01.models.ReplicationPaged[~azure.mgmt.containerregistry.v2017_10_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/webhooks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/webhooks_operations.py deleted file mode 100644 index 8d315567e16d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/webhooks_operations.py +++ /dev/null @@ -1,688 +0,0 @@ -# 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.v2017_10_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2017_10_01.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.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 = 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.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 - ) - - 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.v2017_10_01.models.WebhookPaged[~azure.mgmt.containerregistry.v2017_10_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2017_10_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2017_10_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2017_10_01.models.EventPaged[~azure.mgmt.containerregistry.v2017_10_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/__init__.py index 511d3d37a4aa..81ad2ac1ed64 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .container_registry_management_client import ContainerRegistryManagementClient -from .version import VERSION +from ._configuration import ContainerRegistryManagementClientConfiguration +from ._container_registry_management_client import ContainerRegistryManagementClient +__all__ = ['ContainerRegistryManagementClient', 'ContainerRegistryManagementClientConfiguration'] -__all__ = ['ContainerRegistryManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/_configuration.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/_configuration.py new file mode 100644 index 000000000000..4e021787210f --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +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) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + 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 diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/_container_registry_management_client.py new file mode 100644 index 000000000000..f5c584b9d212 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/_container_registry_management_client.py @@ -0,0 +1,78 @@ +# 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 ._configuration import ContainerRegistryManagementClientConfiguration +from .operations import RegistriesOperations +from .operations import Operations +from .operations import ReplicationsOperations +from .operations import WebhooksOperations +from .operations import BuildsOperations +from .operations import BuildStepsOperations +from .operations import BuildTasksOperations +from . import models + + +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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/container_registry_management_client.py deleted file mode 100644 index 0d03e81c342a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/container_registry_management_client.py +++ /dev/null @@ -1,110 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/__init__.py index eecd55704b4f..f5f0b836b861 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/__init__.py @@ -10,153 +10,153 @@ # -------------------------------------------------------------------------- try: - from .import_source_credentials_py3 import ImportSourceCredentials - from .import_source_py3 import ImportSource - from .import_image_parameters_py3 import ImportImageParameters - from .registry_name_check_request_py3 import RegistryNameCheckRequest - from .registry_name_status_py3 import RegistryNameStatus - from .operation_display_definition_py3 import OperationDisplayDefinition - from .operation_metric_specification_definition_py3 import OperationMetricSpecificationDefinition - from .operation_service_specification_definition_py3 import OperationServiceSpecificationDefinition - from .operation_definition_py3 import OperationDefinition - from .sku_py3 import Sku - from .status_py3 import Status - from .storage_account_properties_py3 import StorageAccountProperties - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - 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 .quarantine_policy_py3 import QuarantinePolicy - from .trust_policy_py3 import TrustPolicy - from .registry_policies_py3 import RegistryPolicies - 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 + from ._models_py3 import Actor + from ._models_py3 import BaseImageDependency + from ._models_py3 import Build + from ._models_py3 import BuildArgument + from ._models_py3 import BuildFilter + from ._models_py3 import BuildGetLogResult + from ._models_py3 import BuildStep + from ._models_py3 import BuildStepProperties + from ._models_py3 import BuildStepPropertiesUpdateParameters + from ._models_py3 import BuildStepUpdateParameters + from ._models_py3 import BuildTask + from ._models_py3 import BuildTaskBuildRequest + from ._models_py3 import BuildTaskFilter + from ._models_py3 import BuildTaskUpdateParameters + from ._models_py3 import BuildUpdateParameters + from ._models_py3 import CallbackConfig + from ._models_py3 import DockerBuildStep + from ._models_py3 import DockerBuildStepUpdateParameters + from ._models_py3 import Event + from ._models_py3 import EventContent + from ._models_py3 import EventInfo + from ._models_py3 import EventRequestMessage + from ._models_py3 import EventResponseMessage + from ._models_py3 import GitCommitTrigger + from ._models_py3 import ImageDescriptor + from ._models_py3 import ImageUpdateTrigger + from ._models_py3 import ImportImageParameters + from ._models_py3 import ImportSource + from ._models_py3 import ImportSourceCredentials + from ._models_py3 import IPRule + from ._models_py3 import NetworkRuleSet + from ._models_py3 import OperationDefinition + from ._models_py3 import OperationDisplayDefinition + from ._models_py3 import OperationMetricSpecificationDefinition + from ._models_py3 import OperationServiceSpecificationDefinition + from ._models_py3 import PlatformProperties + from ._models_py3 import ProxyResource + from ._models_py3 import QuarantinePolicy + from ._models_py3 import QueueBuildRequest + from ._models_py3 import QuickBuildRequest + from ._models_py3 import RegenerateCredentialParameters + from ._models_py3 import Registry + from ._models_py3 import RegistryListCredentialsResult + from ._models_py3 import RegistryNameCheckRequest + from ._models_py3 import RegistryNameStatus + from ._models_py3 import RegistryPassword + from ._models_py3 import RegistryPolicies + from ._models_py3 import RegistryUpdateParameters + from ._models_py3 import RegistryUsage + from ._models_py3 import RegistryUsageListResult + from ._models_py3 import Replication + from ._models_py3 import ReplicationUpdateParameters + from ._models_py3 import Request + from ._models_py3 import Resource + from ._models_py3 import Sku + from ._models_py3 import Source + from ._models_py3 import SourceControlAuthInfo + from ._models_py3 import SourceRepositoryProperties + from ._models_py3 import SourceRepositoryUpdateParameters + from ._models_py3 import SourceUploadDefinition + from ._models_py3 import Status + from ._models_py3 import StorageAccountProperties + from ._models_py3 import Target + from ._models_py3 import TrustPolicy + from ._models_py3 import VirtualNetworkRule + from ._models_py3 import Webhook + from ._models_py3 import WebhookCreateParameters + from ._models_py3 import WebhookUpdateParameters except (SyntaxError, ImportError): - from .import_source_credentials import ImportSourceCredentials - from .import_source import ImportSource - from .import_image_parameters import ImportImageParameters - from .registry_name_check_request import RegistryNameCheckRequest - from .registry_name_status import RegistryNameStatus - from .operation_display_definition import OperationDisplayDefinition - from .operation_metric_specification_definition import OperationMetricSpecificationDefinition - from .operation_service_specification_definition import OperationServiceSpecificationDefinition - from .operation_definition import OperationDefinition - from .sku import Sku - from .status import Status - from .storage_account_properties import StorageAccountProperties - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - 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 .quarantine_policy import QuarantinePolicy - from .trust_policy import TrustPolicy - from .registry_policies import RegistryPolicies - 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 ( + from ._models import Actor + from ._models import BaseImageDependency + from ._models import Build + from ._models import BuildArgument + from ._models import BuildFilter + from ._models import BuildGetLogResult + from ._models import BuildStep + from ._models import BuildStepProperties + from ._models import BuildStepPropertiesUpdateParameters + from ._models import BuildStepUpdateParameters + from ._models import BuildTask + from ._models import BuildTaskBuildRequest + from ._models import BuildTaskFilter + from ._models import BuildTaskUpdateParameters + from ._models import BuildUpdateParameters + from ._models import CallbackConfig + from ._models import DockerBuildStep + from ._models import DockerBuildStepUpdateParameters + from ._models import Event + from ._models import EventContent + from ._models import EventInfo + from ._models import EventRequestMessage + from ._models import EventResponseMessage + from ._models import GitCommitTrigger + from ._models import ImageDescriptor + from ._models import ImageUpdateTrigger + from ._models import ImportImageParameters + from ._models import ImportSource + from ._models import ImportSourceCredentials + from ._models import IPRule + from ._models import NetworkRuleSet + from ._models import OperationDefinition + from ._models import OperationDisplayDefinition + from ._models import OperationMetricSpecificationDefinition + from ._models import OperationServiceSpecificationDefinition + from ._models import PlatformProperties + from ._models import ProxyResource + from ._models import QuarantinePolicy + from ._models import QueueBuildRequest + from ._models import QuickBuildRequest + from ._models import RegenerateCredentialParameters + from ._models import Registry + from ._models import RegistryListCredentialsResult + from ._models import RegistryNameCheckRequest + from ._models import RegistryNameStatus + from ._models import RegistryPassword + from ._models import RegistryPolicies + from ._models import RegistryUpdateParameters + from ._models import RegistryUsage + from ._models import RegistryUsageListResult + from ._models import Replication + from ._models import ReplicationUpdateParameters + from ._models import Request + from ._models import Resource + from ._models import Sku + from ._models import Source + from ._models import SourceControlAuthInfo + from ._models import SourceRepositoryProperties + from ._models import SourceRepositoryUpdateParameters + from ._models import SourceUploadDefinition + from ._models import Status + from ._models import StorageAccountProperties + from ._models import Target + from ._models import TrustPolicy + from ._models import VirtualNetworkRule + from ._models import Webhook + from ._models import WebhookCreateParameters + from ._models import WebhookUpdateParameters +from ._paged_models import BuildArgumentPaged +from ._paged_models import BuildPaged +from ._paged_models import BuildStepPaged +from ._paged_models import BuildTaskPaged +from ._paged_models import EventPaged +from ._paged_models import OperationDefinitionPaged +from ._paged_models import RegistryPaged +from ._paged_models import ReplicationPaged +from ._paged_models import WebhookPaged +from ._container_registry_management_client_enums import ( ImportMode, SkuName, SkuTier, @@ -180,74 +180,74 @@ ) __all__ = [ - 'ImportSourceCredentials', - 'ImportSource', + 'Actor', + 'BaseImageDependency', + 'Build', + 'BuildArgument', + 'BuildFilter', + 'BuildGetLogResult', + 'BuildStep', + 'BuildStepProperties', + 'BuildStepPropertiesUpdateParameters', + 'BuildStepUpdateParameters', + 'BuildTask', + 'BuildTaskBuildRequest', + 'BuildTaskFilter', + 'BuildTaskUpdateParameters', + 'BuildUpdateParameters', + 'CallbackConfig', + 'DockerBuildStep', + 'DockerBuildStepUpdateParameters', + 'Event', + 'EventContent', + 'EventInfo', + 'EventRequestMessage', + 'EventResponseMessage', + 'GitCommitTrigger', + 'ImageDescriptor', + 'ImageUpdateTrigger', 'ImportImageParameters', - 'RegistryNameCheckRequest', - 'RegistryNameStatus', + 'ImportSource', + 'ImportSourceCredentials', + 'IPRule', + 'NetworkRuleSet', + 'OperationDefinition', 'OperationDisplayDefinition', 'OperationMetricSpecificationDefinition', 'OperationServiceSpecificationDefinition', - 'OperationDefinition', - 'Sku', - 'Status', - 'StorageAccountProperties', - 'VirtualNetworkRule', - 'IPRule', - 'NetworkRuleSet', + 'PlatformProperties', + 'ProxyResource', + 'QuarantinePolicy', + 'QueueBuildRequest', + 'QuickBuildRequest', + 'RegenerateCredentialParameters', 'Registry', - 'RegistryUpdateParameters', - 'RegistryPassword', 'RegistryListCredentialsResult', - 'RegenerateCredentialParameters', + 'RegistryNameCheckRequest', + 'RegistryNameStatus', + 'RegistryPassword', + 'RegistryPolicies', + 'RegistryUpdateParameters', 'RegistryUsage', 'RegistryUsageListResult', - 'QuarantinePolicy', - 'TrustPolicy', - 'RegistryPolicies', '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', + 'Sku', + 'Source', 'SourceControlAuthInfo', 'SourceRepositoryProperties', - 'BuildTask', - 'BuildTaskFilter', 'SourceRepositoryUpdateParameters', - 'BuildTaskUpdateParameters', - 'QueueBuildRequest', 'SourceUploadDefinition', - 'ProxyResource', - 'BaseImageDependency', - 'DockerBuildStep', - 'DockerBuildStepUpdateParameters', - 'BuildTaskBuildRequest', - 'QuickBuildRequest', + 'Status', + 'StorageAccountProperties', + 'Target', + 'TrustPolicy', + 'VirtualNetworkRule', + 'Webhook', + 'WebhookCreateParameters', + 'WebhookUpdateParameters', 'RegistryPaged', 'OperationDefinitionPaged', 'ReplicationPaged', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/container_registry_management_client_enums.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/_container_registry_management_client_enums.py similarity index 100% rename from sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/container_registry_management_client_enums.py rename to sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/_container_registry_management_client_enums.py diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/_models.py new file mode 100644 index 000000000000..00c21c0ae96f --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/_models.py @@ -0,0 +1,2466 @@ +# 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) + + +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) + + +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 + + +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) + + +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) + + +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_manifests: The list of comma-separated image manifests + that were generated from the build. + :type output_image_manifests: 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_manifests': {'key': 'outputImageManifests', '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_manifests = kwargs.get('output_image_manifests', None) + self.is_archive_enabled = kwargs.get('is_archive_enabled', None) + self.build_task_name = kwargs.get('build_task_name', None) + + +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) + + +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) + + +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 + + +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 + + +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) + + +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) + + +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) + + +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 + + +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' + + +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) + + +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) + + +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) + + +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) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +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' + + +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' + + +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) + + +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) + + +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) + + +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) + + +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) + + +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) + + +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) + + +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) + + +class ImportImageParameters(Model): + """ImportImageParameters. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the image. + :type source: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportSource + :param target_tags: List of strings of the form repo[:tag]. When tag is + omitted the source will be used (or 'latest' if source tag is also + omitted). + :type target_tags: list[str] + :param untagged_target_repositories: List of strings of repository names + to do a manifest only copy. No tag will be created. + :type untagged_target_repositories: list[str] + :param mode: When Force, any existing target tags will be overwritten. + When NoForce, any existing target tags will fail the operation before any + copying begins. Possible values include: 'NoForce', 'Force'. Default + value: "NoForce" . + :type mode: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportMode + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ImportSource'}, + 'target_tags': {'key': 'targetTags', 'type': '[str]'}, + 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportImageParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.target_tags = kwargs.get('target_tags', None) + self.untagged_target_repositories = kwargs.get('untagged_target_repositories', None) + self.mode = kwargs.get('mode', "NoForce") + + +class ImportSource(Model): + """ImportSource. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: The resource identifier of the source Azure Container + Registry. + :type resource_id: str + :param registry_uri: The address of the source registry (e.g. + 'mcr.microsoft.com'). + :type registry_uri: str + :param credentials: Credentials used when importing from a registry uri. + :type credentials: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportSourceCredentials + :param source_image: Required. Repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' + tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest + ('hello-world@sha256:abc123'). + :type source_image: str + """ + + _validation = { + 'source_image': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'registry_uri': {'key': 'registryUri', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, + 'source_image': {'key': 'sourceImage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportSource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.registry_uri = kwargs.get('registry_uri', None) + self.credentials = kwargs.get('credentials', None) + self.source_image = kwargs.get('source_image', None) + + +class ImportSourceCredentials(Model): + """ImportSourceCredentials. + + All required parameters must be populated in order to send to Azure. + + :param username: The username to authenticate with the source registry. + :type username: str + :param password: Required. The password used to authenticate with the + source registry. + :type password: str + """ + + _validation = { + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportSourceCredentials, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Action + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.action = kwargs.get('action', "Allow") + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + + +class NetworkRuleSet(Model): + """The network rule set for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Required. The default action of allow or deny when + no other rules match. Possible values include: 'Allow', 'Deny'. Default + value: "Allow" . + :type default_action: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.DefaultAction + :param virtual_network_rules: The virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.VirtualNetworkRule] + :param ip_rules: The IP ACL rules. + :type ip_rules: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.IPRule] + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = kwargs.get('default_action', "Allow") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param origin: The origin information of the container registry operation. + :type origin: str + :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 + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationServiceSpecificationDefinition + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, + } + + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.origin = kwargs.get('origin', None) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.service_specification = kwargs.get('service_specification', None) + + +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) + + +class OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) + + +class OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, **kwargs): + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +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) + + +class QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + +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 repository 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' + + +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) + + +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 + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + 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) + self.network_rule_set = kwargs.get('network_rule_set', None) + + +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) + + +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) + + +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) + + +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) + + +class RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, **kwargs): + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = kwargs.get('quarantine_policy', None) + self.trust_policy = kwargs.get('trust_policy', None) + + +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 + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + 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) + self.network_rule_set = kwargs.get('network_rule_set', None) + + +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) + + +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) + + +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 + + +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) + + +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) + + +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 + + +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) + + +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) + + +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 + repository + :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) + + +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) + + +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) + + +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 + + +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) + + +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 + :param name: The name of the artifact. + :type name: str + :param version: The version of the artifact. + :type version: 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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', '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) + self.name = kwargs.get('name', None) + self.version = kwargs.get('version', None) + + +class TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrustPolicy, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.status = kwargs.get('status', None) + + +class VirtualNetworkRule(Model): + """Virtual network rule. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Action + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.action = kwargs.get('action', "Allow") + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + + +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 + + +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) + + +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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/_models_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..b4d1cfb0ef91 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/_models_py3.py @@ -0,0 +1,2466 @@ +# 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 + + +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 + + +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 + + +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 + + +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 + + +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_manifests: The list of comma-separated image manifests + that were generated from the build. + :type output_image_manifests: 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_manifests': {'key': 'outputImageManifests', '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_manifests: str=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_manifests = output_image_manifests + self.is_archive_enabled = is_archive_enabled + self.build_task_name = build_task_name + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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' + + +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 + + +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 + + +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 + + +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 + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +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' + + +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' + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +class ImportImageParameters(Model): + """ImportImageParameters. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the image. + :type source: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportSource + :param target_tags: List of strings of the form repo[:tag]. When tag is + omitted the source will be used (or 'latest' if source tag is also + omitted). + :type target_tags: list[str] + :param untagged_target_repositories: List of strings of repository names + to do a manifest only copy. No tag will be created. + :type untagged_target_repositories: list[str] + :param mode: When Force, any existing target tags will be overwritten. + When NoForce, any existing target tags will fail the operation before any + copying begins. Possible values include: 'NoForce', 'Force'. Default + value: "NoForce" . + :type mode: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportMode + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ImportSource'}, + 'target_tags': {'key': 'targetTags', 'type': '[str]'}, + 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, *, source, target_tags=None, untagged_target_repositories=None, mode="NoForce", **kwargs) -> None: + super(ImportImageParameters, self).__init__(**kwargs) + self.source = source + self.target_tags = target_tags + self.untagged_target_repositories = untagged_target_repositories + self.mode = mode + + +class ImportSource(Model): + """ImportSource. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: The resource identifier of the source Azure Container + Registry. + :type resource_id: str + :param registry_uri: The address of the source registry (e.g. + 'mcr.microsoft.com'). + :type registry_uri: str + :param credentials: Credentials used when importing from a registry uri. + :type credentials: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportSourceCredentials + :param source_image: Required. Repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' + tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest + ('hello-world@sha256:abc123'). + :type source_image: str + """ + + _validation = { + 'source_image': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'registry_uri': {'key': 'registryUri', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, + 'source_image': {'key': 'sourceImage', 'type': 'str'}, + } + + def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None: + super(ImportSource, self).__init__(**kwargs) + self.resource_id = resource_id + self.registry_uri = registry_uri + self.credentials = credentials + self.source_image = source_image + + +class ImportSourceCredentials(Model): + """ImportSourceCredentials. + + All required parameters must be populated in order to send to Azure. + + :param username: The username to authenticate with the source registry. + :type username: str + :param password: Required. The password used to authenticate with the + source registry. + :type password: str + """ + + _validation = { + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, password: str, username: str=None, **kwargs) -> None: + super(ImportSourceCredentials, self).__init__(**kwargs) + self.username = username + self.password = password + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Action + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.action = action + self.ip_address_or_range = ip_address_or_range + + +class NetworkRuleSet(Model): + """The network rule set for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Required. The default action of allow or deny when + no other rules match. Possible values include: 'Allow', 'Deny'. Default + value: "Allow" . + :type default_action: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.DefaultAction + :param virtual_network_rules: The virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.VirtualNetworkRule] + :param ip_rules: The IP ACL rules. + :type ip_rules: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.IPRule] + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + } + + def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = default_action + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param origin: The origin information of the container registry operation. + :type origin: str + :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 + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationServiceSpecificationDefinition + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, + } + + def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.origin = origin + self.name = name + self.display = display + self.service_specification = service_specification + + +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 + + +class OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.internal_metric_name = internal_metric_name + + +class OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +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 + + +class QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status=None, **kwargs) -> None: + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = status + + +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 repository 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' + + +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 + + +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 + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=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 + self.network_rule_set = network_rule_set + + +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 + + +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 + + +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 + + +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 + + +class RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, *, quarantine_policy=None, trust_policy=None, **kwargs) -> None: + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = quarantine_policy + self.trust_policy = trust_policy + + +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 + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, network_rule_set=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 + self.network_rule_set = network_rule_set + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + + +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 + repository + :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 + + +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 + + +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 + + +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 + + +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 + + +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 + :param name: The name of the artifact. + :type name: str + :param version: The version of the artifact. + :type version: 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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', '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, name: str=None, version: 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 + self.name = name + self.version = version + + +class TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, type=None, status=None, **kwargs) -> None: + super(TrustPolicy, self).__init__(**kwargs) + self.type = type + self.status = status + + +class VirtualNetworkRule(Model): + """Virtual network rule. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Action + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.action = action + self.virtual_network_resource_id = virtual_network_resource_id + + +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 + + +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 + + +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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/_paged_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..4a264af03807 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/_paged_models.py @@ -0,0 +1,131 @@ +# 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) +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) +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) +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) +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) +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) +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) +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) +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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/actor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/actor.py deleted file mode 100644 index a662f9008a31..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/actor.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/actor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/actor_py3.py deleted file mode 100644 index fdd8b96dda52..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/actor_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/base_image_dependency.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/base_image_dependency.py deleted file mode 100644 index 69685435853f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/base_image_dependency.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/base_image_dependency_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/base_image_dependency_py3.py deleted file mode 100644 index 994b57cdf60c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/base_image_dependency_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build.py deleted file mode 100644 index 83d35d835fc5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build.py +++ /dev/null @@ -1,114 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument.py deleted file mode 100644 index d10426bcada2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument_paged.py deleted file mode 100644 index 91d532f13cf8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument_py3.py deleted file mode 100644 index 758f5fd9b2e8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_argument_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_filter.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_filter.py deleted file mode 100644 index 26e32ba1c123..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_filter.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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_manifests: The list of comma-separated image manifests - that were generated from the build. - :type output_image_manifests: 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_manifests': {'key': 'outputImageManifests', '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_manifests = kwargs.get('output_image_manifests', None) - self.is_archive_enabled = kwargs.get('is_archive_enabled', None) - self.build_task_name = kwargs.get('build_task_name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_filter_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_filter_py3.py deleted file mode 100644 index a6063dd4fb2d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_filter_py3.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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_manifests: The list of comma-separated image manifests - that were generated from the build. - :type output_image_manifests: 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_manifests': {'key': 'outputImageManifests', '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_manifests: str=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_manifests = output_image_manifests - self.is_archive_enabled = is_archive_enabled - self.build_task_name = build_task_name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_get_log_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_get_log_result.py deleted file mode 100644 index 7ad007ed3ef0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_get_log_result.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_get_log_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_get_log_result_py3.py deleted file mode 100644 index 9bac641e9b17..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_get_log_result_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_paged.py deleted file mode 100644 index bc1c75c4bfcf..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_py3.py deleted file mode 100644 index 3e1446db21db..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_py3.py +++ /dev/null @@ -1,114 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step.py deleted file mode 100644 index 9b7de27a5c4d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_paged.py deleted file mode 100644 index 53dcc65ab031..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties.py deleted file mode 100644 index 572ba0fdd2c2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_py3.py deleted file mode 100644 index 21eff6be65aa..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_update_parameters.py deleted file mode 100644 index f4b428b026a9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_update_parameters.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_update_parameters_py3.py deleted file mode 100644 index 14e8daba8bcc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_properties_update_parameters_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_py3.py deleted file mode 100644 index 14dad4ba32bd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_update_parameters.py deleted file mode 100644 index 4d80e115cb18..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_update_parameters.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_update_parameters_py3.py deleted file mode 100644 index 7f5a0a3b1dd9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_update_parameters_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task.py deleted file mode 100644 index 5f34df9d50ab..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task.py +++ /dev/null @@ -1,96 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request.py deleted file mode 100644 index fddeb6dd4183..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request_py3.py deleted file mode 100644 index e79235f4c786..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_filter.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_filter.py deleted file mode 100644 index c56e26992731..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_filter.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_filter_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_filter_py3.py deleted file mode 100644 index 12e95e2f1fcc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_filter_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_paged.py deleted file mode 100644 index 87efd3543a2a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_py3.py deleted file mode 100644 index 4b14557445c8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_py3.py +++ /dev/null @@ -1,96 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_update_parameters.py deleted file mode 100644 index 2a83d2fdb470..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_update_parameters.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_update_parameters_py3.py deleted file mode 100644 index ce8d18802d37..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_update_parameters_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_update_parameters.py deleted file mode 100644 index 35059b848b98..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_update_parameters.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_update_parameters_py3.py deleted file mode 100644 index cedec7cf0dd1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_update_parameters_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/callback_config.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/callback_config.py deleted file mode 100644 index 8ad43a9f785a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/callback_config.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/callback_config_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/callback_config_py3.py deleted file mode 100644 index 27ffc7825431..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/callback_config_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step.py deleted file mode 100644 index ee7eb09062aa..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step.py +++ /dev/null @@ -1,90 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_py3.py deleted file mode 100644 index 70ffd18dd40d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_py3.py +++ /dev/null @@ -1,90 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters.py deleted file mode 100644 index 5a3a9893490d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters.py +++ /dev/null @@ -1,74 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters_py3.py deleted file mode 100644 index e76239889858..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters_py3.py +++ /dev/null @@ -1,74 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event.py deleted file mode 100644 index f81722f45561..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_content.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_content.py deleted file mode 100644 index 24e45dd7de4e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_content.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_content_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_content_py3.py deleted file mode 100644 index 6e1e88a9fec1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_content_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_info.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_info.py deleted file mode 100644 index 7199044b2e39..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_info.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_info_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_info_py3.py deleted file mode 100644 index 192990067407..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_info_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_paged.py deleted file mode 100644 index 65f7267e50c9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_py3.py deleted file mode 100644 index 573ab944ce34..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_request_message.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_request_message.py deleted file mode 100644 index e23c5cd5adec..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_request_message.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_request_message_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_request_message_py3.py deleted file mode 100644 index fd34ee3a8af6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_request_message_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_response_message.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_response_message.py deleted file mode 100644 index ffb8feb12a1e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_response_message.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_response_message_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_response_message_py3.py deleted file mode 100644 index 4b1351377b4b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_response_message_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/git_commit_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/git_commit_trigger.py deleted file mode 100644 index fe843cf056c0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/git_commit_trigger.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/git_commit_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/git_commit_trigger_py3.py deleted file mode 100644 index ba5464bfe7cd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/git_commit_trigger_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_descriptor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_descriptor.py deleted file mode 100644 index 1cfd03ed778c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_descriptor.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_descriptor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_descriptor_py3.py deleted file mode 100644 index 72928cf47326..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_descriptor_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_update_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_update_trigger.py deleted file mode 100644 index c1d25cd991f0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_update_trigger.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_update_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_update_trigger_py3.py deleted file mode 100644 index 75e352ba51f6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/image_update_trigger_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_image_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_image_parameters.py deleted file mode 100644 index c063427dd0c0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_image_parameters.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportImageParameters(Model): - """ImportImageParameters. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. The source of the image. - :type source: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportSource - :param target_tags: List of strings of the form repo[:tag]. When tag is - omitted the source will be used (or 'latest' if source tag is also - omitted). - :type target_tags: list[str] - :param untagged_target_repositories: List of strings of repository names - to do a manifest only copy. No tag will be created. - :type untagged_target_repositories: list[str] - :param mode: When Force, any existing target tags will be overwritten. - When NoForce, any existing target tags will fail the operation before any - copying begins. Possible values include: 'NoForce', 'Force'. Default - value: "NoForce" . - :type mode: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportMode - """ - - _validation = { - 'source': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ImportSource'}, - 'target_tags': {'key': 'targetTags', 'type': '[str]'}, - 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportImageParameters, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.target_tags = kwargs.get('target_tags', None) - self.untagged_target_repositories = kwargs.get('untagged_target_repositories', None) - self.mode = kwargs.get('mode', "NoForce") diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_image_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_image_parameters_py3.py deleted file mode 100644 index ee8a730d37a9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_image_parameters_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportImageParameters(Model): - """ImportImageParameters. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. The source of the image. - :type source: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportSource - :param target_tags: List of strings of the form repo[:tag]. When tag is - omitted the source will be used (or 'latest' if source tag is also - omitted). - :type target_tags: list[str] - :param untagged_target_repositories: List of strings of repository names - to do a manifest only copy. No tag will be created. - :type untagged_target_repositories: list[str] - :param mode: When Force, any existing target tags will be overwritten. - When NoForce, any existing target tags will fail the operation before any - copying begins. Possible values include: 'NoForce', 'Force'. Default - value: "NoForce" . - :type mode: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportMode - """ - - _validation = { - 'source': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ImportSource'}, - 'target_tags': {'key': 'targetTags', 'type': '[str]'}, - 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__(self, *, source, target_tags=None, untagged_target_repositories=None, mode="NoForce", **kwargs) -> None: - super(ImportImageParameters, self).__init__(**kwargs) - self.source = source - self.target_tags = target_tags - self.untagged_target_repositories = untagged_target_repositories - self.mode = mode diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_source.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_source.py deleted file mode 100644 index c56e01220425..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_source.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportSource(Model): - """ImportSource. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource identifier of the source Azure Container - Registry. - :type resource_id: str - :param registry_uri: The address of the source registry (e.g. - 'mcr.microsoft.com'). - :type registry_uri: str - :param credentials: Credentials used when importing from a registry uri. - :type credentials: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportSourceCredentials - :param source_image: Required. Repository name of the source image. - Specify an image by repository ('hello-world'). This will use the 'latest' - tag. - Specify an image by tag ('hello-world:latest'). - Specify an image by sha256-based manifest digest - ('hello-world@sha256:abc123'). - :type source_image: str - """ - - _validation = { - 'source_image': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'registry_uri': {'key': 'registryUri', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, - 'source_image': {'key': 'sourceImage', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportSource, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.registry_uri = kwargs.get('registry_uri', None) - self.credentials = kwargs.get('credentials', None) - self.source_image = kwargs.get('source_image', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_source_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_source_credentials.py deleted file mode 100644 index b31e5f7e8405..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_source_credentials.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ImportSourceCredentials(Model): - """ImportSourceCredentials. - - All required parameters must be populated in order to send to Azure. - - :param username: The username to authenticate with the source registry. - :type username: str - :param password: Required. The password used to authenticate with the - source registry. - :type password: str - """ - - _validation = { - 'password': {'required': True}, - } - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportSourceCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_source_credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_source_credentials_py3.py deleted file mode 100644 index 4a610e022f88..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_source_credentials_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ImportSourceCredentials(Model): - """ImportSourceCredentials. - - All required parameters must be populated in order to send to Azure. - - :param username: The username to authenticate with the source registry. - :type username: str - :param password: Required. The password used to authenticate with the - source registry. - :type password: str - """ - - _validation = { - 'password': {'required': True}, - } - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__(self, *, password: str, username: str=None, **kwargs) -> None: - super(ImportSourceCredentials, self).__init__(**kwargs) - self.username = username - self.password = password diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_source_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_source_py3.py deleted file mode 100644 index 6efdf2b4c4b6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/import_source_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportSource(Model): - """ImportSource. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource identifier of the source Azure Container - Registry. - :type resource_id: str - :param registry_uri: The address of the source registry (e.g. - 'mcr.microsoft.com'). - :type registry_uri: str - :param credentials: Credentials used when importing from a registry uri. - :type credentials: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportSourceCredentials - :param source_image: Required. Repository name of the source image. - Specify an image by repository ('hello-world'). This will use the 'latest' - tag. - Specify an image by tag ('hello-world:latest'). - Specify an image by sha256-based manifest digest - ('hello-world@sha256:abc123'). - :type source_image: str - """ - - _validation = { - 'source_image': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'registry_uri': {'key': 'registryUri', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, - 'source_image': {'key': 'sourceImage', 'type': 'str'}, - } - - def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None: - super(ImportSource, self).__init__(**kwargs) - self.resource_id = resource_id - self.registry_uri = registry_uri - self.credentials = credentials - self.source_image = source_image diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/ip_rule.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/ip_rule.py deleted file mode 100644 index cf6503692001..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/ip_rule.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Action - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.action = kwargs.get('action', "Allow") - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/ip_rule_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/ip_rule_py3.py deleted file mode 100644 index 8addc77d3a8f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/ip_rule_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Action - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.action = action - self.ip_address_or_range = ip_address_or_range diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/network_rule_set.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/network_rule_set.py deleted file mode 100644 index 1d7b28d30f24..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/network_rule_set.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 NetworkRuleSet(Model): - """The network rule set for a container registry. - - All required parameters must be populated in order to send to Azure. - - :param default_action: Required. The default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . - :type default_action: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.DefaultAction - :param virtual_network_rules: The virtual network rules. - :type virtual_network_rules: - list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.VirtualNetworkRule] - :param ip_rules: The IP ACL rules. - :type ip_rules: - list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.IPRule] - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.default_action = kwargs.get('default_action', "Allow") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/network_rule_set_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/network_rule_set_py3.py deleted file mode 100644 index 6580fd35679c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/network_rule_set_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 NetworkRuleSet(Model): - """The network rule set for a container registry. - - All required parameters must be populated in order to send to Azure. - - :param default_action: Required. The default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . - :type default_action: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.DefaultAction - :param virtual_network_rules: The virtual network rules. - :type virtual_network_rules: - list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.VirtualNetworkRule] - :param ip_rules: The IP ACL rules. - :type ip_rules: - list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.IPRule] - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.default_action = default_action - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition.py deleted file mode 100644 index 0b89560afaf1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 origin: The origin information of the container registry operation. - :type origin: str - :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 - :param service_specification: The definition of Azure Monitoring service. - :type service_specification: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationServiceSpecificationDefinition - """ - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, - } - - def __init__(self, **kwargs): - super(OperationDefinition, self).__init__(**kwargs) - self.origin = kwargs.get('origin', None) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_paged.py deleted file mode 100644 index 105ec960f4da..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_py3.py deleted file mode 100644 index 61197df085c6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 origin: The origin information of the container registry operation. - :type origin: str - :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 - :param service_specification: The definition of Azure Monitoring service. - :type service_specification: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationServiceSpecificationDefinition - """ - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, - } - - def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: - super(OperationDefinition, self).__init__(**kwargs) - self.origin = origin - self.name = name - self.display = display - self.service_specification = service_specification diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_display_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_display_definition.py deleted file mode 100644 index 6cb8463b21fc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_display_definition.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_display_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_display_definition_py3.py deleted file mode 100644 index 98abb699335c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_display_definition_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_metric_specification_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_metric_specification_definition.py deleted file mode 100644 index 8b40b3b4d6f1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_metric_specification_definition.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 OperationMetricSpecificationDefinition(Model): - """The definition of Azure Monitoring metric. - - :param name: Metric name. - :type name: str - :param display_name: Metric display name. - :type display_name: str - :param display_description: Metric description. - :type display_description: str - :param unit: Metric unit. - :type unit: str - :param aggregation_type: Metric aggregation type. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.internal_metric_name = kwargs.get('internal_metric_name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_metric_specification_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_metric_specification_definition_py3.py deleted file mode 100644 index db4f31c14a17..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_metric_specification_definition_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 OperationMetricSpecificationDefinition(Model): - """The definition of Azure Monitoring metric. - - :param name: Metric name. - :type name: str - :param display_name: Metric display name. - :type display_name: str - :param display_description: Metric description. - :type display_description: str - :param unit: Metric unit. - :type unit: str - :param aggregation_type: Metric aggregation type. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: - super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.internal_metric_name = internal_metric_name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_service_specification_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_service_specification_definition.py deleted file mode 100644 index 7106aed46546..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_service_specification_definition.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 OperationServiceSpecificationDefinition(Model): - """The definition of Azure Monitoring metrics list. - - :param metric_specifications: A list of Azure Monitoring metrics - definition. - :type metric_specifications: - list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationMetricSpecificationDefinition] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, - } - - def __init__(self, **kwargs): - super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_service_specification_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_service_specification_definition_py3.py deleted file mode 100644 index 837b2fae6744..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_service_specification_definition_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 OperationServiceSpecificationDefinition(Model): - """The definition of Azure Monitoring metrics list. - - :param metric_specifications: A list of Azure Monitoring metrics - definition. - :type metric_specifications: - list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationMetricSpecificationDefinition] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/platform_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/platform_properties.py deleted file mode 100644 index 1d2116661c53..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/platform_properties.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/platform_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/platform_properties_py3.py deleted file mode 100644 index a136a050b3f9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/platform_properties_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/proxy_resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/proxy_resource.py deleted file mode 100644 index 5c52aad9de10..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/proxy_resource.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/proxy_resource_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/proxy_resource_py3.py deleted file mode 100644 index d310c7cbf9b1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/proxy_resource_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quarantine_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quarantine_policy.py deleted file mode 100644 index 849f9dbd9d30..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quarantine_policy.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 QuarantinePolicy(Model): - """An object that represents quarantine policy for a container registry. - - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PolicyStatus - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(QuarantinePolicy, self).__init__(**kwargs) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quarantine_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quarantine_policy_py3.py deleted file mode 100644 index 9ab841c07043..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quarantine_policy_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 QuarantinePolicy(Model): - """An object that represents quarantine policy for a container registry. - - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PolicyStatus - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, status=None, **kwargs) -> None: - super(QuarantinePolicy, self).__init__(**kwargs) - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/queue_build_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/queue_build_request.py deleted file mode 100644 index 8ba452234c6c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/queue_build_request.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/queue_build_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/queue_build_request_py3.py deleted file mode 100644 index eeeec1215e9b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/queue_build_request_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request.py deleted file mode 100644 index e2378ecfd27d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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 repository 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request_py3.py deleted file mode 100644 index 5f6f471802d8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request_py3.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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_py3 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 repository 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/regenerate_credential_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/regenerate_credential_parameters.py deleted file mode 100644 index 1a4514f5f72c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/regenerate_credential_parameters.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/regenerate_credential_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/regenerate_credential_parameters_py3.py deleted file mode 100644 index 4300b5dfddc1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/regenerate_credential_parameters_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry.py deleted file mode 100644 index 28b42cf2d1bb..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry.py +++ /dev/null @@ -1,100 +0,0 @@ -# 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 - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - 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) - self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_list_credentials_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_list_credentials_result.py deleted file mode 100644 index 35f58a636786..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_list_credentials_result.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_list_credentials_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_list_credentials_result_py3.py deleted file mode 100644 index 95d4581cc130..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_list_credentials_result_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_check_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_check_request.py deleted file mode 100644 index 9d4a575eac04..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_check_request.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_check_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_check_request_py3.py deleted file mode 100644 index 67f5ff9be671..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_check_request_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_status.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_status.py deleted file mode 100644 index 94345ba6d549..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_status.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_status_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_status_py3.py deleted file mode 100644 index 8b7b264c2d0d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_name_status_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_paged.py deleted file mode 100644 index 324b6f52e6cc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_password.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_password.py deleted file mode 100644 index f2984ae1d516..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_password.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_password_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_password_py3.py deleted file mode 100644 index 97b40f8760c6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_password_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_policies.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_policies.py deleted file mode 100644 index 4a7f2fcc64e4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_policies.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 RegistryPolicies(Model): - """An object that represents policies for a container registry. - - :param quarantine_policy: An object that represents quarantine policy for - a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy for a - container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicy - """ - - _attribute_map = { - 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, - 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, - } - - def __init__(self, **kwargs): - super(RegistryPolicies, self).__init__(**kwargs) - self.quarantine_policy = kwargs.get('quarantine_policy', None) - self.trust_policy = kwargs.get('trust_policy', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_policies_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_policies_py3.py deleted file mode 100644 index f14e2458b8f6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_policies_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 RegistryPolicies(Model): - """An object that represents policies for a container registry. - - :param quarantine_policy: An object that represents quarantine policy for - a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy for a - container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicy - """ - - _attribute_map = { - 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, - 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, - } - - def __init__(self, *, quarantine_policy=None, trust_policy=None, **kwargs) -> None: - super(RegistryPolicies, self).__init__(**kwargs) - self.quarantine_policy = quarantine_policy - self.trust_policy = trust_policy diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_py3.py deleted file mode 100644 index c408d04117d6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_py3.py +++ /dev/null @@ -1,100 +0,0 @@ -# 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_py3 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 - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=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 - self.network_rule_set = network_rule_set diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_update_parameters.py deleted file mode 100644 index b70002cc5050..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_update_parameters.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - 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) - self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_update_parameters_py3.py deleted file mode 100644 index 0220150bff61..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_update_parameters_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, network_rule_set=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 - self.network_rule_set = network_rule_set diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage.py deleted file mode 100644 index b451aeff7c1a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_list_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_list_result.py deleted file mode 100644 index 9094762e888d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_list_result.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_list_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_list_result_py3.py deleted file mode 100644 index 79734e173989..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_list_result_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_py3.py deleted file mode 100644 index c0e2684f6854..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_usage_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication.py deleted file mode 100644 index 7f9a55f3ecc7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_paged.py deleted file mode 100644 index f3fe32671075..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_py3.py deleted file mode 100644 index b89d4ab0156f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_update_parameters.py deleted file mode 100644 index 003b15583a55..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_update_parameters.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_update_parameters_py3.py deleted file mode 100644 index 5497bcdbc1f7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_update_parameters_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/request.py deleted file mode 100644 index e08090f53205..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/request.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/request_py3.py deleted file mode 100644 index f42dae28c955..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/request_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/resource.py deleted file mode 100644 index 3965a6f0cf40..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/resource.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/resource_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/resource_py3.py deleted file mode 100644 index 3a1d4bc4edd1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/resource_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/sku.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/sku.py deleted file mode 100644 index f7c63d82a39d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/sku.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/sku_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/sku_py3.py deleted file mode 100644 index 00da0bfdd6ed..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/sku_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source.py deleted file mode 100644 index 132f4b2c1324..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_control_auth_info.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_control_auth_info.py deleted file mode 100644 index 1037c4944b05..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_control_auth_info.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_control_auth_info_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_control_auth_info_py3.py deleted file mode 100644 index 52c1894bbe8c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_control_auth_info_py3.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_py3.py deleted file mode 100644 index 5aadcd407862..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_properties.py deleted file mode 100644 index 6be637c82a7a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_properties.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 - repository - :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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_properties_py3.py deleted file mode 100644 index 11019f23de7f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_properties_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 - repository - :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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_update_parameters.py deleted file mode 100644 index 3d9a87f57c6d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_update_parameters.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_update_parameters_py3.py deleted file mode 100644 index add70a5110d1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_repository_update_parameters_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_upload_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_upload_definition.py deleted file mode 100644 index 381fd538e9e3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_upload_definition.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_upload_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_upload_definition_py3.py deleted file mode 100644 index cff615964e11..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/source_upload_definition_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/status.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/status.py deleted file mode 100644 index 76444c500634..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/status.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/status_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/status_py3.py deleted file mode 100644 index 1f4611c49912..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/status_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/storage_account_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/storage_account_properties.py deleted file mode 100644 index 0541b7651cbd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/storage_account_properties.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/storage_account_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/storage_account_properties_py3.py deleted file mode 100644 index 5714fde0fcd2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/storage_account_properties_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/target.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/target.py deleted file mode 100644 index 228df1d19f00..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/target.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', '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) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/target_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/target_py3.py deleted file mode 100644 index 3b312ee2c0da..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/target_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', '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, name: str=None, version: 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 - self.name = name - self.version = version diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/trust_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/trust_policy.py deleted file mode 100644 index 267ccc70b989..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/trust_policy.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TrustPolicy(Model): - """An object that represents content trust policy for a container registry. - - :param type: The type of trust policy. Possible values include: 'Notary' - :type type: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicyType - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PolicyStatus - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrustPolicy, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/trust_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/trust_policy_py3.py deleted file mode 100644 index 4c70cb0041a6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/trust_policy_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TrustPolicy(Model): - """An object that represents content trust policy for a container registry. - - :param type: The type of trust policy. Possible values include: 'Notary' - :type type: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicyType - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PolicyStatus - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, type=None, status=None, **kwargs) -> None: - super(TrustPolicy, self).__init__(**kwargs) - self.type = type - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/virtual_network_rule.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/virtual_network_rule.py deleted file mode 100644 index d8f2f67671ff..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/virtual_network_rule.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual network rule. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Action - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.action = kwargs.get('action', "Allow") - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/virtual_network_rule_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/virtual_network_rule_py3.py deleted file mode 100644 index b9db306970b2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual network rule. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.Action - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.action = action - self.virtual_network_resource_id = virtual_network_resource_id diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook.py deleted file mode 100644 index ed9bc0383fad..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_create_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_create_parameters.py deleted file mode 100644 index 3a84139cd596..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_create_parameters.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_create_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_create_parameters_py3.py deleted file mode 100644 index 12d16959672c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_create_parameters_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_paged.py deleted file mode 100644 index 3cd548274502..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_py3.py deleted file mode 100644 index 16f73cb7811d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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_py3 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_update_parameters.py deleted file mode 100644 index e0933cd2246b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_update_parameters.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_update_parameters_py3.py deleted file mode 100644 index 166f06be0018..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_update_parameters_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/__init__.py index a067a22283c0..41c8472a6bcd 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/__init__.py @@ -9,13 +9,13 @@ # 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 +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', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_build_steps_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_build_steps_operations.py new file mode 100644 index 000000000000..24c85e4252d6 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_build_steps_operations.py @@ -0,0 +1,590 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.BuildStepPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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 = {} + 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, header_parameters) + response = self._client.send(request, 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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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 prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.BuildArgumentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_build_arguments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}/listBuildArguments'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_build_tasks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_build_tasks_operations.py new file mode 100644 index 000000000000..fee4d2307ee9 --- /dev/null +++ b/sdk/containerregistry/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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.BuildTaskPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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 = {} + 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, header_parameters) + response = self._client.send(request, 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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_builds_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_builds_operations.py new file mode 100644 index 000000000000..4e4498d16131 --- /dev/null +++ b/sdk/containerregistry/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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.BuildPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 = {} + 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, header_parameters) + response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_operations.py new file mode 100644 index 000000000000..01c2b633a759 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_operations.py @@ -0,0 +1,103 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.ContainerRegistry/operations'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_registries_operations.py new file mode 100644 index 000000000000..5defa2283d10 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_registries_operations.py @@ -0,0 +1,1256 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 _import_image_initial( + self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2017-10-01" + + # Construct URL + url = self.import_image.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', min_length=1), + '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(parameters, 'ImportImageParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 import_image( + self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Copies an image to this container registry from 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 parameters: The parameters specifying the image to copy and the + source container registry. + :type parameters: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportImageParameters + :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._import_image_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + parameters=parameters, + 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) + import_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage'} + + 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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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 prepare_request(next_link=None): + 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', min_length=1) + } + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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 prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 list_policies( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists the policies 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: RegistryPolicies or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPolicies + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + # Construct URL + url = self.list_policies.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'} + + + def _update_policies_initial( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, **operation_config): + registry_policies_update_parameters = models.RegistryPolicies(quarantine_policy=quarantine_policy, trust_policy=trust_policy) + + api_version = "2017-10-01" + + # Construct URL + url = self.update_policies.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', min_length=1), + '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['Accept'] = 'application/json' + 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_policies_update_parameters, 'RegistryPolicies') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_policies( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the policies 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 quarantine_policy: An object that represents quarantine policy + for a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy + for a container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicy + :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 RegistryPolicies or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPolicies] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPolicies]] + :raises: :class:`CloudError` + """ + raw_result = self._update_policies_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + quarantine_policy=quarantine_policy, + trust_policy=trust_policy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RegistryPolicies', 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_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'} + + + 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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_replications_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_replications_operations.py new file mode 100644 index 000000000000..633006e26b68 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_replications_operations.py @@ -0,0 +1,489 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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 prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.ReplicationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_webhooks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/_webhooks_operations.py new file mode 100644 index 000000000000..a2397ca15492 --- /dev/null +++ b/sdk/containerregistry/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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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 prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.WebhookPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.EventPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_events.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/build_steps_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/build_steps_operations.py deleted file mode 100644 index af710eb2efaa..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/build_steps_operations.py +++ /dev/null @@ -1,585 +0,0 @@ -# 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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 = {} - 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, header_parameters) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/build_tasks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/build_tasks_operations.py deleted file mode 100644 index f8a5af8876c0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/build_tasks_operations.py +++ /dev/null @@ -1,557 +0,0 @@ -# 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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 = {} - 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, header_parameters) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/builds_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/builds_operations.py deleted file mode 100644 index ff51ad18f0f5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/builds_operations.py +++ /dev/null @@ -1,452 +0,0 @@ -# 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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 = {} - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/operations.py deleted file mode 100644 index 669c5097c928..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/registries_operations.py deleted file mode 100644 index 2b25edd7f940..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/registries_operations.py +++ /dev/null @@ -1,1257 +0,0 @@ -# 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 _import_image_initial( - self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2017-10-01" - - # Construct URL - url = self.import_image.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', min_length=1), - '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(parameters, 'ImportImageParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 import_image( - self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Copies an image to this container registry from 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 parameters: The parameters specifying the image to copy and the - source container registry. - :type parameters: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportImageParameters - :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._import_image_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - parameters=parameters, - 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) - import_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage'} - - 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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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', min_length=1) - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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 list_policies( - self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): - """Lists the policies 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: RegistryPolicies or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPolicies - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2017-10-01" - - # Construct URL - url = self.list_policies.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('RegistryPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'} - - - def _update_policies_initial( - self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, **operation_config): - registry_policies_update_parameters = models.RegistryPolicies(quarantine_policy=quarantine_policy, trust_policy=trust_policy) - - api_version = "2017-10-01" - - # Construct URL - url = self.update_policies.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', min_length=1), - '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['Accept'] = 'application/json' - 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_policies_update_parameters, 'RegistryPolicies') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('RegistryPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update_policies( - self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates the policies 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 quarantine_policy: An object that represents quarantine policy - for a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy - for a container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicy - :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 RegistryPolicies or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPolicies] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPolicies]] - :raises: :class:`CloudError` - """ - raw_result = self._update_policies_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - quarantine_policy=quarantine_policy, - trust_policy=trust_policy, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('RegistryPolicies', 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_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'} - - - 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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/replications_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/replications_operations.py deleted file mode 100644 index 504583419b90..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/replications_operations.py +++ /dev/null @@ -1,486 +0,0 @@ -# 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/webhooks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/webhooks_operations.py deleted file mode 100644 index 836d297d8df5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/webhooks_operations.py +++ /dev/null @@ -1,690 +0,0 @@ -# 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/__init__.py index 511d3d37a4aa..81ad2ac1ed64 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .container_registry_management_client import ContainerRegistryManagementClient -from .version import VERSION +from ._configuration import ContainerRegistryManagementClientConfiguration +from ._container_registry_management_client import ContainerRegistryManagementClient +__all__ = ['ContainerRegistryManagementClient', 'ContainerRegistryManagementClientConfiguration'] -__all__ = ['ContainerRegistryManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/_configuration.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/_configuration.py new file mode 100644 index 000000000000..4e021787210f --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +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) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + 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 diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/_container_registry_management_client.py new file mode 100644 index 000000000000..b4cacbee97dc --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/_container_registry_management_client.py @@ -0,0 +1,73 @@ +# 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 ._configuration import ContainerRegistryManagementClientConfiguration +from .operations import RegistriesOperations +from .operations import Operations +from .operations import ReplicationsOperations +from .operations import WebhooksOperations +from .operations import RunsOperations +from .operations import TasksOperations +from . import models + + +class ContainerRegistryManagementClient(SDKClient): + """ContainerRegistryManagementClient + + :ivar config: Configuration for client. + :vartype config: ContainerRegistryManagementClientConfiguration + + :ivar registries: Registries operations + :vartype registries: azure.mgmt.containerregistry.v2018_09_01.operations.RegistriesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerregistry.v2018_09_01.operations.Operations + :ivar replications: Replications operations + :vartype replications: azure.mgmt.containerregistry.v2018_09_01.operations.ReplicationsOperations + :ivar webhooks: Webhooks operations + :vartype webhooks: azure.mgmt.containerregistry.v2018_09_01.operations.WebhooksOperations + :ivar runs: Runs operations + :vartype runs: azure.mgmt.containerregistry.v2018_09_01.operations.RunsOperations + :ivar tasks: Tasks operations + :vartype tasks: azure.mgmt.containerregistry.v2018_09_01.operations.TasksOperations + + :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.runs = RunsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tasks = TasksOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/container_registry_management_client.py deleted file mode 100644 index b97b1dce5e4e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/container_registry_management_client.py +++ /dev/null @@ -1,105 +0,0 @@ -# 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.runs_operations import RunsOperations -from .operations.tasks_operations import TasksOperations -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_09_01.operations.RegistriesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.containerregistry.v2018_09_01.operations.Operations - :ivar replications: Replications operations - :vartype replications: azure.mgmt.containerregistry.v2018_09_01.operations.ReplicationsOperations - :ivar webhooks: Webhooks operations - :vartype webhooks: azure.mgmt.containerregistry.v2018_09_01.operations.WebhooksOperations - :ivar runs: Runs operations - :vartype runs: azure.mgmt.containerregistry.v2018_09_01.operations.RunsOperations - :ivar tasks: Tasks operations - :vartype tasks: azure.mgmt.containerregistry.v2018_09_01.operations.TasksOperations - - :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.runs = RunsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.tasks = TasksOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/__init__.py index 9e7952bf6eac..f10d8f0fafba 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/__init__.py @@ -10,185 +10,185 @@ # -------------------------------------------------------------------------- try: - from .import_source_credentials_py3 import ImportSourceCredentials - from .import_source_py3 import ImportSource - from .import_image_parameters_py3 import ImportImageParameters - from .registry_name_check_request_py3 import RegistryNameCheckRequest - from .registry_name_status_py3 import RegistryNameStatus - from .operation_display_definition_py3 import OperationDisplayDefinition - from .operation_metric_specification_definition_py3 import OperationMetricSpecificationDefinition - from .operation_service_specification_definition_py3 import OperationServiceSpecificationDefinition - from .operation_definition_py3 import OperationDefinition - from .sku_py3 import Sku - from .status_py3 import Status - from .storage_account_properties_py3 import StorageAccountProperties - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - 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 .quarantine_policy_py3 import QuarantinePolicy - from .trust_policy_py3 import TrustPolicy - from .registry_policies_py3 import RegistryPolicies - 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 .run_request_py3 import RunRequest - from .image_descriptor_py3 import ImageDescriptor - from .image_update_trigger_py3 import ImageUpdateTrigger - from .source_trigger_descriptor_py3 import SourceTriggerDescriptor - from .platform_properties_py3 import PlatformProperties - from .agent_properties_py3 import AgentProperties - from .run_py3 import Run - from .source_upload_definition_py3 import SourceUploadDefinition - from .run_filter_py3 import RunFilter - from .run_update_parameters_py3 import RunUpdateParameters - from .run_get_log_result_py3 import RunGetLogResult - from .base_image_dependency_py3 import BaseImageDependency - from .task_step_properties_py3 import TaskStepProperties - from .auth_info_py3 import AuthInfo - from .source_properties_py3 import SourceProperties - from .source_trigger_py3 import SourceTrigger - from .base_image_trigger_py3 import BaseImageTrigger - from .trigger_properties_py3 import TriggerProperties - from .source_registry_credentials_py3 import SourceRegistryCredentials - from .secret_object_py3 import SecretObject - from .custom_registry_credentials_py3 import CustomRegistryCredentials - from .credentials_py3 import Credentials - from .task_py3 import Task - from .platform_update_parameters_py3 import PlatformUpdateParameters - from .task_step_update_parameters_py3 import TaskStepUpdateParameters - from .auth_info_update_parameters_py3 import AuthInfoUpdateParameters - from .source_update_parameters_py3 import SourceUpdateParameters - from .source_trigger_update_parameters_py3 import SourceTriggerUpdateParameters - from .base_image_trigger_update_parameters_py3 import BaseImageTriggerUpdateParameters - from .trigger_update_parameters_py3 import TriggerUpdateParameters - from .task_update_parameters_py3 import TaskUpdateParameters - from .proxy_resource_py3 import ProxyResource - from .argument_py3 import Argument - from .docker_build_request_py3 import DockerBuildRequest - from .set_value_py3 import SetValue - from .file_task_run_request_py3 import FileTaskRunRequest - from .task_run_request_py3 import TaskRunRequest - from .encoded_task_run_request_py3 import EncodedTaskRunRequest - from .docker_build_step_py3 import DockerBuildStep - from .file_task_step_py3 import FileTaskStep - from .encoded_task_step_py3 import EncodedTaskStep - from .docker_build_step_update_parameters_py3 import DockerBuildStepUpdateParameters - from .file_task_step_update_parameters_py3 import FileTaskStepUpdateParameters - from .encoded_task_step_update_parameters_py3 import EncodedTaskStepUpdateParameters + from ._models_py3 import Actor + from ._models_py3 import AgentProperties + from ._models_py3 import Argument + from ._models_py3 import AuthInfo + from ._models_py3 import AuthInfoUpdateParameters + from ._models_py3 import BaseImageDependency + from ._models_py3 import BaseImageTrigger + from ._models_py3 import BaseImageTriggerUpdateParameters + from ._models_py3 import CallbackConfig + from ._models_py3 import Credentials + from ._models_py3 import CustomRegistryCredentials + from ._models_py3 import DockerBuildRequest + from ._models_py3 import DockerBuildStep + from ._models_py3 import DockerBuildStepUpdateParameters + from ._models_py3 import EncodedTaskRunRequest + from ._models_py3 import EncodedTaskStep + from ._models_py3 import EncodedTaskStepUpdateParameters + from ._models_py3 import Event + from ._models_py3 import EventContent + from ._models_py3 import EventInfo + from ._models_py3 import EventRequestMessage + from ._models_py3 import EventResponseMessage + from ._models_py3 import FileTaskRunRequest + from ._models_py3 import FileTaskStep + from ._models_py3 import FileTaskStepUpdateParameters + from ._models_py3 import ImageDescriptor + from ._models_py3 import ImageUpdateTrigger + from ._models_py3 import ImportImageParameters + from ._models_py3 import ImportSource + from ._models_py3 import ImportSourceCredentials + from ._models_py3 import IPRule + from ._models_py3 import NetworkRuleSet + from ._models_py3 import OperationDefinition + from ._models_py3 import OperationDisplayDefinition + from ._models_py3 import OperationMetricSpecificationDefinition + from ._models_py3 import OperationServiceSpecificationDefinition + from ._models_py3 import PlatformProperties + from ._models_py3 import PlatformUpdateParameters + from ._models_py3 import ProxyResource + from ._models_py3 import QuarantinePolicy + from ._models_py3 import RegenerateCredentialParameters + from ._models_py3 import Registry + from ._models_py3 import RegistryListCredentialsResult + from ._models_py3 import RegistryNameCheckRequest + from ._models_py3 import RegistryNameStatus + from ._models_py3 import RegistryPassword + from ._models_py3 import RegistryPolicies + from ._models_py3 import RegistryUpdateParameters + from ._models_py3 import RegistryUsage + from ._models_py3 import RegistryUsageListResult + from ._models_py3 import Replication + from ._models_py3 import ReplicationUpdateParameters + from ._models_py3 import Request + from ._models_py3 import Resource + from ._models_py3 import Run + from ._models_py3 import RunFilter + from ._models_py3 import RunGetLogResult + from ._models_py3 import RunRequest + from ._models_py3 import RunUpdateParameters + from ._models_py3 import SecretObject + from ._models_py3 import SetValue + from ._models_py3 import Sku + from ._models_py3 import Source + from ._models_py3 import SourceProperties + from ._models_py3 import SourceRegistryCredentials + from ._models_py3 import SourceTrigger + from ._models_py3 import SourceTriggerDescriptor + from ._models_py3 import SourceTriggerUpdateParameters + from ._models_py3 import SourceUpdateParameters + from ._models_py3 import SourceUploadDefinition + from ._models_py3 import Status + from ._models_py3 import StorageAccountProperties + from ._models_py3 import Target + from ._models_py3 import Task + from ._models_py3 import TaskRunRequest + from ._models_py3 import TaskStepProperties + from ._models_py3 import TaskStepUpdateParameters + from ._models_py3 import TaskUpdateParameters + from ._models_py3 import TriggerProperties + from ._models_py3 import TriggerUpdateParameters + from ._models_py3 import TrustPolicy + from ._models_py3 import VirtualNetworkRule + from ._models_py3 import Webhook + from ._models_py3 import WebhookCreateParameters + from ._models_py3 import WebhookUpdateParameters except (SyntaxError, ImportError): - from .import_source_credentials import ImportSourceCredentials - from .import_source import ImportSource - from .import_image_parameters import ImportImageParameters - from .registry_name_check_request import RegistryNameCheckRequest - from .registry_name_status import RegistryNameStatus - from .operation_display_definition import OperationDisplayDefinition - from .operation_metric_specification_definition import OperationMetricSpecificationDefinition - from .operation_service_specification_definition import OperationServiceSpecificationDefinition - from .operation_definition import OperationDefinition - from .sku import Sku - from .status import Status - from .storage_account_properties import StorageAccountProperties - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - 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 .quarantine_policy import QuarantinePolicy - from .trust_policy import TrustPolicy - from .registry_policies import RegistryPolicies - 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 .run_request import RunRequest - from .image_descriptor import ImageDescriptor - from .image_update_trigger import ImageUpdateTrigger - from .source_trigger_descriptor import SourceTriggerDescriptor - from .platform_properties import PlatformProperties - from .agent_properties import AgentProperties - from .run import Run - from .source_upload_definition import SourceUploadDefinition - from .run_filter import RunFilter - from .run_update_parameters import RunUpdateParameters - from .run_get_log_result import RunGetLogResult - from .base_image_dependency import BaseImageDependency - from .task_step_properties import TaskStepProperties - from .auth_info import AuthInfo - from .source_properties import SourceProperties - from .source_trigger import SourceTrigger - from .base_image_trigger import BaseImageTrigger - from .trigger_properties import TriggerProperties - from .source_registry_credentials import SourceRegistryCredentials - from .secret_object import SecretObject - from .custom_registry_credentials import CustomRegistryCredentials - from .credentials import Credentials - from .task import Task - from .platform_update_parameters import PlatformUpdateParameters - from .task_step_update_parameters import TaskStepUpdateParameters - from .auth_info_update_parameters import AuthInfoUpdateParameters - from .source_update_parameters import SourceUpdateParameters - from .source_trigger_update_parameters import SourceTriggerUpdateParameters - from .base_image_trigger_update_parameters import BaseImageTriggerUpdateParameters - from .trigger_update_parameters import TriggerUpdateParameters - from .task_update_parameters import TaskUpdateParameters - from .proxy_resource import ProxyResource - from .argument import Argument - from .docker_build_request import DockerBuildRequest - from .set_value import SetValue - from .file_task_run_request import FileTaskRunRequest - from .task_run_request import TaskRunRequest - from .encoded_task_run_request import EncodedTaskRunRequest - from .docker_build_step import DockerBuildStep - from .file_task_step import FileTaskStep - from .encoded_task_step import EncodedTaskStep - from .docker_build_step_update_parameters import DockerBuildStepUpdateParameters - from .file_task_step_update_parameters import FileTaskStepUpdateParameters - from .encoded_task_step_update_parameters import EncodedTaskStepUpdateParameters -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 .run_paged import RunPaged -from .task_paged import TaskPaged -from .container_registry_management_client_enums import ( + from ._models import Actor + from ._models import AgentProperties + from ._models import Argument + from ._models import AuthInfo + from ._models import AuthInfoUpdateParameters + from ._models import BaseImageDependency + from ._models import BaseImageTrigger + from ._models import BaseImageTriggerUpdateParameters + from ._models import CallbackConfig + from ._models import Credentials + from ._models import CustomRegistryCredentials + from ._models import DockerBuildRequest + from ._models import DockerBuildStep + from ._models import DockerBuildStepUpdateParameters + from ._models import EncodedTaskRunRequest + from ._models import EncodedTaskStep + from ._models import EncodedTaskStepUpdateParameters + from ._models import Event + from ._models import EventContent + from ._models import EventInfo + from ._models import EventRequestMessage + from ._models import EventResponseMessage + from ._models import FileTaskRunRequest + from ._models import FileTaskStep + from ._models import FileTaskStepUpdateParameters + from ._models import ImageDescriptor + from ._models import ImageUpdateTrigger + from ._models import ImportImageParameters + from ._models import ImportSource + from ._models import ImportSourceCredentials + from ._models import IPRule + from ._models import NetworkRuleSet + from ._models import OperationDefinition + from ._models import OperationDisplayDefinition + from ._models import OperationMetricSpecificationDefinition + from ._models import OperationServiceSpecificationDefinition + from ._models import PlatformProperties + from ._models import PlatformUpdateParameters + from ._models import ProxyResource + from ._models import QuarantinePolicy + from ._models import RegenerateCredentialParameters + from ._models import Registry + from ._models import RegistryListCredentialsResult + from ._models import RegistryNameCheckRequest + from ._models import RegistryNameStatus + from ._models import RegistryPassword + from ._models import RegistryPolicies + from ._models import RegistryUpdateParameters + from ._models import RegistryUsage + from ._models import RegistryUsageListResult + from ._models import Replication + from ._models import ReplicationUpdateParameters + from ._models import Request + from ._models import Resource + from ._models import Run + from ._models import RunFilter + from ._models import RunGetLogResult + from ._models import RunRequest + from ._models import RunUpdateParameters + from ._models import SecretObject + from ._models import SetValue + from ._models import Sku + from ._models import Source + from ._models import SourceProperties + from ._models import SourceRegistryCredentials + from ._models import SourceTrigger + from ._models import SourceTriggerDescriptor + from ._models import SourceTriggerUpdateParameters + from ._models import SourceUpdateParameters + from ._models import SourceUploadDefinition + from ._models import Status + from ._models import StorageAccountProperties + from ._models import Target + from ._models import Task + from ._models import TaskRunRequest + from ._models import TaskStepProperties + from ._models import TaskStepUpdateParameters + from ._models import TaskUpdateParameters + from ._models import TriggerProperties + from ._models import TriggerUpdateParameters + from ._models import TrustPolicy + from ._models import VirtualNetworkRule + from ._models import Webhook + from ._models import WebhookCreateParameters + from ._models import WebhookUpdateParameters +from ._paged_models import EventPaged +from ._paged_models import OperationDefinitionPaged +from ._paged_models import RegistryPaged +from ._paged_models import ReplicationPaged +from ._paged_models import RunPaged +from ._paged_models import TaskPaged +from ._paged_models import WebhookPaged +from ._container_registry_management_client_enums import ( ImportMode, SkuName, SkuTier, @@ -218,91 +218,91 @@ ) __all__ = [ - 'ImportSourceCredentials', - 'ImportSource', + 'Actor', + 'AgentProperties', + 'Argument', + 'AuthInfo', + 'AuthInfoUpdateParameters', + 'BaseImageDependency', + 'BaseImageTrigger', + 'BaseImageTriggerUpdateParameters', + 'CallbackConfig', + 'Credentials', + 'CustomRegistryCredentials', + 'DockerBuildRequest', + 'DockerBuildStep', + 'DockerBuildStepUpdateParameters', + 'EncodedTaskRunRequest', + 'EncodedTaskStep', + 'EncodedTaskStepUpdateParameters', + 'Event', + 'EventContent', + 'EventInfo', + 'EventRequestMessage', + 'EventResponseMessage', + 'FileTaskRunRequest', + 'FileTaskStep', + 'FileTaskStepUpdateParameters', + 'ImageDescriptor', + 'ImageUpdateTrigger', 'ImportImageParameters', - 'RegistryNameCheckRequest', - 'RegistryNameStatus', + 'ImportSource', + 'ImportSourceCredentials', + 'IPRule', + 'NetworkRuleSet', + 'OperationDefinition', 'OperationDisplayDefinition', 'OperationMetricSpecificationDefinition', 'OperationServiceSpecificationDefinition', - 'OperationDefinition', - 'Sku', - 'Status', - 'StorageAccountProperties', - 'VirtualNetworkRule', - 'IPRule', - 'NetworkRuleSet', + 'PlatformProperties', + 'PlatformUpdateParameters', + 'ProxyResource', + 'QuarantinePolicy', + 'RegenerateCredentialParameters', 'Registry', - 'RegistryUpdateParameters', - 'RegistryPassword', 'RegistryListCredentialsResult', - 'RegenerateCredentialParameters', + 'RegistryNameCheckRequest', + 'RegistryNameStatus', + 'RegistryPassword', + 'RegistryPolicies', + 'RegistryUpdateParameters', 'RegistryUsage', 'RegistryUsageListResult', - 'QuarantinePolicy', - 'TrustPolicy', - 'RegistryPolicies', 'Replication', 'ReplicationUpdateParameters', - 'Webhook', - 'WebhookCreateParameters', - 'WebhookUpdateParameters', - 'EventInfo', - 'CallbackConfig', - 'Target', 'Request', - 'Actor', - 'Source', - 'EventContent', - 'EventRequestMessage', - 'EventResponseMessage', - 'Event', 'Resource', - 'RunRequest', - 'ImageDescriptor', - 'ImageUpdateTrigger', - 'SourceTriggerDescriptor', - 'PlatformProperties', - 'AgentProperties', 'Run', - 'SourceUploadDefinition', 'RunFilter', - 'RunUpdateParameters', 'RunGetLogResult', - 'BaseImageDependency', - 'TaskStepProperties', - 'AuthInfo', + 'RunRequest', + 'RunUpdateParameters', + 'SecretObject', + 'SetValue', + 'Sku', + 'Source', 'SourceProperties', - 'SourceTrigger', - 'BaseImageTrigger', - 'TriggerProperties', 'SourceRegistryCredentials', - 'SecretObject', - 'CustomRegistryCredentials', - 'Credentials', + 'SourceTrigger', + 'SourceTriggerDescriptor', + 'SourceTriggerUpdateParameters', + 'SourceUpdateParameters', + 'SourceUploadDefinition', + 'Status', + 'StorageAccountProperties', + 'Target', 'Task', - 'PlatformUpdateParameters', + 'TaskRunRequest', + 'TaskStepProperties', 'TaskStepUpdateParameters', - 'AuthInfoUpdateParameters', - 'SourceUpdateParameters', - 'SourceTriggerUpdateParameters', - 'BaseImageTriggerUpdateParameters', - 'TriggerUpdateParameters', 'TaskUpdateParameters', - 'ProxyResource', - 'Argument', - 'DockerBuildRequest', - 'SetValue', - 'FileTaskRunRequest', - 'TaskRunRequest', - 'EncodedTaskRunRequest', - 'DockerBuildStep', - 'FileTaskStep', - 'EncodedTaskStep', - 'DockerBuildStepUpdateParameters', - 'FileTaskStepUpdateParameters', - 'EncodedTaskStepUpdateParameters', + 'TriggerProperties', + 'TriggerUpdateParameters', + 'TrustPolicy', + 'VirtualNetworkRule', + 'Webhook', + 'WebhookCreateParameters', + 'WebhookUpdateParameters', 'RegistryPaged', 'OperationDefinitionPaged', 'ReplicationPaged', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/container_registry_management_client_enums.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/_container_registry_management_client_enums.py similarity index 100% rename from sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/container_registry_management_client_enums.py rename to sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/_container_registry_management_client_enums.py diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/_models.py new file mode 100644 index 000000000000..bec982eef790 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/_models.py @@ -0,0 +1,3243 @@ +# 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) + + +class AgentProperties(Model): + """The properties that determine the run agent configuration. + + :param cpu: The CPU configuration in terms of number of cores required for + the run. + :type cpu: int + """ + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AgentProperties, self).__init__(**kwargs) + self.cpu = kwargs.get('cpu', None) + + +class Argument(Model): + """The properties of a run argument. + + All required parameters must be populated in order to send to Azure. + + :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 = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Argument, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.is_secret = kwargs.get('is_secret', False) + + +class AuthInfo(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: Required. The type of Auth token. Possible values + include: 'PAT', 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.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_type': {'required': True}, + '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(AuthInfo, 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) + + +class AuthInfoUpdateParameters(Model): + """The authorization properties for accessing the source code repository. + + :param token_type: The type of Auth token. Possible values include: 'PAT', + 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TokenType + :param token: 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 + """ + + _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(AuthInfoUpdateParameters, 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) + + +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_09_01.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) + + +class BaseImageTrigger(Model): + """The trigger based on base image dependency. + + All required parameters must be populated in order to send to Azure. + + :param base_image_trigger_type: Required. The type of the auto trigger for + base image dependency updates. Possible values include: 'All', 'Runtime' + :type base_image_trigger_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTriggerType + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'base_image_trigger_type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BaseImageTrigger, self).__init__(**kwargs) + self.base_image_trigger_type = kwargs.get('base_image_trigger_type', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class BaseImageTriggerUpdateParameters(Model): + """The properties for updating base image dependency trigger. + + All required parameters must be populated in order to send to Azure. + + :param base_image_trigger_type: The type of the auto trigger for base + image dependency updates. Possible values include: 'All', 'Runtime' + :type base_image_trigger_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTriggerType + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BaseImageTriggerUpdateParameters, self).__init__(**kwargs) + self.base_image_trigger_type = kwargs.get('base_image_trigger_type', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +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) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class Credentials(Model): + """The parameters that describes a set of credentials that will be used when a + run is invoked. + + :param source_registry: Describes the credential parameters for accessing + the source registry. + :type source_registry: + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceRegistryCredentials + :param custom_registries: Describes the credential parameters for + accessing other custom registries. The key + for the dictionary item will be the registry login server + (myregistry.azurecr.io) and + the value of the item will be the registry credentials for accessing the + registry. + :type custom_registries: dict[str, + ~azure.mgmt.containerregistry.v2018_09_01.models.CustomRegistryCredentials] + """ + + _attribute_map = { + 'source_registry': {'key': 'sourceRegistry', 'type': 'SourceRegistryCredentials'}, + 'custom_registries': {'key': 'customRegistries', 'type': '{CustomRegistryCredentials}'}, + } + + def __init__(self, **kwargs): + super(Credentials, self).__init__(**kwargs) + self.source_registry = kwargs.get('source_registry', None) + self.custom_registries = kwargs.get('custom_registries', None) + + +class CustomRegistryCredentials(Model): + """Describes the credentials that will be used to access a custom registry + during a run. + + :param user_name: The username for logging into the custom registry. + :type user_name: + ~azure.mgmt.containerregistry.v2018_09_01.models.SecretObject + :param password: The password for logging into the custom registry. The + password is a secret + object that allows multiple ways of providing the value for it. + :type password: + ~azure.mgmt.containerregistry.v2018_09_01.models.SecretObject + """ + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'SecretObject'}, + 'password': {'key': 'password', 'type': 'SecretObject'}, + } + + def __init__(self, **kwargs): + super(CustomRegistryCredentials, self).__init__(**kwargs) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) + + +class RunRequest(Model): + """The request parameters for scheduling a run. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildRequest, FileTaskRunRequest, TaskRunRequest, + EncodedTaskRunRequest + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} + } + + def __init__(self, **kwargs): + super(RunRequest, self).__init__(**kwargs) + self.is_archive_enabled = kwargs.get('is_archive_enabled', False) + self.type = None + + +class DockerBuildRequest(RunRequest): + """The parameters for a docker quick build. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :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 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: Required. The Docker file path relative to the + source location. + :type docker_file_path: str + :param target: The name of the target build stage for the docker build. + :type target: str + :param arguments: The collection of override arguments to be used when + executing the run. + :type arguments: + list[~azure.mgmt.containerregistry.v2018_09_01.models.Argument] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'docker_file_path': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', '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'}, + 'target': {'key': 'target', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, **kwargs): + super(DockerBuildRequest, self).__init__(**kwargs) + 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.target = kwargs.get('target', None) + self.arguments = kwargs.get('arguments', None) + self.timeout = kwargs.get('timeout', 3600) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.source_location = kwargs.get('source_location', None) + self.credentials = kwargs.get('credentials', None) + self.type = 'DockerBuildRequest' + + +class TaskStepProperties(Model): + """Base properties for any task step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStep, FileTaskStep, EncodedTaskStep + + 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStep', 'FileTask': 'FileTaskStep', 'EncodedTask': 'EncodedTaskStep'} + } + + def __init__(self, **kwargs): + super(TaskStepProperties, self).__init__(**kwargs) + self.base_image_dependencies = None + self.context_path = kwargs.get('context_path', None) + self.context_access_token = kwargs.get('context_access_token', None) + self.type = None + + +class DockerBuildStep(TaskStepProperties): + """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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :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 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: Required. The Docker file path relative to the + source context. + :type docker_file_path: str + :param target: The name of the target build stage for the docker build. + :type target: str + :param arguments: The collection of override arguments to be used when + executing this build step. + :type arguments: + list[~azure.mgmt.containerregistry.v2018_09_01.models.Argument] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'docker_file_path': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + 'target': {'key': 'target', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + } + + def __init__(self, **kwargs): + super(DockerBuildStep, self).__init__(**kwargs) + 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.target = kwargs.get('target', None) + self.arguments = kwargs.get('arguments', None) + self.type = 'Docker' + + +class TaskStepUpdateParameters(Model): + """Base properties for updating any task step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStepUpdateParameters, + FileTaskStepUpdateParameters, EncodedTaskStepUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStepUpdateParameters', 'FileTask': 'FileTaskStepUpdateParameters', 'EncodedTask': 'EncodedTaskStepUpdateParameters'} + } + + def __init__(self, **kwargs): + super(TaskStepUpdateParameters, self).__init__(**kwargs) + self.context_path = kwargs.get('context_path', None) + self.context_access_token = kwargs.get('context_access_token', None) + self.type = None + + +class DockerBuildStepUpdateParameters(TaskStepUpdateParameters): + """The properties for updating a docker build step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :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 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 + context. + :type docker_file_path: str + :param arguments: The collection of override arguments to be used when + executing this build step. + :type arguments: + list[~azure.mgmt.containerregistry.v2018_09_01.models.Argument] + :param target: The name of the target build stage for the docker build. + :type target: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DockerBuildStepUpdateParameters, self).__init__(**kwargs) + 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.arguments = kwargs.get('arguments', None) + self.target = kwargs.get('target', None) + self.type = 'Docker' + + +class EncodedTaskRunRequest(RunRequest): + """The parameters for a quick task run request. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Required. Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'encoded_task_content': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, **kwargs): + super(EncodedTaskRunRequest, self).__init__(**kwargs) + self.encoded_task_content = kwargs.get('encoded_task_content', None) + self.encoded_values_content = kwargs.get('encoded_values_content', None) + self.values = kwargs.get('values', None) + self.timeout = kwargs.get('timeout', 3600) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.source_location = kwargs.get('source_location', None) + self.credentials = kwargs.get('credentials', None) + self.type = 'EncodedTaskRunRequest' + + +class EncodedTaskStep(TaskStepProperties): + """The properties of a encoded task 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Required. Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'encoded_task_content': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(EncodedTaskStep, self).__init__(**kwargs) + self.encoded_task_content = kwargs.get('encoded_task_content', None) + self.encoded_values_content = kwargs.get('encoded_values_content', None) + self.values = kwargs.get('values', None) + self.type = 'EncodedTask' + + +class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters): + """The properties for updating encoded task step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(EncodedTaskStepUpdateParameters, self).__init__(**kwargs) + self.encoded_task_content = kwargs.get('encoded_task_content', None) + self.encoded_values_content = kwargs.get('encoded_values_content', None) + self.values = kwargs.get('values', None) + self.type = 'EncodedTask' + + +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) + + +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_09_01.models.EventRequestMessage + :param event_response_message: The event response message received from + the service URI. + :type event_response_message: + ~azure.mgmt.containerregistry.v2018_09_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, **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) + + +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_09_01.models.Target + :param request: The request that generated the event. + :type request: ~azure.mgmt.containerregistry.v2018_09_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.v2018_09_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.v2018_09_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, **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) + + +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_09_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, **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) + + +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) + + +class FileTaskRunRequest(RunRequest): + """The request parameters for a scheduling run against a task file. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: Required. The template/definition file path + relative to the source. + :type task_file_path: str + :param values_file_path: The values/parameters file path relative to the + source. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'task_file_path': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, **kwargs): + super(FileTaskRunRequest, self).__init__(**kwargs) + self.task_file_path = kwargs.get('task_file_path', None) + self.values_file_path = kwargs.get('values_file_path', None) + self.values = kwargs.get('values', None) + self.timeout = kwargs.get('timeout', 3600) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.source_location = kwargs.get('source_location', None) + self.credentials = kwargs.get('credentials', None) + self.type = 'FileTaskRunRequest' + + +class FileTaskStep(TaskStepProperties): + """The properties of a task 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: Required. The task template/definition file path + relative to the source context. + :type task_file_path: str + :param values_file_path: The task values/parameters file path relative to + the source context. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'task_file_path': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(FileTaskStep, self).__init__(**kwargs) + self.task_file_path = kwargs.get('task_file_path', None) + self.values_file_path = kwargs.get('values_file_path', None) + self.values = kwargs.get('values', None) + self.type = 'FileTask' + + +class FileTaskStepUpdateParameters(TaskStepUpdateParameters): + """The properties of updating a task step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: The task template/definition file path relative to + the source context. + :type task_file_path: str + :param values_file_path: The values/parameters file path relative to the + source context. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(FileTaskStepUpdateParameters, self).__init__(**kwargs) + self.task_file_path = kwargs.get('task_file_path', None) + self.values_file_path = kwargs.get('values_file_path', None) + self.values = kwargs.get('values', None) + self.type = 'FileTask' + + +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) + + +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_09_01.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) + + +class ImportImageParameters(Model): + """ImportImageParameters. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the image. + :type source: + ~azure.mgmt.containerregistry.v2018_09_01.models.ImportSource + :param target_tags: List of strings of the form repo[:tag]. When tag is + omitted the source will be used (or 'latest' if source tag is also + omitted). + :type target_tags: list[str] + :param untagged_target_repositories: List of strings of repository names + to do a manifest only copy. No tag will be created. + :type untagged_target_repositories: list[str] + :param mode: When Force, any existing target tags will be overwritten. + When NoForce, any existing target tags will fail the operation before any + copying begins. Possible values include: 'NoForce', 'Force'. Default + value: "NoForce" . + :type mode: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.ImportMode + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ImportSource'}, + 'target_tags': {'key': 'targetTags', 'type': '[str]'}, + 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportImageParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.target_tags = kwargs.get('target_tags', None) + self.untagged_target_repositories = kwargs.get('untagged_target_repositories', None) + self.mode = kwargs.get('mode', "NoForce") + + +class ImportSource(Model): + """ImportSource. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: The resource identifier of the source Azure Container + Registry. + :type resource_id: str + :param registry_uri: The address of the source registry (e.g. + 'mcr.microsoft.com'). + :type registry_uri: str + :param credentials: Credentials used when importing from a registry uri. + :type credentials: + ~azure.mgmt.containerregistry.v2018_09_01.models.ImportSourceCredentials + :param source_image: Required. Repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' + tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest + ('hello-world@sha256:abc123'). + :type source_image: str + """ + + _validation = { + 'source_image': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'registry_uri': {'key': 'registryUri', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, + 'source_image': {'key': 'sourceImage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportSource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.registry_uri = kwargs.get('registry_uri', None) + self.credentials = kwargs.get('credentials', None) + self.source_image = kwargs.get('source_image', None) + + +class ImportSourceCredentials(Model): + """ImportSourceCredentials. + + All required parameters must be populated in order to send to Azure. + + :param username: The username to authenticate with the source registry. + :type username: str + :param password: Required. The password used to authenticate with the + source registry. + :type password: str + """ + + _validation = { + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportSourceCredentials, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.Action + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.action = kwargs.get('action', "Allow") + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + + +class NetworkRuleSet(Model): + """The network rule set for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Required. The default action of allow or deny when + no other rules match. Possible values include: 'Allow', 'Deny'. Default + value: "Allow" . + :type default_action: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.DefaultAction + :param virtual_network_rules: The virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.containerregistry.v2018_09_01.models.VirtualNetworkRule] + :param ip_rules: The IP ACL rules. + :type ip_rules: + list[~azure.mgmt.containerregistry.v2018_09_01.models.IPRule] + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = kwargs.get('default_action', "Allow") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param origin: The origin information of the container registry operation. + :type origin: str + :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_09_01.models.OperationDisplayDefinition + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2018_09_01.models.OperationServiceSpecificationDefinition + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, + } + + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.origin = kwargs.get('origin', None) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.service_specification = kwargs.get('service_specification', None) + + +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) + + +class OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) + + +class OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2018_09_01.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, **kwargs): + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class PlatformProperties(Model): + """The platform properties against which the run has to happen. + + All required parameters must be populated in order to send to Azure. + + :param os: Required. The operating system type required for the run. + Possible values include: 'Windows', 'Linux' + :type os: str or ~azure.mgmt.containerregistry.v2018_09_01.models.OS + :param architecture: The OS architecture. Possible values include: + 'amd64', 'x86', 'arm' + :type architecture: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.Architecture + :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', + 'v8' + :type variant: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.Variant + """ + + _validation = { + 'os': {'required': True}, + } + + _attribute_map = { + 'os': {'key': 'os', 'type': 'str'}, + 'architecture': {'key': 'architecture', 'type': 'str'}, + 'variant': {'key': 'variant', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PlatformProperties, self).__init__(**kwargs) + self.os = kwargs.get('os', None) + self.architecture = kwargs.get('architecture', None) + self.variant = kwargs.get('variant', None) + + +class PlatformUpdateParameters(Model): + """The properties for updating the platform configuration. + + :param os: The operating system type required for the run. Possible values + include: 'Windows', 'Linux' + :type os: str or ~azure.mgmt.containerregistry.v2018_09_01.models.OS + :param architecture: The OS architecture. Possible values include: + 'amd64', 'x86', 'arm' + :type architecture: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.Architecture + :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', + 'v8' + :type variant: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.Variant + """ + + _attribute_map = { + 'os': {'key': 'os', 'type': 'str'}, + 'architecture': {'key': 'architecture', 'type': 'str'}, + 'variant': {'key': 'variant', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PlatformUpdateParameters, self).__init__(**kwargs) + self.os = kwargs.get('os', None) + self.architecture = kwargs.get('architecture', None) + self.variant = kwargs.get('variant', None) + + +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 + + +class QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + +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_09_01.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) + + +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) + + +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_09_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.v2018_09_01.models.ProvisioningState + :ivar status: The status of the container registry at the time the + operation was called. + :vartype status: ~azure.mgmt.containerregistry.v2018_09_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.v2018_09_01.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2018_09_01.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + 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) + self.network_rule_set = kwargs.get('network_rule_set', None) + + +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_09_01.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) + + +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) + + +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) + + +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_09_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, **kwargs): + super(RegistryPassword, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2018_09_01.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2018_09_01.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, **kwargs): + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = kwargs.get('quarantine_policy', None) + self.trust_policy = kwargs.get('trust_policy', None) + + +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_09_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.v2018_09_01.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2018_09_01.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + 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) + self.network_rule_set = kwargs.get('network_rule_set', None) + + +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_09_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, **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) + + +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_09_01.models.RegistryUsage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RegistryUsage]'}, + } + + def __init__(self, **kwargs): + super(RegistryUsageListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +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_09_01.models.ProvisioningState + :ivar status: The status of the replication at the time the operation was + called. + :vartype status: ~azure.mgmt.containerregistry.v2018_09_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, **kwargs): + super(Replication, self).__init__(**kwargs) + self.provisioning_state = None + self.status = None + + +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) + + +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) + + +class Run(ProxyResource): + """Run 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 run_id: The unique identifier for the run. + :type run_id: str + :param status: The current status of the run. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.RunStatus + :param last_updated_time: The last updated time for the run. + :type last_updated_time: datetime + :param run_type: The type of run. Possible values include: 'QuickBuild', + 'QuickRun', 'AutoBuild', 'AutoRun' + :type run_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.RunType + :param create_time: The time the run was scheduled. + :type create_time: datetime + :param start_time: The time the run started. + :type start_time: datetime + :param finish_time: The time the run finished. + :type finish_time: datetime + :param output_images: The list of all images that were generated from the + run. This is applicable if the run generates base image dependencies. + :type output_images: + list[~azure.mgmt.containerregistry.v2018_09_01.models.ImageDescriptor] + :param task: The task against which run was scheduled. + :type task: str + :param image_update_trigger: The image update trigger that caused the run. + This is applicable if the task has base image trigger configured. + :type image_update_trigger: + ~azure.mgmt.containerregistry.v2018_09_01.models.ImageUpdateTrigger + :param source_trigger: The source trigger that caused the run. + :type source_trigger: + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerDescriptor + :param platform: The platform properties against which the run will + happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties + :param source_registry_auth: The scope of the credentials that were used + to login to the source registry during this run. + :type source_registry_auth: str + :param custom_registries: The list of custom registries that were logged + in during this run. + :type custom_registries: list[str] + :ivar run_error_message: The error message received from backend systems + after the run is scheduled. + :vartype run_error_message: str + :param provisioning_state: The provisioning state of a run. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :type provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.ProvisioningState + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. Default value: False . + :type is_archive_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'run_error_message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'run_id': {'key': 'properties.runId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'run_type': {'key': 'properties.runType', '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]'}, + 'task': {'key': 'properties.task', 'type': 'str'}, + 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, + 'source_trigger': {'key': 'properties.sourceTrigger', 'type': 'SourceTriggerDescriptor'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'source_registry_auth': {'key': 'properties.sourceRegistryAuth', 'type': 'str'}, + 'custom_registries': {'key': 'properties.customRegistries', 'type': '[str]'}, + 'run_error_message': {'key': 'properties.runErrorMessage', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Run, self).__init__(**kwargs) + self.run_id = kwargs.get('run_id', None) + self.status = kwargs.get('status', None) + self.last_updated_time = kwargs.get('last_updated_time', None) + self.run_type = kwargs.get('run_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.task = kwargs.get('task', None) + self.image_update_trigger = kwargs.get('image_update_trigger', None) + self.source_trigger = kwargs.get('source_trigger', None) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.source_registry_auth = kwargs.get('source_registry_auth', None) + self.custom_registries = kwargs.get('custom_registries', None) + self.run_error_message = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.is_archive_enabled = kwargs.get('is_archive_enabled', False) + + +class RunFilter(Model): + """Properties that are enabled for Odata querying on runs. + + :param run_id: The unique identifier for the run. + :type run_id: str + :param run_type: The type of run. Possible values include: 'QuickBuild', + 'QuickRun', 'AutoBuild', 'AutoRun' + :type run_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.RunType + :param status: The current status of the run. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.RunStatus + :param create_time: The create time for a run. + :type create_time: datetime + :param finish_time: The time the run finished. + :type finish_time: datetime + :param output_image_manifests: The list of comma-separated image manifests + that were generated from the run. This is applicable if the run is of + build type. + :type output_image_manifests: str + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. + :type is_archive_enabled: bool + :param task_name: The name of the task that the run corresponds to. + :type task_name: str + """ + + _attribute_map = { + 'run_id': {'key': 'runId', 'type': 'str'}, + 'run_type': {'key': 'runType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunFilter, self).__init__(**kwargs) + self.run_id = kwargs.get('run_id', None) + self.run_type = kwargs.get('run_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_manifests = kwargs.get('output_image_manifests', None) + self.is_archive_enabled = kwargs.get('is_archive_enabled', None) + self.task_name = kwargs.get('task_name', None) + + +class RunGetLogResult(Model): + """The result of get log link operation. + + :param log_link: The link to logs for a run on a azure container registry. + :type log_link: str + """ + + _attribute_map = { + 'log_link': {'key': 'logLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunGetLogResult, self).__init__(**kwargs) + self.log_link = kwargs.get('log_link', None) + + +class RunUpdateParameters(Model): + """The set of run 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(RunUpdateParameters, self).__init__(**kwargs) + self.is_archive_enabled = kwargs.get('is_archive_enabled', None) + + +class SecretObject(Model): + """Describes the properties of a secret object value. + + :param value: The value of the secret. The format of this value will be + determined + based on the type of the secret object. If the type is Opaque, the value + will be + used as is without any modification. + :type value: str + :param type: The type of the secret object which determines how the value + of the secret object has to be + interpreted. Possible values include: 'Opaque' + :type type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.SecretObjectType + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecretObject, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.type = kwargs.get('type', None) + + +class SetValue(Model): + """The properties of a overridable value that can be passed to a task + template. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the overridable value. + :type name: str + :param value: Required. The overridable value. + :type value: str + :param is_secret: Flag to indicate whether the value represents a secret + or not. Default value: False . + :type is_secret: bool + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SetValue, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.is_secret = kwargs.get('is_secret', False) + + +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_09_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.v2018_09_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, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + + +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) + + +class SourceProperties(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_09_01.models.SourceControlType + :param repository_url: Required. The full URL to the source code + repository + :type repository_url: str + :param branch: The branch name of the source code. + :type branch: str + :param source_control_auth_properties: The authorization properties for + accessing the source code repository and to set up + webhooks for notifications. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2018_09_01.models.AuthInfo + """ + + _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'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfo'}, + } + + def __init__(self, **kwargs): + super(SourceProperties, self).__init__(**kwargs) + self.source_control_type = kwargs.get('source_control_type', None) + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) + + +class SourceRegistryCredentials(Model): + """Describes the credential parameters for accessing the source registry. + + :param login_mode: The authentication mode which determines the source + registry login scope. The credentials for the source registry + will be generated using the given scope. These credentials will be used to + login to + the source registry during the run. Possible values include: 'None', + 'Default' + :type login_mode: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceRegistryLoginMode + """ + + _attribute_map = { + 'login_mode': {'key': 'loginMode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceRegistryCredentials, self).__init__(**kwargs) + self.login_mode = kwargs.get('login_mode', None) + + +class SourceTrigger(Model): + """The properties of a source based trigger. + + All required parameters must be populated in order to send to Azure. + + :param source_repository: Required. The properties that describes the + source(code) for the task. + :type source_repository: + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceProperties + :param source_trigger_events: Required. The source event corresponding to + the trigger. + :type source_trigger_events: list[str or + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerEvent] + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'source_repository': {'required': True}, + 'source_trigger_events': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'source_repository': {'key': 'sourceRepository', 'type': 'SourceProperties'}, + 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceTrigger, self).__init__(**kwargs) + self.source_repository = kwargs.get('source_repository', None) + self.source_trigger_events = kwargs.get('source_trigger_events', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class SourceTriggerDescriptor(Model): + """The source trigger that caused a run. + + :param id: The unique ID of the trigger. + :type id: str + :param event_type: The event type of the trigger. + :type event_type: str + :param commit_id: The unique ID that identifies a commit. + :type commit_id: str + :param pull_request_id: The unique ID that identifies pull request. + :type pull_request_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'}, + 'event_type': {'key': 'eventType', 'type': 'str'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'pull_request_id': {'key': 'pullRequestId', '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(SourceTriggerDescriptor, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.event_type = kwargs.get('event_type', None) + self.commit_id = kwargs.get('commit_id', None) + self.pull_request_id = kwargs.get('pull_request_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) + + +class SourceTriggerUpdateParameters(Model): + """The properties for updating a source based trigger. + + All required parameters must be populated in order to send to Azure. + + :param source_repository: The properties that describes the source(code) + for the task. + :type source_repository: + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceUpdateParameters + :param source_trigger_events: The source event corresponding to the + trigger. + :type source_trigger_events: list[str or + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerEvent] + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'source_repository': {'key': 'sourceRepository', 'type': 'SourceUpdateParameters'}, + 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceTriggerUpdateParameters, self).__init__(**kwargs) + self.source_repository = kwargs.get('source_repository', None) + self.source_trigger_events = kwargs.get('source_trigger_events', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class SourceUpdateParameters(Model): + """The properties for updating the source code repository. + + :param source_control_type: The type of source control service. Possible + values include: 'Github', 'VisualStudioTeamService' + :type source_control_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceControlType + :param repository_url: The full URL to the source code repository + :type repository_url: str + :param branch: The branch name of the source code. + :type branch: str + :param source_control_auth_properties: The authorization properties for + accessing the source code repository and to set up + webhooks for notifications. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2018_09_01.models.AuthInfoUpdateParameters + """ + + _attribute_map = { + 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, + 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfoUpdateParameters'}, + } + + def __init__(self, **kwargs): + super(SourceUpdateParameters, self).__init__(**kwargs) + self.source_control_type = kwargs.get('source_control_type', None) + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) + + +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) + + +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 + + +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) + + +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 + :param name: The name of the artifact. + :type name: str + :param version: The version of the artifact. + :type version: 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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', '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) + self.name = kwargs.get('name', None) + self.version = kwargs.get('version', None) + + +class Task(Resource): + """The task that has the ARM resource and task properties. + The task will have all information to schedule a run 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 task. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.ProvisioningState + :ivar creation_date: The creation date of task. + :vartype creation_date: datetime + :param status: The current status of task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStatus + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param step: Required. The properties of a task step. + :type step: + ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStepProperties + :param trigger: The properties that describe all triggers for the task. + :type trigger: + ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerProperties + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'platform': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'step': {'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}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, + 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, + 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, + } + + def __init__(self, **kwargs): + super(Task, self).__init__(**kwargs) + self.provisioning_state = None + self.creation_date = None + self.status = kwargs.get('status', None) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.timeout = kwargs.get('timeout', 3600) + self.step = kwargs.get('step', None) + self.trigger = kwargs.get('trigger', None) + self.credentials = kwargs.get('credentials', None) + + +class TaskRunRequest(RunRequest): + """The parameters for a task run request. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param task_name: Required. The name of task against which run has to be + queued. + :type task_name: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + 'task_name': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(TaskRunRequest, self).__init__(**kwargs) + self.task_name = kwargs.get('task_name', None) + self.values = kwargs.get('values', None) + self.type = 'TaskRunRequest' + + +class TaskUpdateParameters(Model): + """The parameters for updating a task. + + :param status: The current status of task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStatus + :param platform: The platform properties against which the run has to + happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformUpdateParameters + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties + :param timeout: Run timeout in seconds. + :type timeout: int + :param step: The properties for updating a task step. + :type step: + ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStepUpdateParameters + :param trigger: The properties for updating trigger properties. + :type trigger: + ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerUpdateParameters + :param credentials: The parameters that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, + 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, + 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TaskUpdateParameters, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.timeout = kwargs.get('timeout', None) + self.step = kwargs.get('step', None) + self.trigger = kwargs.get('trigger', None) + self.credentials = kwargs.get('credentials', None) + self.tags = kwargs.get('tags', None) + + +class TriggerProperties(Model): + """The properties of a trigger. + + :param source_triggers: The collection of triggers based on source code + repository. + :type source_triggers: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SourceTrigger] + :param base_image_trigger: The trigger based on base image dependencies. + :type base_image_trigger: + ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTrigger + """ + + _attribute_map = { + 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTrigger]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTrigger'}, + } + + def __init__(self, **kwargs): + super(TriggerProperties, self).__init__(**kwargs) + self.source_triggers = kwargs.get('source_triggers', None) + self.base_image_trigger = kwargs.get('base_image_trigger', None) + + +class TriggerUpdateParameters(Model): + """The properties for updating triggers. + + :param source_triggers: The collection of triggers based on source code + repository. + :type source_triggers: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerUpdateParameters] + :param base_image_trigger: The trigger based on base image dependencies. + :type base_image_trigger: + ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTriggerUpdateParameters + """ + + _attribute_map = { + 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTriggerUpdateParameters]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTriggerUpdateParameters'}, + } + + def __init__(self, **kwargs): + super(TriggerUpdateParameters, self).__init__(**kwargs) + self.source_triggers = kwargs.get('source_triggers', None) + self.base_image_trigger = kwargs.get('base_image_trigger', None) + + +class TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrustPolicy, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.status = kwargs.get('status', None) + + +class VirtualNetworkRule(Model): + """Virtual network rule. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.Action + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.action = kwargs.get('action', "Allow") + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + + +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_09_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.v2018_09_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.v2018_09_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, **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 + + +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_09_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.v2018_09_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, **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) + + +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_09_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.v2018_09_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/_models_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/_models_py3.py new file mode 100644 index 000000000000..62fecc9c2f62 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/_models_py3.py @@ -0,0 +1,3243 @@ +# 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 + + +class AgentProperties(Model): + """The properties that determine the run agent configuration. + + :param cpu: The CPU configuration in terms of number of cores required for + the run. + :type cpu: int + """ + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'int'}, + } + + def __init__(self, *, cpu: int=None, **kwargs) -> None: + super(AgentProperties, self).__init__(**kwargs) + self.cpu = cpu + + +class Argument(Model): + """The properties of a run argument. + + All required parameters must be populated in order to send to Azure. + + :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 = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: + super(Argument, self).__init__(**kwargs) + self.name = name + self.value = value + self.is_secret = is_secret + + +class AuthInfo(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: Required. The type of Auth token. Possible values + include: 'PAT', 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.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_type': {'required': True}, + '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_type, token: str, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: + super(AuthInfo, self).__init__(**kwargs) + self.token_type = token_type + self.token = token + self.refresh_token = refresh_token + self.scope = scope + self.expires_in = expires_in + + +class AuthInfoUpdateParameters(Model): + """The authorization properties for accessing the source code repository. + + :param token_type: The type of Auth token. Possible values include: 'PAT', + 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TokenType + :param token: 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 + """ + + _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_type=None, token: str=None, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: + super(AuthInfoUpdateParameters, self).__init__(**kwargs) + self.token_type = token_type + self.token = token + self.refresh_token = refresh_token + self.scope = scope + self.expires_in = expires_in + + +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_09_01.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 + + +class BaseImageTrigger(Model): + """The trigger based on base image dependency. + + All required parameters must be populated in order to send to Azure. + + :param base_image_trigger_type: Required. The type of the auto trigger for + base image dependency updates. Possible values include: 'All', 'Runtime' + :type base_image_trigger_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTriggerType + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'base_image_trigger_type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, base_image_trigger_type, name: str, status="Enabled", **kwargs) -> None: + super(BaseImageTrigger, self).__init__(**kwargs) + self.base_image_trigger_type = base_image_trigger_type + self.status = status + self.name = name + + +class BaseImageTriggerUpdateParameters(Model): + """The properties for updating base image dependency trigger. + + All required parameters must be populated in order to send to Azure. + + :param base_image_trigger_type: The type of the auto trigger for base + image dependency updates. Possible values include: 'All', 'Runtime' + :type base_image_trigger_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTriggerType + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, base_image_trigger_type=None, status="Enabled", **kwargs) -> None: + super(BaseImageTriggerUpdateParameters, self).__init__(**kwargs) + self.base_image_trigger_type = base_image_trigger_type + self.status = status + self.name = name + + +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 + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class Credentials(Model): + """The parameters that describes a set of credentials that will be used when a + run is invoked. + + :param source_registry: Describes the credential parameters for accessing + the source registry. + :type source_registry: + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceRegistryCredentials + :param custom_registries: Describes the credential parameters for + accessing other custom registries. The key + for the dictionary item will be the registry login server + (myregistry.azurecr.io) and + the value of the item will be the registry credentials for accessing the + registry. + :type custom_registries: dict[str, + ~azure.mgmt.containerregistry.v2018_09_01.models.CustomRegistryCredentials] + """ + + _attribute_map = { + 'source_registry': {'key': 'sourceRegistry', 'type': 'SourceRegistryCredentials'}, + 'custom_registries': {'key': 'customRegistries', 'type': '{CustomRegistryCredentials}'}, + } + + def __init__(self, *, source_registry=None, custom_registries=None, **kwargs) -> None: + super(Credentials, self).__init__(**kwargs) + self.source_registry = source_registry + self.custom_registries = custom_registries + + +class CustomRegistryCredentials(Model): + """Describes the credentials that will be used to access a custom registry + during a run. + + :param user_name: The username for logging into the custom registry. + :type user_name: + ~azure.mgmt.containerregistry.v2018_09_01.models.SecretObject + :param password: The password for logging into the custom registry. The + password is a secret + object that allows multiple ways of providing the value for it. + :type password: + ~azure.mgmt.containerregistry.v2018_09_01.models.SecretObject + """ + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'SecretObject'}, + 'password': {'key': 'password', 'type': 'SecretObject'}, + } + + def __init__(self, *, user_name=None, password=None, **kwargs) -> None: + super(CustomRegistryCredentials, self).__init__(**kwargs) + self.user_name = user_name + self.password = password + + +class RunRequest(Model): + """The request parameters for scheduling a run. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildRequest, FileTaskRunRequest, TaskRunRequest, + EncodedTaskRunRequest + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} + } + + def __init__(self, *, is_archive_enabled: bool=False, **kwargs) -> None: + super(RunRequest, self).__init__(**kwargs) + self.is_archive_enabled = is_archive_enabled + self.type = None + + +class DockerBuildRequest(RunRequest): + """The parameters for a docker quick build. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :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 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: Required. The Docker file path relative to the + source location. + :type docker_file_path: str + :param target: The name of the target build stage for the docker build. + :type target: str + :param arguments: The collection of override arguments to be used when + executing the run. + :type arguments: + list[~azure.mgmt.containerregistry.v2018_09_01.models.Argument] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'docker_file_path': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', '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'}, + 'target': {'key': 'target', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, *, docker_file_path: str, platform, is_archive_enabled: bool=False, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(DockerBuildRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + 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.target = target + self.arguments = arguments + self.timeout = timeout + self.platform = platform + self.agent_configuration = agent_configuration + self.source_location = source_location + self.credentials = credentials + self.type = 'DockerBuildRequest' + + +class TaskStepProperties(Model): + """Base properties for any task step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStep, FileTaskStep, EncodedTaskStep + + 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStep', 'FileTask': 'FileTaskStep', 'EncodedTask': 'EncodedTaskStep'} + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, **kwargs) -> None: + super(TaskStepProperties, self).__init__(**kwargs) + self.base_image_dependencies = None + self.context_path = context_path + self.context_access_token = context_access_token + self.type = None + + +class DockerBuildStep(TaskStepProperties): + """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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :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 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: Required. The Docker file path relative to the + source context. + :type docker_file_path: str + :param target: The name of the target build stage for the docker build. + :type target: str + :param arguments: The collection of override arguments to be used when + executing this build step. + :type arguments: + list[~azure.mgmt.containerregistry.v2018_09_01.models.Argument] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'docker_file_path': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + 'target': {'key': 'target', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + } + + def __init__(self, *, docker_file_path: str, context_path: str=None, context_access_token: str=None, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, **kwargs) -> None: + super(DockerBuildStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + 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.target = target + self.arguments = arguments + self.type = 'Docker' + + +class TaskStepUpdateParameters(Model): + """Base properties for updating any task step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStepUpdateParameters, + FileTaskStepUpdateParameters, EncodedTaskStepUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStepUpdateParameters', 'FileTask': 'FileTaskStepUpdateParameters', 'EncodedTask': 'EncodedTaskStepUpdateParameters'} + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, **kwargs) -> None: + super(TaskStepUpdateParameters, self).__init__(**kwargs) + self.context_path = context_path + self.context_access_token = context_access_token + self.type = None + + +class DockerBuildStepUpdateParameters(TaskStepUpdateParameters): + """The properties for updating a docker build step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :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 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 + context. + :type docker_file_path: str + :param arguments: The collection of override arguments to be used when + executing this build step. + :type arguments: + list[~azure.mgmt.containerregistry.v2018_09_01.models.Argument] + :param target: The name of the target build stage for the docker build. + :type target: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, image_names=None, is_push_enabled: bool=None, no_cache: bool=None, docker_file_path: str=None, arguments=None, target: str=None, **kwargs) -> None: + super(DockerBuildStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + 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.arguments = arguments + self.target = target + self.type = 'Docker' + + +class EncodedTaskRunRequest(RunRequest): + """The parameters for a quick task run request. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Required. Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'encoded_task_content': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, *, encoded_task_content: str, platform, is_archive_enabled: bool=False, encoded_values_content: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(EncodedTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + self.encoded_task_content = encoded_task_content + self.encoded_values_content = encoded_values_content + self.values = values + self.timeout = timeout + self.platform = platform + self.agent_configuration = agent_configuration + self.source_location = source_location + self.credentials = credentials + self.type = 'EncodedTaskRunRequest' + + +class EncodedTaskStep(TaskStepProperties): + """The properties of a encoded task 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Required. Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'encoded_task_content': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, encoded_task_content: str, context_path: str=None, context_access_token: str=None, encoded_values_content: str=None, values=None, **kwargs) -> None: + super(EncodedTaskStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + self.encoded_task_content = encoded_task_content + self.encoded_values_content = encoded_values_content + self.values = values + self.type = 'EncodedTask' + + +class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters): + """The properties for updating encoded task step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, encoded_task_content: str=None, encoded_values_content: str=None, values=None, **kwargs) -> None: + super(EncodedTaskStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + self.encoded_task_content = encoded_task_content + self.encoded_values_content = encoded_values_content + self.values = values + self.type = 'EncodedTask' + + +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 + + +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_09_01.models.EventRequestMessage + :param event_response_message: The event response message received from + the service URI. + :type event_response_message: + ~azure.mgmt.containerregistry.v2018_09_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 + + +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_09_01.models.Target + :param request: The request that generated the event. + :type request: ~azure.mgmt.containerregistry.v2018_09_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.v2018_09_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.v2018_09_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 + + +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_09_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 + + +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 + + +class FileTaskRunRequest(RunRequest): + """The request parameters for a scheduling run against a task file. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: Required. The template/definition file path + relative to the source. + :type task_file_path: str + :param values_file_path: The values/parameters file path relative to the + source. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'task_file_path': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, *, task_file_path: str, platform, is_archive_enabled: bool=False, values_file_path: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(FileTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + self.task_file_path = task_file_path + self.values_file_path = values_file_path + self.values = values + self.timeout = timeout + self.platform = platform + self.agent_configuration = agent_configuration + self.source_location = source_location + self.credentials = credentials + self.type = 'FileTaskRunRequest' + + +class FileTaskStep(TaskStepProperties): + """The properties of a task 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: Required. The task template/definition file path + relative to the source context. + :type task_file_path: str + :param values_file_path: The task values/parameters file path relative to + the source context. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'task_file_path': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, task_file_path: str, context_path: str=None, context_access_token: str=None, values_file_path: str=None, values=None, **kwargs) -> None: + super(FileTaskStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + self.task_file_path = task_file_path + self.values_file_path = values_file_path + self.values = values + self.type = 'FileTask' + + +class FileTaskStepUpdateParameters(TaskStepUpdateParameters): + """The properties of updating a task step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: The task template/definition file path relative to + the source context. + :type task_file_path: str + :param values_file_path: The values/parameters file path relative to the + source context. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, task_file_path: str=None, values_file_path: str=None, values=None, **kwargs) -> None: + super(FileTaskStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + self.task_file_path = task_file_path + self.values_file_path = values_file_path + self.values = values + self.type = 'FileTask' + + +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 + + +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_09_01.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 + + +class ImportImageParameters(Model): + """ImportImageParameters. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the image. + :type source: + ~azure.mgmt.containerregistry.v2018_09_01.models.ImportSource + :param target_tags: List of strings of the form repo[:tag]. When tag is + omitted the source will be used (or 'latest' if source tag is also + omitted). + :type target_tags: list[str] + :param untagged_target_repositories: List of strings of repository names + to do a manifest only copy. No tag will be created. + :type untagged_target_repositories: list[str] + :param mode: When Force, any existing target tags will be overwritten. + When NoForce, any existing target tags will fail the operation before any + copying begins. Possible values include: 'NoForce', 'Force'. Default + value: "NoForce" . + :type mode: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.ImportMode + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ImportSource'}, + 'target_tags': {'key': 'targetTags', 'type': '[str]'}, + 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, *, source, target_tags=None, untagged_target_repositories=None, mode="NoForce", **kwargs) -> None: + super(ImportImageParameters, self).__init__(**kwargs) + self.source = source + self.target_tags = target_tags + self.untagged_target_repositories = untagged_target_repositories + self.mode = mode + + +class ImportSource(Model): + """ImportSource. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: The resource identifier of the source Azure Container + Registry. + :type resource_id: str + :param registry_uri: The address of the source registry (e.g. + 'mcr.microsoft.com'). + :type registry_uri: str + :param credentials: Credentials used when importing from a registry uri. + :type credentials: + ~azure.mgmt.containerregistry.v2018_09_01.models.ImportSourceCredentials + :param source_image: Required. Repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' + tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest + ('hello-world@sha256:abc123'). + :type source_image: str + """ + + _validation = { + 'source_image': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'registry_uri': {'key': 'registryUri', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, + 'source_image': {'key': 'sourceImage', 'type': 'str'}, + } + + def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None: + super(ImportSource, self).__init__(**kwargs) + self.resource_id = resource_id + self.registry_uri = registry_uri + self.credentials = credentials + self.source_image = source_image + + +class ImportSourceCredentials(Model): + """ImportSourceCredentials. + + All required parameters must be populated in order to send to Azure. + + :param username: The username to authenticate with the source registry. + :type username: str + :param password: Required. The password used to authenticate with the + source registry. + :type password: str + """ + + _validation = { + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, password: str, username: str=None, **kwargs) -> None: + super(ImportSourceCredentials, self).__init__(**kwargs) + self.username = username + self.password = password + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.Action + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.action = action + self.ip_address_or_range = ip_address_or_range + + +class NetworkRuleSet(Model): + """The network rule set for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Required. The default action of allow or deny when + no other rules match. Possible values include: 'Allow', 'Deny'. Default + value: "Allow" . + :type default_action: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.DefaultAction + :param virtual_network_rules: The virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.containerregistry.v2018_09_01.models.VirtualNetworkRule] + :param ip_rules: The IP ACL rules. + :type ip_rules: + list[~azure.mgmt.containerregistry.v2018_09_01.models.IPRule] + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + } + + def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = default_action + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param origin: The origin information of the container registry operation. + :type origin: str + :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_09_01.models.OperationDisplayDefinition + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2018_09_01.models.OperationServiceSpecificationDefinition + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, + } + + def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.origin = origin + self.name = name + self.display = display + self.service_specification = service_specification + + +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 + + +class OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.internal_metric_name = internal_metric_name + + +class OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2018_09_01.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class PlatformProperties(Model): + """The platform properties against which the run has to happen. + + All required parameters must be populated in order to send to Azure. + + :param os: Required. The operating system type required for the run. + Possible values include: 'Windows', 'Linux' + :type os: str or ~azure.mgmt.containerregistry.v2018_09_01.models.OS + :param architecture: The OS architecture. Possible values include: + 'amd64', 'x86', 'arm' + :type architecture: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.Architecture + :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', + 'v8' + :type variant: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.Variant + """ + + _validation = { + 'os': {'required': True}, + } + + _attribute_map = { + 'os': {'key': 'os', 'type': 'str'}, + 'architecture': {'key': 'architecture', 'type': 'str'}, + 'variant': {'key': 'variant', 'type': 'str'}, + } + + def __init__(self, *, os, architecture=None, variant=None, **kwargs) -> None: + super(PlatformProperties, self).__init__(**kwargs) + self.os = os + self.architecture = architecture + self.variant = variant + + +class PlatformUpdateParameters(Model): + """The properties for updating the platform configuration. + + :param os: The operating system type required for the run. Possible values + include: 'Windows', 'Linux' + :type os: str or ~azure.mgmt.containerregistry.v2018_09_01.models.OS + :param architecture: The OS architecture. Possible values include: + 'amd64', 'x86', 'arm' + :type architecture: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.Architecture + :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', + 'v8' + :type variant: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.Variant + """ + + _attribute_map = { + 'os': {'key': 'os', 'type': 'str'}, + 'architecture': {'key': 'architecture', 'type': 'str'}, + 'variant': {'key': 'variant', 'type': 'str'}, + } + + def __init__(self, *, os=None, architecture=None, variant=None, **kwargs) -> None: + super(PlatformUpdateParameters, self).__init__(**kwargs) + self.os = os + self.architecture = architecture + self.variant = variant + + +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 + + +class QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status=None, **kwargs) -> None: + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = status + + +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_09_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 + + +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 + + +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_09_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.v2018_09_01.models.ProvisioningState + :ivar status: The status of the container registry at the time the + operation was called. + :vartype status: ~azure.mgmt.containerregistry.v2018_09_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.v2018_09_01.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2018_09_01.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=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 + self.network_rule_set = network_rule_set + + +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_09_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 + + +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 + + +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 + + +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_09_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 + + +class RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2018_09_01.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2018_09_01.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, *, quarantine_policy=None, trust_policy=None, **kwargs) -> None: + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = quarantine_policy + self.trust_policy = trust_policy + + +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_09_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.v2018_09_01.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2018_09_01.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, network_rule_set=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 + self.network_rule_set = network_rule_set + + +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_09_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 + + +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_09_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 + + +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_09_01.models.ProvisioningState + :ivar status: The status of the replication at the time the operation was + called. + :vartype status: ~azure.mgmt.containerregistry.v2018_09_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 + + +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 + + +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 + + +class Run(ProxyResource): + """Run 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 run_id: The unique identifier for the run. + :type run_id: str + :param status: The current status of the run. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.RunStatus + :param last_updated_time: The last updated time for the run. + :type last_updated_time: datetime + :param run_type: The type of run. Possible values include: 'QuickBuild', + 'QuickRun', 'AutoBuild', 'AutoRun' + :type run_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.RunType + :param create_time: The time the run was scheduled. + :type create_time: datetime + :param start_time: The time the run started. + :type start_time: datetime + :param finish_time: The time the run finished. + :type finish_time: datetime + :param output_images: The list of all images that were generated from the + run. This is applicable if the run generates base image dependencies. + :type output_images: + list[~azure.mgmt.containerregistry.v2018_09_01.models.ImageDescriptor] + :param task: The task against which run was scheduled. + :type task: str + :param image_update_trigger: The image update trigger that caused the run. + This is applicable if the task has base image trigger configured. + :type image_update_trigger: + ~azure.mgmt.containerregistry.v2018_09_01.models.ImageUpdateTrigger + :param source_trigger: The source trigger that caused the run. + :type source_trigger: + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerDescriptor + :param platform: The platform properties against which the run will + happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties + :param source_registry_auth: The scope of the credentials that were used + to login to the source registry during this run. + :type source_registry_auth: str + :param custom_registries: The list of custom registries that were logged + in during this run. + :type custom_registries: list[str] + :ivar run_error_message: The error message received from backend systems + after the run is scheduled. + :vartype run_error_message: str + :param provisioning_state: The provisioning state of a run. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :type provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.ProvisioningState + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. Default value: False . + :type is_archive_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'run_error_message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'run_id': {'key': 'properties.runId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'run_type': {'key': 'properties.runType', '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]'}, + 'task': {'key': 'properties.task', 'type': 'str'}, + 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, + 'source_trigger': {'key': 'properties.sourceTrigger', 'type': 'SourceTriggerDescriptor'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'source_registry_auth': {'key': 'properties.sourceRegistryAuth', 'type': 'str'}, + 'custom_registries': {'key': 'properties.customRegistries', 'type': '[str]'}, + 'run_error_message': {'key': 'properties.runErrorMessage', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, + } + + def __init__(self, *, run_id: str=None, status=None, last_updated_time=None, run_type=None, create_time=None, start_time=None, finish_time=None, output_images=None, task: str=None, image_update_trigger=None, source_trigger=None, platform=None, agent_configuration=None, source_registry_auth: str=None, custom_registries=None, provisioning_state=None, is_archive_enabled: bool=False, **kwargs) -> None: + super(Run, self).__init__(**kwargs) + self.run_id = run_id + self.status = status + self.last_updated_time = last_updated_time + self.run_type = run_type + self.create_time = create_time + self.start_time = start_time + self.finish_time = finish_time + self.output_images = output_images + self.task = task + self.image_update_trigger = image_update_trigger + self.source_trigger = source_trigger + self.platform = platform + self.agent_configuration = agent_configuration + self.source_registry_auth = source_registry_auth + self.custom_registries = custom_registries + self.run_error_message = None + self.provisioning_state = provisioning_state + self.is_archive_enabled = is_archive_enabled + + +class RunFilter(Model): + """Properties that are enabled for Odata querying on runs. + + :param run_id: The unique identifier for the run. + :type run_id: str + :param run_type: The type of run. Possible values include: 'QuickBuild', + 'QuickRun', 'AutoBuild', 'AutoRun' + :type run_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.RunType + :param status: The current status of the run. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.RunStatus + :param create_time: The create time for a run. + :type create_time: datetime + :param finish_time: The time the run finished. + :type finish_time: datetime + :param output_image_manifests: The list of comma-separated image manifests + that were generated from the run. This is applicable if the run is of + build type. + :type output_image_manifests: str + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. + :type is_archive_enabled: bool + :param task_name: The name of the task that the run corresponds to. + :type task_name: str + """ + + _attribute_map = { + 'run_id': {'key': 'runId', 'type': 'str'}, + 'run_type': {'key': 'runType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + } + + def __init__(self, *, run_id: str=None, run_type=None, status=None, create_time=None, finish_time=None, output_image_manifests: str=None, is_archive_enabled: bool=None, task_name: str=None, **kwargs) -> None: + super(RunFilter, self).__init__(**kwargs) + self.run_id = run_id + self.run_type = run_type + self.status = status + self.create_time = create_time + self.finish_time = finish_time + self.output_image_manifests = output_image_manifests + self.is_archive_enabled = is_archive_enabled + self.task_name = task_name + + +class RunGetLogResult(Model): + """The result of get log link operation. + + :param log_link: The link to logs for a run on a azure container registry. + :type log_link: str + """ + + _attribute_map = { + 'log_link': {'key': 'logLink', 'type': 'str'}, + } + + def __init__(self, *, log_link: str=None, **kwargs) -> None: + super(RunGetLogResult, self).__init__(**kwargs) + self.log_link = log_link + + +class RunUpdateParameters(Model): + """The set of run 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(RunUpdateParameters, self).__init__(**kwargs) + self.is_archive_enabled = is_archive_enabled + + +class SecretObject(Model): + """Describes the properties of a secret object value. + + :param value: The value of the secret. The format of this value will be + determined + based on the type of the secret object. If the type is Opaque, the value + will be + used as is without any modification. + :type value: str + :param type: The type of the secret object which determines how the value + of the secret object has to be + interpreted. Possible values include: 'Opaque' + :type type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.SecretObjectType + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, type=None, **kwargs) -> None: + super(SecretObject, self).__init__(**kwargs) + self.value = value + self.type = type + + +class SetValue(Model): + """The properties of a overridable value that can be passed to a task + template. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the overridable value. + :type name: str + :param value: Required. The overridable value. + :type value: str + :param is_secret: Flag to indicate whether the value represents a secret + or not. Default value: False . + :type is_secret: bool + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: + super(SetValue, self).__init__(**kwargs) + self.name = name + self.value = value + self.is_secret = is_secret + + +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_09_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.v2018_09_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 + + +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 + + +class SourceProperties(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_09_01.models.SourceControlType + :param repository_url: Required. The full URL to the source code + repository + :type repository_url: str + :param branch: The branch name of the source code. + :type branch: str + :param source_control_auth_properties: The authorization properties for + accessing the source code repository and to set up + webhooks for notifications. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2018_09_01.models.AuthInfo + """ + + _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'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfo'}, + } + + def __init__(self, *, source_control_type, repository_url: str, branch: str=None, source_control_auth_properties=None, **kwargs) -> None: + super(SourceProperties, self).__init__(**kwargs) + self.source_control_type = source_control_type + self.repository_url = repository_url + self.branch = branch + self.source_control_auth_properties = source_control_auth_properties + + +class SourceRegistryCredentials(Model): + """Describes the credential parameters for accessing the source registry. + + :param login_mode: The authentication mode which determines the source + registry login scope. The credentials for the source registry + will be generated using the given scope. These credentials will be used to + login to + the source registry during the run. Possible values include: 'None', + 'Default' + :type login_mode: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceRegistryLoginMode + """ + + _attribute_map = { + 'login_mode': {'key': 'loginMode', 'type': 'str'}, + } + + def __init__(self, *, login_mode=None, **kwargs) -> None: + super(SourceRegistryCredentials, self).__init__(**kwargs) + self.login_mode = login_mode + + +class SourceTrigger(Model): + """The properties of a source based trigger. + + All required parameters must be populated in order to send to Azure. + + :param source_repository: Required. The properties that describes the + source(code) for the task. + :type source_repository: + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceProperties + :param source_trigger_events: Required. The source event corresponding to + the trigger. + :type source_trigger_events: list[str or + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerEvent] + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'source_repository': {'required': True}, + 'source_trigger_events': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'source_repository': {'key': 'sourceRepository', 'type': 'SourceProperties'}, + 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, source_repository, source_trigger_events, name: str, status="Enabled", **kwargs) -> None: + super(SourceTrigger, self).__init__(**kwargs) + self.source_repository = source_repository + self.source_trigger_events = source_trigger_events + self.status = status + self.name = name + + +class SourceTriggerDescriptor(Model): + """The source trigger that caused a run. + + :param id: The unique ID of the trigger. + :type id: str + :param event_type: The event type of the trigger. + :type event_type: str + :param commit_id: The unique ID that identifies a commit. + :type commit_id: str + :param pull_request_id: The unique ID that identifies pull request. + :type pull_request_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'}, + 'event_type': {'key': 'eventType', 'type': 'str'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'pull_request_id': {'key': 'pullRequestId', '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, event_type: str=None, commit_id: str=None, pull_request_id: str=None, repository_url: str=None, branch_name: str=None, provider_type: str=None, **kwargs) -> None: + super(SourceTriggerDescriptor, self).__init__(**kwargs) + self.id = id + self.event_type = event_type + self.commit_id = commit_id + self.pull_request_id = pull_request_id + self.repository_url = repository_url + self.branch_name = branch_name + self.provider_type = provider_type + + +class SourceTriggerUpdateParameters(Model): + """The properties for updating a source based trigger. + + All required parameters must be populated in order to send to Azure. + + :param source_repository: The properties that describes the source(code) + for the task. + :type source_repository: + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceUpdateParameters + :param source_trigger_events: The source event corresponding to the + trigger. + :type source_trigger_events: list[str or + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerEvent] + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'source_repository': {'key': 'sourceRepository', 'type': 'SourceUpdateParameters'}, + 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, source_repository=None, source_trigger_events=None, status="Enabled", **kwargs) -> None: + super(SourceTriggerUpdateParameters, self).__init__(**kwargs) + self.source_repository = source_repository + self.source_trigger_events = source_trigger_events + self.status = status + self.name = name + + +class SourceUpdateParameters(Model): + """The properties for updating the source code repository. + + :param source_control_type: The type of source control service. Possible + values include: 'Github', 'VisualStudioTeamService' + :type source_control_type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.SourceControlType + :param repository_url: The full URL to the source code repository + :type repository_url: str + :param branch: The branch name of the source code. + :type branch: str + :param source_control_auth_properties: The authorization properties for + accessing the source code repository and to set up + webhooks for notifications. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2018_09_01.models.AuthInfoUpdateParameters + """ + + _attribute_map = { + 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, + 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfoUpdateParameters'}, + } + + def __init__(self, *, source_control_type=None, repository_url: str=None, branch: str=None, source_control_auth_properties=None, **kwargs) -> None: + super(SourceUpdateParameters, self).__init__(**kwargs) + self.source_control_type = source_control_type + self.repository_url = repository_url + self.branch = branch + self.source_control_auth_properties = source_control_auth_properties + + +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 + + +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 + + +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 + + +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 + :param name: The name of the artifact. + :type name: str + :param version: The version of the artifact. + :type version: 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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', '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, name: str=None, version: 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 + self.name = name + self.version = version + + +class Task(Resource): + """The task that has the ARM resource and task properties. + The task will have all information to schedule a run 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 task. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.ProvisioningState + :ivar creation_date: The creation date of task. + :vartype creation_date: datetime + :param status: The current status of task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStatus + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param step: Required. The properties of a task step. + :type step: + ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStepProperties + :param trigger: The properties that describe all triggers for the task. + :type trigger: + ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerProperties + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'platform': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'step': {'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}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, + 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, + 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, + } + + def __init__(self, *, location: str, platform, step, tags=None, status=None, agent_configuration=None, timeout: int=3600, trigger=None, credentials=None, **kwargs) -> None: + super(Task, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.creation_date = None + self.status = status + self.platform = platform + self.agent_configuration = agent_configuration + self.timeout = timeout + self.step = step + self.trigger = trigger + self.credentials = credentials + + +class TaskRunRequest(RunRequest): + """The parameters for a task run request. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param task_name: Required. The name of task against which run has to be + queued. + :type task_name: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + 'task_name': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, task_name: str, is_archive_enabled: bool=False, values=None, **kwargs) -> None: + super(TaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + self.task_name = task_name + self.values = values + self.type = 'TaskRunRequest' + + +class TaskUpdateParameters(Model): + """The parameters for updating a task. + + :param status: The current status of task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStatus + :param platform: The platform properties against which the run has to + happen. + :type platform: + ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformUpdateParameters + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties + :param timeout: Run timeout in seconds. + :type timeout: int + :param step: The properties for updating a task step. + :type step: + ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStepUpdateParameters + :param trigger: The properties for updating trigger properties. + :type trigger: + ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerUpdateParameters + :param credentials: The parameters that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, + 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, + 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, status=None, platform=None, agent_configuration=None, timeout: int=None, step=None, trigger=None, credentials=None, tags=None, **kwargs) -> None: + super(TaskUpdateParameters, self).__init__(**kwargs) + self.status = status + self.platform = platform + self.agent_configuration = agent_configuration + self.timeout = timeout + self.step = step + self.trigger = trigger + self.credentials = credentials + self.tags = tags + + +class TriggerProperties(Model): + """The properties of a trigger. + + :param source_triggers: The collection of triggers based on source code + repository. + :type source_triggers: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SourceTrigger] + :param base_image_trigger: The trigger based on base image dependencies. + :type base_image_trigger: + ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTrigger + """ + + _attribute_map = { + 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTrigger]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTrigger'}, + } + + def __init__(self, *, source_triggers=None, base_image_trigger=None, **kwargs) -> None: + super(TriggerProperties, self).__init__(**kwargs) + self.source_triggers = source_triggers + self.base_image_trigger = base_image_trigger + + +class TriggerUpdateParameters(Model): + """The properties for updating triggers. + + :param source_triggers: The collection of triggers based on source code + repository. + :type source_triggers: + list[~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerUpdateParameters] + :param base_image_trigger: The trigger based on base image dependencies. + :type base_image_trigger: + ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTriggerUpdateParameters + """ + + _attribute_map = { + 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTriggerUpdateParameters]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTriggerUpdateParameters'}, + } + + def __init__(self, *, source_triggers=None, base_image_trigger=None, **kwargs) -> None: + super(TriggerUpdateParameters, self).__init__(**kwargs) + self.source_triggers = source_triggers + self.base_image_trigger = base_image_trigger + + +class TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, type=None, status=None, **kwargs) -> None: + super(TrustPolicy, self).__init__(**kwargs) + self.type = type + self.status = status + + +class VirtualNetworkRule(Model): + """Virtual network rule. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2018_09_01.models.Action + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.action = action + self.virtual_network_resource_id = virtual_network_resource_id + + +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_09_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.v2018_09_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.v2018_09_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 + + +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_09_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.v2018_09_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 + + +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_09_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.v2018_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/_paged_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/_paged_models.py new file mode 100644 index 000000000000..3bd603a1b4f3 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/_paged_models.py @@ -0,0 +1,105 @@ +# 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) +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) +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) +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) +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) +class RunPaged(Paged): + """ + A paging container for iterating over a list of :class:`Run ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Run]'} + } + + def __init__(self, *args, **kwargs): + + super(RunPaged, self).__init__(*args, **kwargs) +class TaskPaged(Paged): + """ + A paging container for iterating over a list of :class:`Task ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Task]'} + } + + def __init__(self, *args, **kwargs): + + super(TaskPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/actor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/actor.py deleted file mode 100644 index a662f9008a31..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/actor.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/actor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/actor_py3.py deleted file mode 100644 index fdd8b96dda52..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/actor_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/agent_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/agent_properties.py deleted file mode 100644 index c002042a921b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/agent_properties.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 AgentProperties(Model): - """The properties that determine the run agent configuration. - - :param cpu: The CPU configuration in terms of number of cores required for - the run. - :type cpu: int - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(AgentProperties, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/agent_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/agent_properties_py3.py deleted file mode 100644 index 055a36946db8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/agent_properties_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 AgentProperties(Model): - """The properties that determine the run agent configuration. - - :param cpu: The CPU configuration in terms of number of cores required for - the run. - :type cpu: int - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'int'}, - } - - def __init__(self, *, cpu: int=None, **kwargs) -> None: - super(AgentProperties, self).__init__(**kwargs) - self.cpu = cpu diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/argument.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/argument.py deleted file mode 100644 index d081a86245b0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/argument.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 Argument(Model): - """The properties of a run argument. - - All required parameters must be populated in order to send to Azure. - - :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 = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(Argument, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/argument_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/argument_py3.py deleted file mode 100644 index 1f520368d006..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/argument_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 Argument(Model): - """The properties of a run argument. - - All required parameters must be populated in order to send to Azure. - - :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 = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - } - - def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: - super(Argument, self).__init__(**kwargs) - self.name = name - self.value = value - self.is_secret = is_secret diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/auth_info.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/auth_info.py deleted file mode 100644 index cdba1a96d363..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/auth_info.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 AuthInfo(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: Required. The type of Auth token. Possible values - include: 'PAT', 'OAuth' - :type token_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.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_type': {'required': True}, - '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(AuthInfo, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/auth_info_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/auth_info_py3.py deleted file mode 100644 index cb0ae645585d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/auth_info_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 AuthInfo(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: Required. The type of Auth token. Possible values - include: 'PAT', 'OAuth' - :type token_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.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_type': {'required': True}, - '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_type, token: str, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: - super(AuthInfo, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/auth_info_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/auth_info_update_parameters.py deleted file mode 100644 index 5af5cdd4de54..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/auth_info_update_parameters.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 AuthInfoUpdateParameters(Model): - """The authorization properties for accessing the source code repository. - - :param token_type: The type of Auth token. Possible values include: 'PAT', - 'OAuth' - :type token_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TokenType - :param token: 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 - """ - - _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(AuthInfoUpdateParameters, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/auth_info_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/auth_info_update_parameters_py3.py deleted file mode 100644 index 1c938ff2c7e1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/auth_info_update_parameters_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 AuthInfoUpdateParameters(Model): - """The authorization properties for accessing the source code repository. - - :param token_type: The type of Auth token. Possible values include: 'PAT', - 'OAuth' - :type token_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TokenType - :param token: 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 - """ - - _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_type=None, token: str=None, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: - super(AuthInfoUpdateParameters, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_dependency.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_dependency.py deleted file mode 100644 index 9591b5f9c6c6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_dependency.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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_09_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_dependency_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_dependency_py3.py deleted file mode 100644 index d603b0047521..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_dependency_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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_09_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_trigger.py deleted file mode 100644 index a113979fdac9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_trigger.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 BaseImageTrigger(Model): - """The trigger based on base image dependency. - - All required parameters must be populated in order to send to Azure. - - :param base_image_trigger_type: Required. The type of the auto trigger for - base image dependency updates. Possible values include: 'All', 'Runtime' - :type base_image_trigger_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTriggerType - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'base_image_trigger_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(BaseImageTrigger, self).__init__(**kwargs) - self.base_image_trigger_type = kwargs.get('base_image_trigger_type', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_trigger_py3.py deleted file mode 100644 index 11c524a150a9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_trigger_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 BaseImageTrigger(Model): - """The trigger based on base image dependency. - - All required parameters must be populated in order to send to Azure. - - :param base_image_trigger_type: Required. The type of the auto trigger for - base image dependency updates. Possible values include: 'All', 'Runtime' - :type base_image_trigger_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTriggerType - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'base_image_trigger_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, base_image_trigger_type, name: str, status="Enabled", **kwargs) -> None: - super(BaseImageTrigger, self).__init__(**kwargs) - self.base_image_trigger_type = base_image_trigger_type - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_trigger_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_trigger_update_parameters.py deleted file mode 100644 index 52af604184ca..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_trigger_update_parameters.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 BaseImageTriggerUpdateParameters(Model): - """The properties for updating base image dependency trigger. - - All required parameters must be populated in order to send to Azure. - - :param base_image_trigger_type: The type of the auto trigger for base - image dependency updates. Possible values include: 'All', 'Runtime' - :type base_image_trigger_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTriggerType - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(BaseImageTriggerUpdateParameters, self).__init__(**kwargs) - self.base_image_trigger_type = kwargs.get('base_image_trigger_type', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_trigger_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_trigger_update_parameters_py3.py deleted file mode 100644 index fcd6ac260be0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/base_image_trigger_update_parameters_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 BaseImageTriggerUpdateParameters(Model): - """The properties for updating base image dependency trigger. - - All required parameters must be populated in order to send to Azure. - - :param base_image_trigger_type: The type of the auto trigger for base - image dependency updates. Possible values include: 'All', 'Runtime' - :type base_image_trigger_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTriggerType - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str, base_image_trigger_type=None, status="Enabled", **kwargs) -> None: - super(BaseImageTriggerUpdateParameters, self).__init__(**kwargs) - self.base_image_trigger_type = base_image_trigger_type - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/callback_config.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/callback_config.py deleted file mode 100644 index 8ad43a9f785a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/callback_config.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/callback_config_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/callback_config_py3.py deleted file mode 100644 index 27ffc7825431..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/callback_config_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/credentials.py deleted file mode 100644 index 9fe2fe6fef42..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/credentials.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 Credentials(Model): - """The parameters that describes a set of credentials that will be used when a - run is invoked. - - :param source_registry: Describes the credential parameters for accessing - the source registry. - :type source_registry: - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceRegistryCredentials - :param custom_registries: Describes the credential parameters for - accessing other custom registries. The key - for the dictionary item will be the registry login server - (myregistry.azurecr.io) and - the value of the item will be the registry credentials for accessing the - registry. - :type custom_registries: dict[str, - ~azure.mgmt.containerregistry.v2018_09_01.models.CustomRegistryCredentials] - """ - - _attribute_map = { - 'source_registry': {'key': 'sourceRegistry', 'type': 'SourceRegistryCredentials'}, - 'custom_registries': {'key': 'customRegistries', 'type': '{CustomRegistryCredentials}'}, - } - - def __init__(self, **kwargs): - super(Credentials, self).__init__(**kwargs) - self.source_registry = kwargs.get('source_registry', None) - self.custom_registries = kwargs.get('custom_registries', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/credentials_py3.py deleted file mode 100644 index c656141f74fa..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/credentials_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 Credentials(Model): - """The parameters that describes a set of credentials that will be used when a - run is invoked. - - :param source_registry: Describes the credential parameters for accessing - the source registry. - :type source_registry: - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceRegistryCredentials - :param custom_registries: Describes the credential parameters for - accessing other custom registries. The key - for the dictionary item will be the registry login server - (myregistry.azurecr.io) and - the value of the item will be the registry credentials for accessing the - registry. - :type custom_registries: dict[str, - ~azure.mgmt.containerregistry.v2018_09_01.models.CustomRegistryCredentials] - """ - - _attribute_map = { - 'source_registry': {'key': 'sourceRegistry', 'type': 'SourceRegistryCredentials'}, - 'custom_registries': {'key': 'customRegistries', 'type': '{CustomRegistryCredentials}'}, - } - - def __init__(self, *, source_registry=None, custom_registries=None, **kwargs) -> None: - super(Credentials, self).__init__(**kwargs) - self.source_registry = source_registry - self.custom_registries = custom_registries diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/custom_registry_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/custom_registry_credentials.py deleted file mode 100644 index eb3301e5cecc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/custom_registry_credentials.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 CustomRegistryCredentials(Model): - """Describes the credentials that will be used to access a custom registry - during a run. - - :param user_name: The username for logging into the custom registry. - :type user_name: - ~azure.mgmt.containerregistry.v2018_09_01.models.SecretObject - :param password: The password for logging into the custom registry. The - password is a secret - object that allows multiple ways of providing the value for it. - :type password: - ~azure.mgmt.containerregistry.v2018_09_01.models.SecretObject - """ - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'SecretObject'}, - 'password': {'key': 'password', 'type': 'SecretObject'}, - } - - def __init__(self, **kwargs): - super(CustomRegistryCredentials, self).__init__(**kwargs) - self.user_name = kwargs.get('user_name', None) - self.password = kwargs.get('password', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/custom_registry_credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/custom_registry_credentials_py3.py deleted file mode 100644 index b89a959d7869..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/custom_registry_credentials_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 CustomRegistryCredentials(Model): - """Describes the credentials that will be used to access a custom registry - during a run. - - :param user_name: The username for logging into the custom registry. - :type user_name: - ~azure.mgmt.containerregistry.v2018_09_01.models.SecretObject - :param password: The password for logging into the custom registry. The - password is a secret - object that allows multiple ways of providing the value for it. - :type password: - ~azure.mgmt.containerregistry.v2018_09_01.models.SecretObject - """ - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'SecretObject'}, - 'password': {'key': 'password', 'type': 'SecretObject'}, - } - - def __init__(self, *, user_name=None, password=None, **kwargs) -> None: - super(CustomRegistryCredentials, self).__init__(**kwargs) - self.user_name = user_name - self.password = password diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_request.py deleted file mode 100644 index 46bceb4b8c3e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_request.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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 .run_request import RunRequest - - -class DockerBuildRequest(RunRequest): - """The parameters for a docker quick build. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :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 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: Required. The Docker file path relative to the - source location. - :type docker_file_path: str - :param target: The name of the target build stage for the docker build. - :type target: str - :param arguments: The collection of override arguments to be used when - executing the run. - :type arguments: - list[~azure.mgmt.containerregistry.v2018_09_01.models.Argument] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'docker_file_path': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', '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'}, - 'target': {'key': 'target', 'type': 'str'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, **kwargs): - super(DockerBuildRequest, self).__init__(**kwargs) - 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.target = kwargs.get('target', None) - self.arguments = kwargs.get('arguments', None) - self.timeout = kwargs.get('timeout', 3600) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.source_location = kwargs.get('source_location', None) - self.credentials = kwargs.get('credentials', None) - self.type = 'DockerBuildRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_request_py3.py deleted file mode 100644 index 713fd4e39935..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_request_py3.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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 .run_request_py3 import RunRequest - - -class DockerBuildRequest(RunRequest): - """The parameters for a docker quick build. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :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 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: Required. The Docker file path relative to the - source location. - :type docker_file_path: str - :param target: The name of the target build stage for the docker build. - :type target: str - :param arguments: The collection of override arguments to be used when - executing the run. - :type arguments: - list[~azure.mgmt.containerregistry.v2018_09_01.models.Argument] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'docker_file_path': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', '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'}, - 'target': {'key': 'target', 'type': 'str'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, *, docker_file_path: str, platform, is_archive_enabled: bool=False, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(DockerBuildRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) - 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.target = target - self.arguments = arguments - self.timeout = timeout - self.platform = platform - self.agent_configuration = agent_configuration - self.source_location = source_location - self.credentials = credentials - self.type = 'DockerBuildRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_step.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_step.py deleted file mode 100644 index c5c73ec9a94a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_step.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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 .task_step_properties import TaskStepProperties - - -class DockerBuildStep(TaskStepProperties): - """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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :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 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: Required. The Docker file path relative to the - source context. - :type docker_file_path: str - :param target: The name of the target build stage for the docker build. - :type target: str - :param arguments: The collection of override arguments to be used when - executing this build step. - :type arguments: - list[~azure.mgmt.containerregistry.v2018_09_01.models.Argument] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'docker_file_path': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', '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'}, - 'target': {'key': 'target', 'type': 'str'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - } - - def __init__(self, **kwargs): - super(DockerBuildStep, self).__init__(**kwargs) - 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.target = kwargs.get('target', None) - self.arguments = kwargs.get('arguments', None) - self.type = 'Docker' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_step_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_step_py3.py deleted file mode 100644 index d2e26ec8683e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_step_py3.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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 .task_step_properties_py3 import TaskStepProperties - - -class DockerBuildStep(TaskStepProperties): - """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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :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 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: Required. The Docker file path relative to the - source context. - :type docker_file_path: str - :param target: The name of the target build stage for the docker build. - :type target: str - :param arguments: The collection of override arguments to be used when - executing this build step. - :type arguments: - list[~azure.mgmt.containerregistry.v2018_09_01.models.Argument] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'docker_file_path': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', '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'}, - 'target': {'key': 'target', 'type': 'str'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - } - - def __init__(self, *, docker_file_path: str, context_path: str=None, context_access_token: str=None, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, **kwargs) -> None: - super(DockerBuildStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - 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.target = target - self.arguments = arguments - self.type = 'Docker' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_step_update_parameters.py deleted file mode 100644 index 322d2c385c1b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_step_update_parameters.py +++ /dev/null @@ -1,72 +0,0 @@ -# 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 .task_step_update_parameters import TaskStepUpdateParameters - - -class DockerBuildStepUpdateParameters(TaskStepUpdateParameters): - """The properties for updating a docker build step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :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 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 - context. - :type docker_file_path: str - :param arguments: The collection of override arguments to be used when - executing this build step. - :type arguments: - list[~azure.mgmt.containerregistry.v2018_09_01.models.Argument] - :param target: The name of the target build stage for the docker build. - :type target: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', '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'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DockerBuildStepUpdateParameters, self).__init__(**kwargs) - 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.arguments = kwargs.get('arguments', None) - self.target = kwargs.get('target', None) - self.type = 'Docker' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_step_update_parameters_py3.py deleted file mode 100644 index 751fc564e35b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/docker_build_step_update_parameters_py3.py +++ /dev/null @@ -1,72 +0,0 @@ -# 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 .task_step_update_parameters_py3 import TaskStepUpdateParameters - - -class DockerBuildStepUpdateParameters(TaskStepUpdateParameters): - """The properties for updating a docker build step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :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 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 - context. - :type docker_file_path: str - :param arguments: The collection of override arguments to be used when - executing this build step. - :type arguments: - list[~azure.mgmt.containerregistry.v2018_09_01.models.Argument] - :param target: The name of the target build stage for the docker build. - :type target: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', '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'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, image_names=None, is_push_enabled: bool=None, no_cache: bool=None, docker_file_path: str=None, arguments=None, target: str=None, **kwargs) -> None: - super(DockerBuildStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - 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.arguments = arguments - self.target = target - self.type = 'Docker' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_run_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_run_request.py deleted file mode 100644 index a338a86c55af..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_run_request.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 .run_request import RunRequest - - -class EncodedTaskRunRequest(RunRequest): - """The parameters for a quick task run request. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Required. Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'encoded_task_content': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, **kwargs): - super(EncodedTaskRunRequest, self).__init__(**kwargs) - self.encoded_task_content = kwargs.get('encoded_task_content', None) - self.encoded_values_content = kwargs.get('encoded_values_content', None) - self.values = kwargs.get('values', None) - self.timeout = kwargs.get('timeout', 3600) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.source_location = kwargs.get('source_location', None) - self.credentials = kwargs.get('credentials', None) - self.type = 'EncodedTaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_run_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_run_request_py3.py deleted file mode 100644 index 192052a9b076..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_run_request_py3.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 .run_request_py3 import RunRequest - - -class EncodedTaskRunRequest(RunRequest): - """The parameters for a quick task run request. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Required. Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'encoded_task_content': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, *, encoded_task_content: str, platform, is_archive_enabled: bool=False, encoded_values_content: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(EncodedTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) - self.encoded_task_content = encoded_task_content - self.encoded_values_content = encoded_values_content - self.values = values - self.timeout = timeout - self.platform = platform - self.agent_configuration = agent_configuration - self.source_location = source_location - self.credentials = credentials - self.type = 'EncodedTaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_step.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_step.py deleted file mode 100644 index ff458e122904..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_step.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .task_step_properties import TaskStepProperties - - -class EncodedTaskStep(TaskStepProperties): - """The properties of a encoded task 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Required. Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'encoded_task_content': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(EncodedTaskStep, self).__init__(**kwargs) - self.encoded_task_content = kwargs.get('encoded_task_content', None) - self.encoded_values_content = kwargs.get('encoded_values_content', None) - self.values = kwargs.get('values', None) - self.type = 'EncodedTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_step_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_step_py3.py deleted file mode 100644 index a13cd3a9ced8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_step_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .task_step_properties_py3 import TaskStepProperties - - -class EncodedTaskStep(TaskStepProperties): - """The properties of a encoded task 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Required. Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'encoded_task_content': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, encoded_task_content: str, context_path: str=None, context_access_token: str=None, encoded_values_content: str=None, values=None, **kwargs) -> None: - super(EncodedTaskStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - self.encoded_task_content = encoded_task_content - self.encoded_values_content = encoded_values_content - self.values = values - self.type = 'EncodedTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_step_update_parameters.py deleted file mode 100644 index 379d3681659c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_step_update_parameters.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 .task_step_update_parameters import TaskStepUpdateParameters - - -class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters): - """The properties for updating encoded task step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(EncodedTaskStepUpdateParameters, self).__init__(**kwargs) - self.encoded_task_content = kwargs.get('encoded_task_content', None) - self.encoded_values_content = kwargs.get('encoded_values_content', None) - self.values = kwargs.get('values', None) - self.type = 'EncodedTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_step_update_parameters_py3.py deleted file mode 100644 index 7551f52c4347..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/encoded_task_step_update_parameters_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 .task_step_update_parameters_py3 import TaskStepUpdateParameters - - -class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters): - """The properties for updating encoded task step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, encoded_task_content: str=None, encoded_values_content: str=None, values=None, **kwargs) -> None: - super(EncodedTaskStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - self.encoded_task_content = encoded_task_content - self.encoded_values_content = encoded_values_content - self.values = values - self.type = 'EncodedTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event.py deleted file mode 100644 index 9894bf03331b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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_09_01.models.EventRequestMessage - :param event_response_message: The event response message received from - the service URI. - :type event_response_message: - ~azure.mgmt.containerregistry.v2018_09_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_content.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_content.py deleted file mode 100644 index 1585c43a8dfd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_content.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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_09_01.models.Target - :param request: The request that generated the event. - :type request: ~azure.mgmt.containerregistry.v2018_09_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.v2018_09_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.v2018_09_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_content_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_content_py3.py deleted file mode 100644 index 36c725a24f05..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_content_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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_09_01.models.Target - :param request: The request that generated the event. - :type request: ~azure.mgmt.containerregistry.v2018_09_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.v2018_09_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.v2018_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_info.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_info.py deleted file mode 100644 index 7199044b2e39..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_info.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_info_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_info_py3.py deleted file mode 100644 index 192990067407..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_info_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_paged.py deleted file mode 100644 index c185ea7b023b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_py3.py deleted file mode 100644 index e28e63f22ed2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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_py3 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_09_01.models.EventRequestMessage - :param event_response_message: The event response message received from - the service URI. - :type event_response_message: - ~azure.mgmt.containerregistry.v2018_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_request_message.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_request_message.py deleted file mode 100644 index 2f8feb93426f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_request_message.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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_09_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_request_message_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_request_message_py3.py deleted file mode 100644 index d954d9085355..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_request_message_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_response_message.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_response_message.py deleted file mode 100644 index ffb8feb12a1e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_response_message.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_response_message_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_response_message_py3.py deleted file mode 100644 index 4b1351377b4b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/event_response_message_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_run_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_run_request.py deleted file mode 100644 index 5204b59f1909..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_run_request.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 .run_request import RunRequest - - -class FileTaskRunRequest(RunRequest): - """The request parameters for a scheduling run against a task file. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: Required. The template/definition file path - relative to the source. - :type task_file_path: str - :param values_file_path: The values/parameters file path relative to the - source. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'task_file_path': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, **kwargs): - super(FileTaskRunRequest, self).__init__(**kwargs) - self.task_file_path = kwargs.get('task_file_path', None) - self.values_file_path = kwargs.get('values_file_path', None) - self.values = kwargs.get('values', None) - self.timeout = kwargs.get('timeout', 3600) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.source_location = kwargs.get('source_location', None) - self.credentials = kwargs.get('credentials', None) - self.type = 'FileTaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_run_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_run_request_py3.py deleted file mode 100644 index 6982222ae802..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_run_request_py3.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 .run_request_py3 import RunRequest - - -class FileTaskRunRequest(RunRequest): - """The request parameters for a scheduling run against a task file. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: Required. The template/definition file path - relative to the source. - :type task_file_path: str - :param values_file_path: The values/parameters file path relative to the - source. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'task_file_path': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, *, task_file_path: str, platform, is_archive_enabled: bool=False, values_file_path: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(FileTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) - self.task_file_path = task_file_path - self.values_file_path = values_file_path - self.values = values - self.timeout = timeout - self.platform = platform - self.agent_configuration = agent_configuration - self.source_location = source_location - self.credentials = credentials - self.type = 'FileTaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_step.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_step.py deleted file mode 100644 index 6070a401dd60..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_step.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .task_step_properties import TaskStepProperties - - -class FileTaskStep(TaskStepProperties): - """The properties of a task 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: Required. The task template/definition file path - relative to the source context. - :type task_file_path: str - :param values_file_path: The task values/parameters file path relative to - the source context. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'task_file_path': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(FileTaskStep, self).__init__(**kwargs) - self.task_file_path = kwargs.get('task_file_path', None) - self.values_file_path = kwargs.get('values_file_path', None) - self.values = kwargs.get('values', None) - self.type = 'FileTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_step_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_step_py3.py deleted file mode 100644 index 9d435e19b2c2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_step_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .task_step_properties_py3 import TaskStepProperties - - -class FileTaskStep(TaskStepProperties): - """The properties of a task 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: Required. The task template/definition file path - relative to the source context. - :type task_file_path: str - :param values_file_path: The task values/parameters file path relative to - the source context. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'task_file_path': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, task_file_path: str, context_path: str=None, context_access_token: str=None, values_file_path: str=None, values=None, **kwargs) -> None: - super(FileTaskStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - self.task_file_path = task_file_path - self.values_file_path = values_file_path - self.values = values - self.type = 'FileTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_step_update_parameters.py deleted file mode 100644 index 2c4a570a6953..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_step_update_parameters.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 .task_step_update_parameters import TaskStepUpdateParameters - - -class FileTaskStepUpdateParameters(TaskStepUpdateParameters): - """The properties of updating a task step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: The task template/definition file path relative to - the source context. - :type task_file_path: str - :param values_file_path: The values/parameters file path relative to the - source context. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(FileTaskStepUpdateParameters, self).__init__(**kwargs) - self.task_file_path = kwargs.get('task_file_path', None) - self.values_file_path = kwargs.get('values_file_path', None) - self.values = kwargs.get('values', None) - self.type = 'FileTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_step_update_parameters_py3.py deleted file mode 100644 index 663cf20966f1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/file_task_step_update_parameters_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 .task_step_update_parameters_py3 import TaskStepUpdateParameters - - -class FileTaskStepUpdateParameters(TaskStepUpdateParameters): - """The properties of updating a task step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: The task template/definition file path relative to - the source context. - :type task_file_path: str - :param values_file_path: The values/parameters file path relative to the - source context. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, task_file_path: str=None, values_file_path: str=None, values=None, **kwargs) -> None: - super(FileTaskStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - self.task_file_path = task_file_path - self.values_file_path = values_file_path - self.values = values - self.type = 'FileTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/image_descriptor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/image_descriptor.py deleted file mode 100644 index 1cfd03ed778c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/image_descriptor.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/image_descriptor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/image_descriptor_py3.py deleted file mode 100644 index 72928cf47326..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/image_descriptor_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/image_update_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/image_update_trigger.py deleted file mode 100644 index 4203ee9e26f6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/image_update_trigger.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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_09_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/image_update_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/image_update_trigger_py3.py deleted file mode 100644 index 64c62ad9f07c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/image_update_trigger_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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_09_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_image_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_image_parameters.py deleted file mode 100644 index d82648d8e186..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_image_parameters.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportImageParameters(Model): - """ImportImageParameters. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. The source of the image. - :type source: - ~azure.mgmt.containerregistry.v2018_09_01.models.ImportSource - :param target_tags: List of strings of the form repo[:tag]. When tag is - omitted the source will be used (or 'latest' if source tag is also - omitted). - :type target_tags: list[str] - :param untagged_target_repositories: List of strings of repository names - to do a manifest only copy. No tag will be created. - :type untagged_target_repositories: list[str] - :param mode: When Force, any existing target tags will be overwritten. - When NoForce, any existing target tags will fail the operation before any - copying begins. Possible values include: 'NoForce', 'Force'. Default - value: "NoForce" . - :type mode: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.ImportMode - """ - - _validation = { - 'source': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ImportSource'}, - 'target_tags': {'key': 'targetTags', 'type': '[str]'}, - 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportImageParameters, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.target_tags = kwargs.get('target_tags', None) - self.untagged_target_repositories = kwargs.get('untagged_target_repositories', None) - self.mode = kwargs.get('mode', "NoForce") diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_image_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_image_parameters_py3.py deleted file mode 100644 index fe050e50b1e0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_image_parameters_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportImageParameters(Model): - """ImportImageParameters. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. The source of the image. - :type source: - ~azure.mgmt.containerregistry.v2018_09_01.models.ImportSource - :param target_tags: List of strings of the form repo[:tag]. When tag is - omitted the source will be used (or 'latest' if source tag is also - omitted). - :type target_tags: list[str] - :param untagged_target_repositories: List of strings of repository names - to do a manifest only copy. No tag will be created. - :type untagged_target_repositories: list[str] - :param mode: When Force, any existing target tags will be overwritten. - When NoForce, any existing target tags will fail the operation before any - copying begins. Possible values include: 'NoForce', 'Force'. Default - value: "NoForce" . - :type mode: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.ImportMode - """ - - _validation = { - 'source': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ImportSource'}, - 'target_tags': {'key': 'targetTags', 'type': '[str]'}, - 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__(self, *, source, target_tags=None, untagged_target_repositories=None, mode="NoForce", **kwargs) -> None: - super(ImportImageParameters, self).__init__(**kwargs) - self.source = source - self.target_tags = target_tags - self.untagged_target_repositories = untagged_target_repositories - self.mode = mode diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_source.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_source.py deleted file mode 100644 index 2fd0be86f756..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_source.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportSource(Model): - """ImportSource. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource identifier of the source Azure Container - Registry. - :type resource_id: str - :param registry_uri: The address of the source registry (e.g. - 'mcr.microsoft.com'). - :type registry_uri: str - :param credentials: Credentials used when importing from a registry uri. - :type credentials: - ~azure.mgmt.containerregistry.v2018_09_01.models.ImportSourceCredentials - :param source_image: Required. Repository name of the source image. - Specify an image by repository ('hello-world'). This will use the 'latest' - tag. - Specify an image by tag ('hello-world:latest'). - Specify an image by sha256-based manifest digest - ('hello-world@sha256:abc123'). - :type source_image: str - """ - - _validation = { - 'source_image': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'registry_uri': {'key': 'registryUri', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, - 'source_image': {'key': 'sourceImage', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportSource, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.registry_uri = kwargs.get('registry_uri', None) - self.credentials = kwargs.get('credentials', None) - self.source_image = kwargs.get('source_image', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_source_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_source_credentials.py deleted file mode 100644 index b31e5f7e8405..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_source_credentials.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ImportSourceCredentials(Model): - """ImportSourceCredentials. - - All required parameters must be populated in order to send to Azure. - - :param username: The username to authenticate with the source registry. - :type username: str - :param password: Required. The password used to authenticate with the - source registry. - :type password: str - """ - - _validation = { - 'password': {'required': True}, - } - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportSourceCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_source_credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_source_credentials_py3.py deleted file mode 100644 index 4a610e022f88..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_source_credentials_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ImportSourceCredentials(Model): - """ImportSourceCredentials. - - All required parameters must be populated in order to send to Azure. - - :param username: The username to authenticate with the source registry. - :type username: str - :param password: Required. The password used to authenticate with the - source registry. - :type password: str - """ - - _validation = { - 'password': {'required': True}, - } - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__(self, *, password: str, username: str=None, **kwargs) -> None: - super(ImportSourceCredentials, self).__init__(**kwargs) - self.username = username - self.password = password diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_source_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_source_py3.py deleted file mode 100644 index f6989749628d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/import_source_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportSource(Model): - """ImportSource. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource identifier of the source Azure Container - Registry. - :type resource_id: str - :param registry_uri: The address of the source registry (e.g. - 'mcr.microsoft.com'). - :type registry_uri: str - :param credentials: Credentials used when importing from a registry uri. - :type credentials: - ~azure.mgmt.containerregistry.v2018_09_01.models.ImportSourceCredentials - :param source_image: Required. Repository name of the source image. - Specify an image by repository ('hello-world'). This will use the 'latest' - tag. - Specify an image by tag ('hello-world:latest'). - Specify an image by sha256-based manifest digest - ('hello-world@sha256:abc123'). - :type source_image: str - """ - - _validation = { - 'source_image': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'registry_uri': {'key': 'registryUri', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, - 'source_image': {'key': 'sourceImage', 'type': 'str'}, - } - - def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None: - super(ImportSource, self).__init__(**kwargs) - self.resource_id = resource_id - self.registry_uri = registry_uri - self.credentials = credentials - self.source_image = source_image diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/ip_rule.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/ip_rule.py deleted file mode 100644 index e265dd281fca..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/ip_rule.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.Action - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.action = kwargs.get('action', "Allow") - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/ip_rule_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/ip_rule_py3.py deleted file mode 100644 index 57ffc077e0db..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/ip_rule_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.Action - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.action = action - self.ip_address_or_range = ip_address_or_range diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/network_rule_set.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/network_rule_set.py deleted file mode 100644 index 0de2d6dade98..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/network_rule_set.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 NetworkRuleSet(Model): - """The network rule set for a container registry. - - All required parameters must be populated in order to send to Azure. - - :param default_action: Required. The default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . - :type default_action: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.DefaultAction - :param virtual_network_rules: The virtual network rules. - :type virtual_network_rules: - list[~azure.mgmt.containerregistry.v2018_09_01.models.VirtualNetworkRule] - :param ip_rules: The IP ACL rules. - :type ip_rules: - list[~azure.mgmt.containerregistry.v2018_09_01.models.IPRule] - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.default_action = kwargs.get('default_action', "Allow") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/network_rule_set_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/network_rule_set_py3.py deleted file mode 100644 index e34860da74e7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/network_rule_set_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 NetworkRuleSet(Model): - """The network rule set for a container registry. - - All required parameters must be populated in order to send to Azure. - - :param default_action: Required. The default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . - :type default_action: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.DefaultAction - :param virtual_network_rules: The virtual network rules. - :type virtual_network_rules: - list[~azure.mgmt.containerregistry.v2018_09_01.models.VirtualNetworkRule] - :param ip_rules: The IP ACL rules. - :type ip_rules: - list[~azure.mgmt.containerregistry.v2018_09_01.models.IPRule] - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.default_action = default_action - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_definition.py deleted file mode 100644 index 76a26bc63300..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_definition.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 origin: The origin information of the container registry operation. - :type origin: str - :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_09_01.models.OperationDisplayDefinition - :param service_specification: The definition of Azure Monitoring service. - :type service_specification: - ~azure.mgmt.containerregistry.v2018_09_01.models.OperationServiceSpecificationDefinition - """ - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, - } - - def __init__(self, **kwargs): - super(OperationDefinition, self).__init__(**kwargs) - self.origin = kwargs.get('origin', None) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_definition_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_definition_paged.py deleted file mode 100644 index e22ddb00e48c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_definition_py3.py deleted file mode 100644 index a7539e326744..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_definition_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 origin: The origin information of the container registry operation. - :type origin: str - :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_09_01.models.OperationDisplayDefinition - :param service_specification: The definition of Azure Monitoring service. - :type service_specification: - ~azure.mgmt.containerregistry.v2018_09_01.models.OperationServiceSpecificationDefinition - """ - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, - } - - def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: - super(OperationDefinition, self).__init__(**kwargs) - self.origin = origin - self.name = name - self.display = display - self.service_specification = service_specification diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_display_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_display_definition.py deleted file mode 100644 index 6cb8463b21fc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_display_definition.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_display_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_display_definition_py3.py deleted file mode 100644 index 98abb699335c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_display_definition_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_metric_specification_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_metric_specification_definition.py deleted file mode 100644 index 8b40b3b4d6f1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_metric_specification_definition.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 OperationMetricSpecificationDefinition(Model): - """The definition of Azure Monitoring metric. - - :param name: Metric name. - :type name: str - :param display_name: Metric display name. - :type display_name: str - :param display_description: Metric description. - :type display_description: str - :param unit: Metric unit. - :type unit: str - :param aggregation_type: Metric aggregation type. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.internal_metric_name = kwargs.get('internal_metric_name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_metric_specification_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_metric_specification_definition_py3.py deleted file mode 100644 index db4f31c14a17..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_metric_specification_definition_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 OperationMetricSpecificationDefinition(Model): - """The definition of Azure Monitoring metric. - - :param name: Metric name. - :type name: str - :param display_name: Metric display name. - :type display_name: str - :param display_description: Metric description. - :type display_description: str - :param unit: Metric unit. - :type unit: str - :param aggregation_type: Metric aggregation type. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: - super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.internal_metric_name = internal_metric_name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_service_specification_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_service_specification_definition.py deleted file mode 100644 index a687b3dec8ff..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_service_specification_definition.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 OperationServiceSpecificationDefinition(Model): - """The definition of Azure Monitoring metrics list. - - :param metric_specifications: A list of Azure Monitoring metrics - definition. - :type metric_specifications: - list[~azure.mgmt.containerregistry.v2018_09_01.models.OperationMetricSpecificationDefinition] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, - } - - def __init__(self, **kwargs): - super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_service_specification_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_service_specification_definition_py3.py deleted file mode 100644 index cd6cdd8969a8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/operation_service_specification_definition_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 OperationServiceSpecificationDefinition(Model): - """The definition of Azure Monitoring metrics list. - - :param metric_specifications: A list of Azure Monitoring metrics - definition. - :type metric_specifications: - list[~azure.mgmt.containerregistry.v2018_09_01.models.OperationMetricSpecificationDefinition] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/platform_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/platform_properties.py deleted file mode 100644 index cda6c3da72ae..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/platform_properties.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 run has to happen. - - All required parameters must be populated in order to send to Azure. - - :param os: Required. The operating system type required for the run. - Possible values include: 'Windows', 'Linux' - :type os: str or ~azure.mgmt.containerregistry.v2018_09_01.models.OS - :param architecture: The OS architecture. Possible values include: - 'amd64', 'x86', 'arm' - :type architecture: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.Architecture - :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', - 'v8' - :type variant: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.Variant - """ - - _validation = { - 'os': {'required': True}, - } - - _attribute_map = { - 'os': {'key': 'os', 'type': 'str'}, - 'architecture': {'key': 'architecture', 'type': 'str'}, - 'variant': {'key': 'variant', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PlatformProperties, self).__init__(**kwargs) - self.os = kwargs.get('os', None) - self.architecture = kwargs.get('architecture', None) - self.variant = kwargs.get('variant', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/platform_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/platform_properties_py3.py deleted file mode 100644 index a96a315ce7f3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/platform_properties_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 run has to happen. - - All required parameters must be populated in order to send to Azure. - - :param os: Required. The operating system type required for the run. - Possible values include: 'Windows', 'Linux' - :type os: str or ~azure.mgmt.containerregistry.v2018_09_01.models.OS - :param architecture: The OS architecture. Possible values include: - 'amd64', 'x86', 'arm' - :type architecture: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.Architecture - :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', - 'v8' - :type variant: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.Variant - """ - - _validation = { - 'os': {'required': True}, - } - - _attribute_map = { - 'os': {'key': 'os', 'type': 'str'}, - 'architecture': {'key': 'architecture', 'type': 'str'}, - 'variant': {'key': 'variant', 'type': 'str'}, - } - - def __init__(self, *, os, architecture=None, variant=None, **kwargs) -> None: - super(PlatformProperties, self).__init__(**kwargs) - self.os = os - self.architecture = architecture - self.variant = variant diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/platform_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/platform_update_parameters.py deleted file mode 100644 index c6ab1705597c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/platform_update_parameters.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 PlatformUpdateParameters(Model): - """The properties for updating the platform configuration. - - :param os: The operating system type required for the run. Possible values - include: 'Windows', 'Linux' - :type os: str or ~azure.mgmt.containerregistry.v2018_09_01.models.OS - :param architecture: The OS architecture. Possible values include: - 'amd64', 'x86', 'arm' - :type architecture: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.Architecture - :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', - 'v8' - :type variant: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.Variant - """ - - _attribute_map = { - 'os': {'key': 'os', 'type': 'str'}, - 'architecture': {'key': 'architecture', 'type': 'str'}, - 'variant': {'key': 'variant', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PlatformUpdateParameters, self).__init__(**kwargs) - self.os = kwargs.get('os', None) - self.architecture = kwargs.get('architecture', None) - self.variant = kwargs.get('variant', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/platform_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/platform_update_parameters_py3.py deleted file mode 100644 index f02f2504c2f2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/platform_update_parameters_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 PlatformUpdateParameters(Model): - """The properties for updating the platform configuration. - - :param os: The operating system type required for the run. Possible values - include: 'Windows', 'Linux' - :type os: str or ~azure.mgmt.containerregistry.v2018_09_01.models.OS - :param architecture: The OS architecture. Possible values include: - 'amd64', 'x86', 'arm' - :type architecture: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.Architecture - :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', - 'v8' - :type variant: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.Variant - """ - - _attribute_map = { - 'os': {'key': 'os', 'type': 'str'}, - 'architecture': {'key': 'architecture', 'type': 'str'}, - 'variant': {'key': 'variant', 'type': 'str'}, - } - - def __init__(self, *, os=None, architecture=None, variant=None, **kwargs) -> None: - super(PlatformUpdateParameters, self).__init__(**kwargs) - self.os = os - self.architecture = architecture - self.variant = variant diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/proxy_resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/proxy_resource.py deleted file mode 100644 index 5c52aad9de10..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/proxy_resource.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/proxy_resource_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/proxy_resource_py3.py deleted file mode 100644 index d310c7cbf9b1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/proxy_resource_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/quarantine_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/quarantine_policy.py deleted file mode 100644 index c4ccf93a7e6b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/quarantine_policy.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 QuarantinePolicy(Model): - """An object that represents quarantine policy for a container registry. - - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.PolicyStatus - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(QuarantinePolicy, self).__init__(**kwargs) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/quarantine_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/quarantine_policy_py3.py deleted file mode 100644 index 33810811b758..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/quarantine_policy_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 QuarantinePolicy(Model): - """An object that represents quarantine policy for a container registry. - - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.PolicyStatus - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, status=None, **kwargs) -> None: - super(QuarantinePolicy, self).__init__(**kwargs) - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/regenerate_credential_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/regenerate_credential_parameters.py deleted file mode 100644 index 621e21598fd1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/regenerate_credential_parameters.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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_09_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/regenerate_credential_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/regenerate_credential_parameters_py3.py deleted file mode 100644 index d860cd10fc97..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/regenerate_credential_parameters_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry.py deleted file mode 100644 index a4e3349c8f81..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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_09_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.v2018_09_01.models.ProvisioningState - :ivar status: The status of the container registry at the time the - operation was called. - :vartype status: ~azure.mgmt.containerregistry.v2018_09_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.v2018_09_01.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2018_09_01.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - 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) - self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_list_credentials_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_list_credentials_result.py deleted file mode 100644 index 5b48b116175b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_list_credentials_result.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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_09_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_list_credentials_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_list_credentials_result_py3.py deleted file mode 100644 index 7b59229be4dd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_list_credentials_result_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_name_check_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_name_check_request.py deleted file mode 100644 index 9d4a575eac04..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_name_check_request.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_name_check_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_name_check_request_py3.py deleted file mode 100644 index 67f5ff9be671..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_name_check_request_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_name_status.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_name_status.py deleted file mode 100644 index 94345ba6d549..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_name_status.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_name_status_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_name_status_py3.py deleted file mode 100644 index 8b7b264c2d0d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_name_status_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_paged.py deleted file mode 100644 index ff498337cb67..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_password.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_password.py deleted file mode 100644 index eda69d0e626f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_password.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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_09_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, **kwargs): - super(RegistryPassword, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.value = kwargs.get('value', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_password_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_password_py3.py deleted file mode 100644 index 8bbbb90f7ce0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_password_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_policies.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_policies.py deleted file mode 100644 index 0dd49dfe55d6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_policies.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 RegistryPolicies(Model): - """An object that represents policies for a container registry. - - :param quarantine_policy: An object that represents quarantine policy for - a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2018_09_01.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy for a - container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2018_09_01.models.TrustPolicy - """ - - _attribute_map = { - 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, - 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, - } - - def __init__(self, **kwargs): - super(RegistryPolicies, self).__init__(**kwargs) - self.quarantine_policy = kwargs.get('quarantine_policy', None) - self.trust_policy = kwargs.get('trust_policy', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_policies_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_policies_py3.py deleted file mode 100644 index a229cd295473..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_policies_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 RegistryPolicies(Model): - """An object that represents policies for a container registry. - - :param quarantine_policy: An object that represents quarantine policy for - a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2018_09_01.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy for a - container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2018_09_01.models.TrustPolicy - """ - - _attribute_map = { - 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, - 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, - } - - def __init__(self, *, quarantine_policy=None, trust_policy=None, **kwargs) -> None: - super(RegistryPolicies, self).__init__(**kwargs) - self.quarantine_policy = quarantine_policy - self.trust_policy = trust_policy diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_py3.py deleted file mode 100644 index f5d7c73be877..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_py3.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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_py3 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_09_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.v2018_09_01.models.ProvisioningState - :ivar status: The status of the container registry at the time the - operation was called. - :vartype status: ~azure.mgmt.containerregistry.v2018_09_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.v2018_09_01.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2018_09_01.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=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 - self.network_rule_set = network_rule_set diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_update_parameters.py deleted file mode 100644 index 8d773bfe9c9e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_update_parameters.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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_09_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.v2018_09_01.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2018_09_01.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - 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) - self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_update_parameters_py3.py deleted file mode 100644 index 7b1efde6d76a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_update_parameters_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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_09_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.v2018_09_01.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2018_09_01.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, network_rule_set=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 - self.network_rule_set = network_rule_set diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_usage.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_usage.py deleted file mode 100644 index 8d196c7711f8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_usage.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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_09_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_usage_list_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_usage_list_result.py deleted file mode 100644 index bb2cddc211f3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_usage_list_result.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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_09_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_usage_list_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_usage_list_result_py3.py deleted file mode 100644 index 7c29c148e01c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_usage_list_result_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_usage_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_usage_py3.py deleted file mode 100644 index 4580c01f22c3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/registry_usage_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication.py deleted file mode 100644 index dc224cae74df..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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_09_01.models.ProvisioningState - :ivar status: The status of the replication at the time the operation was - called. - :vartype status: ~azure.mgmt.containerregistry.v2018_09_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, **kwargs): - super(Replication, self).__init__(**kwargs) - self.provisioning_state = None - self.status = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_paged.py deleted file mode 100644 index 8f088e8f72f6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_py3.py deleted file mode 100644 index 73bebd419cdb..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_py3.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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_py3 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_09_01.models.ProvisioningState - :ivar status: The status of the replication at the time the operation was - called. - :vartype status: ~azure.mgmt.containerregistry.v2018_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_update_parameters.py deleted file mode 100644 index 003b15583a55..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_update_parameters.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_update_parameters_py3.py deleted file mode 100644 index 5497bcdbc1f7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/replication_update_parameters_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/request.py deleted file mode 100644 index e08090f53205..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/request.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/request_py3.py deleted file mode 100644 index f42dae28c955..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/request_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/resource.py deleted file mode 100644 index 3965a6f0cf40..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/resource.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/resource_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/resource_py3.py deleted file mode 100644 index 3a1d4bc4edd1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/resource_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run.py deleted file mode 100644 index ac61b6630616..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run.py +++ /dev/null @@ -1,135 +0,0 @@ -# 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 Run(ProxyResource): - """Run 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 run_id: The unique identifier for the run. - :type run_id: str - :param status: The current status of the run. Possible values include: - 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', - 'Error', 'Timeout' - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.RunStatus - :param last_updated_time: The last updated time for the run. - :type last_updated_time: datetime - :param run_type: The type of run. Possible values include: 'QuickBuild', - 'QuickRun', 'AutoBuild', 'AutoRun' - :type run_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.RunType - :param create_time: The time the run was scheduled. - :type create_time: datetime - :param start_time: The time the run started. - :type start_time: datetime - :param finish_time: The time the run finished. - :type finish_time: datetime - :param output_images: The list of all images that were generated from the - run. This is applicable if the run generates base image dependencies. - :type output_images: - list[~azure.mgmt.containerregistry.v2018_09_01.models.ImageDescriptor] - :param task: The task against which run was scheduled. - :type task: str - :param image_update_trigger: The image update trigger that caused the run. - This is applicable if the task has base image trigger configured. - :type image_update_trigger: - ~azure.mgmt.containerregistry.v2018_09_01.models.ImageUpdateTrigger - :param source_trigger: The source trigger that caused the run. - :type source_trigger: - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerDescriptor - :param platform: The platform properties against which the run will - happen. - :type platform: - ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties - :param source_registry_auth: The scope of the credentials that were used - to login to the source registry during this run. - :type source_registry_auth: str - :param custom_registries: The list of custom registries that were logged - in during this run. - :type custom_registries: list[str] - :ivar run_error_message: The error message received from backend systems - after the run is scheduled. - :vartype run_error_message: str - :param provisioning_state: The provisioning state of a run. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :type provisioning_state: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.ProvisioningState - :param is_archive_enabled: The value that indicates whether archiving is - enabled or not. Default value: False . - :type is_archive_enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'run_error_message': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'run_id': {'key': 'properties.runId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, - 'run_type': {'key': 'properties.runType', '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]'}, - 'task': {'key': 'properties.task', 'type': 'str'}, - 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, - 'source_trigger': {'key': 'properties.sourceTrigger', 'type': 'SourceTriggerDescriptor'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'source_registry_auth': {'key': 'properties.sourceRegistryAuth', 'type': 'str'}, - 'custom_registries': {'key': 'properties.customRegistries', 'type': '[str]'}, - 'run_error_message': {'key': 'properties.runErrorMessage', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(Run, self).__init__(**kwargs) - self.run_id = kwargs.get('run_id', None) - self.status = kwargs.get('status', None) - self.last_updated_time = kwargs.get('last_updated_time', None) - self.run_type = kwargs.get('run_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.task = kwargs.get('task', None) - self.image_update_trigger = kwargs.get('image_update_trigger', None) - self.source_trigger = kwargs.get('source_trigger', None) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.source_registry_auth = kwargs.get('source_registry_auth', None) - self.custom_registries = kwargs.get('custom_registries', None) - self.run_error_message = None - self.provisioning_state = kwargs.get('provisioning_state', None) - self.is_archive_enabled = kwargs.get('is_archive_enabled', False) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_filter.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_filter.py deleted file mode 100644 index eb87112b749e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_filter.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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 RunFilter(Model): - """Properties that are enabled for Odata querying on runs. - - :param run_id: The unique identifier for the run. - :type run_id: str - :param run_type: The type of run. Possible values include: 'QuickBuild', - 'QuickRun', 'AutoBuild', 'AutoRun' - :type run_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.RunType - :param status: The current status of the run. Possible values include: - 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', - 'Error', 'Timeout' - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.RunStatus - :param create_time: The create time for a run. - :type create_time: datetime - :param finish_time: The time the run finished. - :type finish_time: datetime - :param output_image_manifests: The list of comma-separated image manifests - that were generated from the run. This is applicable if the run is of - build type. - :type output_image_manifests: str - :param is_archive_enabled: The value that indicates whether archiving is - enabled or not. - :type is_archive_enabled: bool - :param task_name: The name of the task that the run corresponds to. - :type task_name: str - """ - - _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'run_type': {'key': 'runType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, - 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'task_name': {'key': 'taskName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RunFilter, self).__init__(**kwargs) - self.run_id = kwargs.get('run_id', None) - self.run_type = kwargs.get('run_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_manifests = kwargs.get('output_image_manifests', None) - self.is_archive_enabled = kwargs.get('is_archive_enabled', None) - self.task_name = kwargs.get('task_name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_filter_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_filter_py3.py deleted file mode 100644 index 3c37fdffd4ae..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_filter_py3.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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 RunFilter(Model): - """Properties that are enabled for Odata querying on runs. - - :param run_id: The unique identifier for the run. - :type run_id: str - :param run_type: The type of run. Possible values include: 'QuickBuild', - 'QuickRun', 'AutoBuild', 'AutoRun' - :type run_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.RunType - :param status: The current status of the run. Possible values include: - 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', - 'Error', 'Timeout' - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.RunStatus - :param create_time: The create time for a run. - :type create_time: datetime - :param finish_time: The time the run finished. - :type finish_time: datetime - :param output_image_manifests: The list of comma-separated image manifests - that were generated from the run. This is applicable if the run is of - build type. - :type output_image_manifests: str - :param is_archive_enabled: The value that indicates whether archiving is - enabled or not. - :type is_archive_enabled: bool - :param task_name: The name of the task that the run corresponds to. - :type task_name: str - """ - - _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'run_type': {'key': 'runType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, - 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'task_name': {'key': 'taskName', 'type': 'str'}, - } - - def __init__(self, *, run_id: str=None, run_type=None, status=None, create_time=None, finish_time=None, output_image_manifests: str=None, is_archive_enabled: bool=None, task_name: str=None, **kwargs) -> None: - super(RunFilter, self).__init__(**kwargs) - self.run_id = run_id - self.run_type = run_type - self.status = status - self.create_time = create_time - self.finish_time = finish_time - self.output_image_manifests = output_image_manifests - self.is_archive_enabled = is_archive_enabled - self.task_name = task_name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_get_log_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_get_log_result.py deleted file mode 100644 index bfe07c60ccee..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_get_log_result.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 RunGetLogResult(Model): - """The result of get log link operation. - - :param log_link: The link to logs for a run on a azure container registry. - :type log_link: str - """ - - _attribute_map = { - 'log_link': {'key': 'logLink', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RunGetLogResult, self).__init__(**kwargs) - self.log_link = kwargs.get('log_link', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_get_log_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_get_log_result_py3.py deleted file mode 100644 index dc68e84d93db..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_get_log_result_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 RunGetLogResult(Model): - """The result of get log link operation. - - :param log_link: The link to logs for a run on a azure container registry. - :type log_link: str - """ - - _attribute_map = { - 'log_link': {'key': 'logLink', 'type': 'str'}, - } - - def __init__(self, *, log_link: str=None, **kwargs) -> None: - super(RunGetLogResult, self).__init__(**kwargs) - self.log_link = log_link diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_paged.py deleted file mode 100644 index ff11871fbc20..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 RunPaged(Paged): - """ - A paging container for iterating over a list of :class:`Run ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Run]'} - } - - def __init__(self, *args, **kwargs): - - super(RunPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_py3.py deleted file mode 100644 index 3e5c4d297934..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_py3.py +++ /dev/null @@ -1,135 +0,0 @@ -# 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_py3 import ProxyResource - - -class Run(ProxyResource): - """Run 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 run_id: The unique identifier for the run. - :type run_id: str - :param status: The current status of the run. Possible values include: - 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', - 'Error', 'Timeout' - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.RunStatus - :param last_updated_time: The last updated time for the run. - :type last_updated_time: datetime - :param run_type: The type of run. Possible values include: 'QuickBuild', - 'QuickRun', 'AutoBuild', 'AutoRun' - :type run_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.RunType - :param create_time: The time the run was scheduled. - :type create_time: datetime - :param start_time: The time the run started. - :type start_time: datetime - :param finish_time: The time the run finished. - :type finish_time: datetime - :param output_images: The list of all images that were generated from the - run. This is applicable if the run generates base image dependencies. - :type output_images: - list[~azure.mgmt.containerregistry.v2018_09_01.models.ImageDescriptor] - :param task: The task against which run was scheduled. - :type task: str - :param image_update_trigger: The image update trigger that caused the run. - This is applicable if the task has base image trigger configured. - :type image_update_trigger: - ~azure.mgmt.containerregistry.v2018_09_01.models.ImageUpdateTrigger - :param source_trigger: The source trigger that caused the run. - :type source_trigger: - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerDescriptor - :param platform: The platform properties against which the run will - happen. - :type platform: - ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties - :param source_registry_auth: The scope of the credentials that were used - to login to the source registry during this run. - :type source_registry_auth: str - :param custom_registries: The list of custom registries that were logged - in during this run. - :type custom_registries: list[str] - :ivar run_error_message: The error message received from backend systems - after the run is scheduled. - :vartype run_error_message: str - :param provisioning_state: The provisioning state of a run. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :type provisioning_state: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.ProvisioningState - :param is_archive_enabled: The value that indicates whether archiving is - enabled or not. Default value: False . - :type is_archive_enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'run_error_message': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'run_id': {'key': 'properties.runId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, - 'run_type': {'key': 'properties.runType', '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]'}, - 'task': {'key': 'properties.task', 'type': 'str'}, - 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, - 'source_trigger': {'key': 'properties.sourceTrigger', 'type': 'SourceTriggerDescriptor'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'source_registry_auth': {'key': 'properties.sourceRegistryAuth', 'type': 'str'}, - 'custom_registries': {'key': 'properties.customRegistries', 'type': '[str]'}, - 'run_error_message': {'key': 'properties.runErrorMessage', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, - } - - def __init__(self, *, run_id: str=None, status=None, last_updated_time=None, run_type=None, create_time=None, start_time=None, finish_time=None, output_images=None, task: str=None, image_update_trigger=None, source_trigger=None, platform=None, agent_configuration=None, source_registry_auth: str=None, custom_registries=None, provisioning_state=None, is_archive_enabled: bool=False, **kwargs) -> None: - super(Run, self).__init__(**kwargs) - self.run_id = run_id - self.status = status - self.last_updated_time = last_updated_time - self.run_type = run_type - self.create_time = create_time - self.start_time = start_time - self.finish_time = finish_time - self.output_images = output_images - self.task = task - self.image_update_trigger = image_update_trigger - self.source_trigger = source_trigger - self.platform = platform - self.agent_configuration = agent_configuration - self.source_registry_auth = source_registry_auth - self.custom_registries = custom_registries - self.run_error_message = None - self.provisioning_state = provisioning_state - self.is_archive_enabled = is_archive_enabled diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_request.py deleted file mode 100644 index 6a49775b5fe9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_request.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 RunRequest(Model): - """The request parameters for scheduling a run. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildRequest, FileTaskRunRequest, TaskRunRequest, - EncodedTaskRunRequest - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} - } - - def __init__(self, **kwargs): - super(RunRequest, self).__init__(**kwargs) - self.is_archive_enabled = kwargs.get('is_archive_enabled', False) - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_request_py3.py deleted file mode 100644 index 1bf6cabe0c2d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_request_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 RunRequest(Model): - """The request parameters for scheduling a run. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildRequest, FileTaskRunRequest, TaskRunRequest, - EncodedTaskRunRequest - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} - } - - def __init__(self, *, is_archive_enabled: bool=False, **kwargs) -> None: - super(RunRequest, self).__init__(**kwargs) - self.is_archive_enabled = is_archive_enabled - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_update_parameters.py deleted file mode 100644 index 7c99f1e212d0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_update_parameters.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 RunUpdateParameters(Model): - """The set of run 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(RunUpdateParameters, self).__init__(**kwargs) - self.is_archive_enabled = kwargs.get('is_archive_enabled', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_update_parameters_py3.py deleted file mode 100644 index 62bcd0c6f4bd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/run_update_parameters_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 RunUpdateParameters(Model): - """The set of run 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(RunUpdateParameters, self).__init__(**kwargs) - self.is_archive_enabled = is_archive_enabled diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/secret_object.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/secret_object.py deleted file mode 100644 index 75712b7a9049..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/secret_object.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 SecretObject(Model): - """Describes the properties of a secret object value. - - :param value: The value of the secret. The format of this value will be - determined - based on the type of the secret object. If the type is Opaque, the value - will be - used as is without any modification. - :type value: str - :param type: The type of the secret object which determines how the value - of the secret object has to be - interpreted. Possible values include: 'Opaque' - :type type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.SecretObjectType - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SecretObject, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.type = kwargs.get('type', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/secret_object_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/secret_object_py3.py deleted file mode 100644 index ae63388522b9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/secret_object_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 SecretObject(Model): - """Describes the properties of a secret object value. - - :param value: The value of the secret. The format of this value will be - determined - based on the type of the secret object. If the type is Opaque, the value - will be - used as is without any modification. - :type value: str - :param type: The type of the secret object which determines how the value - of the secret object has to be - interpreted. Possible values include: 'Opaque' - :type type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.SecretObjectType - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, *, value: str=None, type=None, **kwargs) -> None: - super(SecretObject, self).__init__(**kwargs) - self.value = value - self.type = type diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/set_value.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/set_value.py deleted file mode 100644 index ec349f6bb414..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/set_value.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 SetValue(Model): - """The properties of a overridable value that can be passed to a task - template. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the overridable value. - :type name: str - :param value: Required. The overridable value. - :type value: str - :param is_secret: Flag to indicate whether the value represents a secret - or not. Default value: False . - :type is_secret: bool - """ - - _validation = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(SetValue, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/set_value_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/set_value_py3.py deleted file mode 100644 index cce869040a6a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/set_value_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 SetValue(Model): - """The properties of a overridable value that can be passed to a task - template. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the overridable value. - :type name: str - :param value: Required. The overridable value. - :type value: str - :param is_secret: Flag to indicate whether the value represents a secret - or not. Default value: False . - :type is_secret: bool - """ - - _validation = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - } - - def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: - super(SetValue, self).__init__(**kwargs) - self.name = name - self.value = value - self.is_secret = is_secret diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/sku.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/sku.py deleted file mode 100644 index b8111d63942b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/sku.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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_09_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.v2018_09_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, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/sku_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/sku_py3.py deleted file mode 100644 index 7789497c334e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/sku_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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_09_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.v2018_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source.py deleted file mode 100644 index 132f4b2c1324..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_properties.py deleted file mode 100644 index 1a5a6038a623..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_properties.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 SourceProperties(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_09_01.models.SourceControlType - :param repository_url: Required. The full URL to the source code - repository - :type repository_url: str - :param branch: The branch name of the source code. - :type branch: str - :param source_control_auth_properties: The authorization properties for - accessing the source code repository and to set up - webhooks for notifications. - :type source_control_auth_properties: - ~azure.mgmt.containerregistry.v2018_09_01.models.AuthInfo - """ - - _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'}, - 'branch': {'key': 'branch', 'type': 'str'}, - 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfo'}, - } - - def __init__(self, **kwargs): - super(SourceProperties, self).__init__(**kwargs) - self.source_control_type = kwargs.get('source_control_type', None) - self.repository_url = kwargs.get('repository_url', None) - self.branch = kwargs.get('branch', None) - self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_properties_py3.py deleted file mode 100644 index b6a92008f6f6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_properties_py3.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 SourceProperties(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_09_01.models.SourceControlType - :param repository_url: Required. The full URL to the source code - repository - :type repository_url: str - :param branch: The branch name of the source code. - :type branch: str - :param source_control_auth_properties: The authorization properties for - accessing the source code repository and to set up - webhooks for notifications. - :type source_control_auth_properties: - ~azure.mgmt.containerregistry.v2018_09_01.models.AuthInfo - """ - - _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'}, - 'branch': {'key': 'branch', 'type': 'str'}, - 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfo'}, - } - - def __init__(self, *, source_control_type, repository_url: str, branch: str=None, source_control_auth_properties=None, **kwargs) -> None: - super(SourceProperties, self).__init__(**kwargs) - self.source_control_type = source_control_type - self.repository_url = repository_url - self.branch = branch - self.source_control_auth_properties = source_control_auth_properties diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_py3.py deleted file mode 100644 index 5aadcd407862..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_registry_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_registry_credentials.py deleted file mode 100644 index 4562b574f0d6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_registry_credentials.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 SourceRegistryCredentials(Model): - """Describes the credential parameters for accessing the source registry. - - :param login_mode: The authentication mode which determines the source - registry login scope. The credentials for the source registry - will be generated using the given scope. These credentials will be used to - login to - the source registry during the run. Possible values include: 'None', - 'Default' - :type login_mode: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceRegistryLoginMode - """ - - _attribute_map = { - 'login_mode': {'key': 'loginMode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SourceRegistryCredentials, self).__init__(**kwargs) - self.login_mode = kwargs.get('login_mode', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_registry_credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_registry_credentials_py3.py deleted file mode 100644 index 5ae1124a8991..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_registry_credentials_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 SourceRegistryCredentials(Model): - """Describes the credential parameters for accessing the source registry. - - :param login_mode: The authentication mode which determines the source - registry login scope. The credentials for the source registry - will be generated using the given scope. These credentials will be used to - login to - the source registry during the run. Possible values include: 'None', - 'Default' - :type login_mode: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceRegistryLoginMode - """ - - _attribute_map = { - 'login_mode': {'key': 'loginMode', 'type': 'str'}, - } - - def __init__(self, *, login_mode=None, **kwargs) -> None: - super(SourceRegistryCredentials, self).__init__(**kwargs) - self.login_mode = login_mode diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger.py deleted file mode 100644 index 5d0e0e326bf5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 SourceTrigger(Model): - """The properties of a source based trigger. - - All required parameters must be populated in order to send to Azure. - - :param source_repository: Required. The properties that describes the - source(code) for the task. - :type source_repository: - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceProperties - :param source_trigger_events: Required. The source event corresponding to - the trigger. - :type source_trigger_events: list[str or - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerEvent] - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'source_repository': {'required': True}, - 'source_trigger_events': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceProperties'}, - 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SourceTrigger, self).__init__(**kwargs) - self.source_repository = kwargs.get('source_repository', None) - self.source_trigger_events = kwargs.get('source_trigger_events', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_descriptor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_descriptor.py deleted file mode 100644 index 4ee9a9b20c64..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_descriptor.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 SourceTriggerDescriptor(Model): - """The source trigger that caused a run. - - :param id: The unique ID of the trigger. - :type id: str - :param event_type: The event type of the trigger. - :type event_type: str - :param commit_id: The unique ID that identifies a commit. - :type commit_id: str - :param pull_request_id: The unique ID that identifies pull request. - :type pull_request_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'}, - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'commit_id': {'key': 'commitId', 'type': 'str'}, - 'pull_request_id': {'key': 'pullRequestId', '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(SourceTriggerDescriptor, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.event_type = kwargs.get('event_type', None) - self.commit_id = kwargs.get('commit_id', None) - self.pull_request_id = kwargs.get('pull_request_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_descriptor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_descriptor_py3.py deleted file mode 100644 index bb35eb70537d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_descriptor_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 SourceTriggerDescriptor(Model): - """The source trigger that caused a run. - - :param id: The unique ID of the trigger. - :type id: str - :param event_type: The event type of the trigger. - :type event_type: str - :param commit_id: The unique ID that identifies a commit. - :type commit_id: str - :param pull_request_id: The unique ID that identifies pull request. - :type pull_request_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'}, - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'commit_id': {'key': 'commitId', 'type': 'str'}, - 'pull_request_id': {'key': 'pullRequestId', '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, event_type: str=None, commit_id: str=None, pull_request_id: str=None, repository_url: str=None, branch_name: str=None, provider_type: str=None, **kwargs) -> None: - super(SourceTriggerDescriptor, self).__init__(**kwargs) - self.id = id - self.event_type = event_type - self.commit_id = commit_id - self.pull_request_id = pull_request_id - self.repository_url = repository_url - self.branch_name = branch_name - self.provider_type = provider_type diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_py3.py deleted file mode 100644 index 2925240a46bc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 SourceTrigger(Model): - """The properties of a source based trigger. - - All required parameters must be populated in order to send to Azure. - - :param source_repository: Required. The properties that describes the - source(code) for the task. - :type source_repository: - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceProperties - :param source_trigger_events: Required. The source event corresponding to - the trigger. - :type source_trigger_events: list[str or - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerEvent] - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'source_repository': {'required': True}, - 'source_trigger_events': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceProperties'}, - 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, source_repository, source_trigger_events, name: str, status="Enabled", **kwargs) -> None: - super(SourceTrigger, self).__init__(**kwargs) - self.source_repository = source_repository - self.source_trigger_events = source_trigger_events - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_update_parameters.py deleted file mode 100644 index 77fcdb02b240..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_update_parameters.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 SourceTriggerUpdateParameters(Model): - """The properties for updating a source based trigger. - - All required parameters must be populated in order to send to Azure. - - :param source_repository: The properties that describes the source(code) - for the task. - :type source_repository: - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceUpdateParameters - :param source_trigger_events: The source event corresponding to the - trigger. - :type source_trigger_events: list[str or - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerEvent] - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceUpdateParameters'}, - 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SourceTriggerUpdateParameters, self).__init__(**kwargs) - self.source_repository = kwargs.get('source_repository', None) - self.source_trigger_events = kwargs.get('source_trigger_events', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_update_parameters_py3.py deleted file mode 100644 index c15994f6ecf5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_trigger_update_parameters_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 SourceTriggerUpdateParameters(Model): - """The properties for updating a source based trigger. - - All required parameters must be populated in order to send to Azure. - - :param source_repository: The properties that describes the source(code) - for the task. - :type source_repository: - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceUpdateParameters - :param source_trigger_events: The source event corresponding to the - trigger. - :type source_trigger_events: list[str or - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerEvent] - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceUpdateParameters'}, - 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str, source_repository=None, source_trigger_events=None, status="Enabled", **kwargs) -> None: - super(SourceTriggerUpdateParameters, self).__init__(**kwargs) - self.source_repository = source_repository - self.source_trigger_events = source_trigger_events - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_update_parameters.py deleted file mode 100644 index 83177663cb75..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_update_parameters.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 SourceUpdateParameters(Model): - """The properties for updating the source code repository. - - :param source_control_type: The type of source control service. Possible - values include: 'Github', 'VisualStudioTeamService' - :type source_control_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceControlType - :param repository_url: The full URL to the source code repository - :type repository_url: str - :param branch: The branch name of the source code. - :type branch: str - :param source_control_auth_properties: The authorization properties for - accessing the source code repository and to set up - webhooks for notifications. - :type source_control_auth_properties: - ~azure.mgmt.containerregistry.v2018_09_01.models.AuthInfoUpdateParameters - """ - - _attribute_map = { - 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, - 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, - 'branch': {'key': 'branch', 'type': 'str'}, - 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfoUpdateParameters'}, - } - - def __init__(self, **kwargs): - super(SourceUpdateParameters, self).__init__(**kwargs) - self.source_control_type = kwargs.get('source_control_type', None) - self.repository_url = kwargs.get('repository_url', None) - self.branch = kwargs.get('branch', None) - self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_update_parameters_py3.py deleted file mode 100644 index c0c88596783b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_update_parameters_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 SourceUpdateParameters(Model): - """The properties for updating the source code repository. - - :param source_control_type: The type of source control service. Possible - values include: 'Github', 'VisualStudioTeamService' - :type source_control_type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.SourceControlType - :param repository_url: The full URL to the source code repository - :type repository_url: str - :param branch: The branch name of the source code. - :type branch: str - :param source_control_auth_properties: The authorization properties for - accessing the source code repository and to set up - webhooks for notifications. - :type source_control_auth_properties: - ~azure.mgmt.containerregistry.v2018_09_01.models.AuthInfoUpdateParameters - """ - - _attribute_map = { - 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, - 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, - 'branch': {'key': 'branch', 'type': 'str'}, - 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfoUpdateParameters'}, - } - - def __init__(self, *, source_control_type=None, repository_url: str=None, branch: str=None, source_control_auth_properties=None, **kwargs) -> None: - super(SourceUpdateParameters, self).__init__(**kwargs) - self.source_control_type = source_control_type - self.repository_url = repository_url - self.branch = branch - self.source_control_auth_properties = source_control_auth_properties diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_upload_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_upload_definition.py deleted file mode 100644 index 381fd538e9e3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_upload_definition.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_upload_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_upload_definition_py3.py deleted file mode 100644 index cff615964e11..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/source_upload_definition_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/status.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/status.py deleted file mode 100644 index 76444c500634..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/status.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/status_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/status_py3.py deleted file mode 100644 index 1f4611c49912..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/status_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/storage_account_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/storage_account_properties.py deleted file mode 100644 index 0541b7651cbd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/storage_account_properties.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/storage_account_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/storage_account_properties_py3.py deleted file mode 100644 index 5714fde0fcd2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/storage_account_properties_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/target.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/target.py deleted file mode 100644 index 228df1d19f00..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/target.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', '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) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/target_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/target_py3.py deleted file mode 100644 index 3b312ee2c0da..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/target_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', '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, name: str=None, version: 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 - self.name = name - self.version = version diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task.py deleted file mode 100644 index c27c062dcd5d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task.py +++ /dev/null @@ -1,106 +0,0 @@ -# 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 Task(Resource): - """The task that has the ARM resource and task properties. - The task will have all information to schedule a run 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 task. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :vartype provisioning_state: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.ProvisioningState - :ivar creation_date: The creation date of task. - :vartype creation_date: datetime - :param status: The current status of task. Possible values include: - 'Disabled', 'Enabled' - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStatus - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param step: Required. The properties of a task step. - :type step: - ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStepProperties - :param trigger: The properties that describe all triggers for the task. - :type trigger: - ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerProperties - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'platform': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'step': {'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}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, - 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, - 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, - } - - def __init__(self, **kwargs): - super(Task, self).__init__(**kwargs) - self.provisioning_state = None - self.creation_date = None - self.status = kwargs.get('status', None) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.timeout = kwargs.get('timeout', 3600) - self.step = kwargs.get('step', None) - self.trigger = kwargs.get('trigger', None) - self.credentials = kwargs.get('credentials', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_paged.py deleted file mode 100644 index 214728818293..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 TaskPaged(Paged): - """ - A paging container for iterating over a list of :class:`Task ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Task]'} - } - - def __init__(self, *args, **kwargs): - - super(TaskPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_py3.py deleted file mode 100644 index bf8d41760735..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_py3.py +++ /dev/null @@ -1,106 +0,0 @@ -# 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_py3 import Resource - - -class Task(Resource): - """The task that has the ARM resource and task properties. - The task will have all information to schedule a run 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 task. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :vartype provisioning_state: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.ProvisioningState - :ivar creation_date: The creation date of task. - :vartype creation_date: datetime - :param status: The current status of task. Possible values include: - 'Disabled', 'Enabled' - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStatus - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param step: Required. The properties of a task step. - :type step: - ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStepProperties - :param trigger: The properties that describe all triggers for the task. - :type trigger: - ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerProperties - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'platform': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'step': {'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}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, - 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, - 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, - } - - def __init__(self, *, location: str, platform, step, tags=None, status=None, agent_configuration=None, timeout: int=3600, trigger=None, credentials=None, **kwargs) -> None: - super(Task, self).__init__(location=location, tags=tags, **kwargs) - self.provisioning_state = None - self.creation_date = None - self.status = status - self.platform = platform - self.agent_configuration = agent_configuration - self.timeout = timeout - self.step = step - self.trigger = trigger - self.credentials = credentials diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_run_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_run_request.py deleted file mode 100644 index 2f2ed7a707c8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_run_request.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 .run_request import RunRequest - - -class TaskRunRequest(RunRequest): - """The parameters for a task run request. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param task_name: Required. The name of task against which run has to be - queued. - :type task_name: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - 'task_name': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_name': {'key': 'taskName', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(TaskRunRequest, self).__init__(**kwargs) - self.task_name = kwargs.get('task_name', None) - self.values = kwargs.get('values', None) - self.type = 'TaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_run_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_run_request_py3.py deleted file mode 100644 index 140af55d8132..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_run_request_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 .run_request_py3 import RunRequest - - -class TaskRunRequest(RunRequest): - """The parameters for a task run request. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param task_name: Required. The name of task against which run has to be - queued. - :type task_name: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - 'task_name': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_name': {'key': 'taskName', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, task_name: str, is_archive_enabled: bool=False, values=None, **kwargs) -> None: - super(TaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) - self.task_name = task_name - self.values = values - self.type = 'TaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_step_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_step_properties.py deleted file mode 100644 index 20a52b24e8f3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_step_properties.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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 TaskStepProperties(Model): - """Base properties for any task step. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildStep, FileTaskStep, EncodedTaskStep - - 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Docker': 'DockerBuildStep', 'FileTask': 'FileTaskStep', 'EncodedTask': 'EncodedTaskStep'} - } - - def __init__(self, **kwargs): - super(TaskStepProperties, self).__init__(**kwargs) - self.base_image_dependencies = None - self.context_path = kwargs.get('context_path', None) - self.context_access_token = kwargs.get('context_access_token', None) - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_step_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_step_properties_py3.py deleted file mode 100644 index cd74064f5679..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_step_properties_py3.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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 TaskStepProperties(Model): - """Base properties for any task step. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildStep, FileTaskStep, EncodedTaskStep - - 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Docker': 'DockerBuildStep', 'FileTask': 'FileTaskStep', 'EncodedTask': 'EncodedTaskStep'} - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, **kwargs) -> None: - super(TaskStepProperties, self).__init__(**kwargs) - self.base_image_dependencies = None - self.context_path = context_path - self.context_access_token = context_access_token - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_step_update_parameters.py deleted file mode 100644 index a9047fd426b9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_step_update_parameters.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 TaskStepUpdateParameters(Model): - """Base properties for updating any task step. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildStepUpdateParameters, - FileTaskStepUpdateParameters, EncodedTaskStepUpdateParameters - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Docker': 'DockerBuildStepUpdateParameters', 'FileTask': 'FileTaskStepUpdateParameters', 'EncodedTask': 'EncodedTaskStepUpdateParameters'} - } - - def __init__(self, **kwargs): - super(TaskStepUpdateParameters, self).__init__(**kwargs) - self.context_path = kwargs.get('context_path', None) - self.context_access_token = kwargs.get('context_access_token', None) - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_step_update_parameters_py3.py deleted file mode 100644 index 70f77214e15b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_step_update_parameters_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 TaskStepUpdateParameters(Model): - """Base properties for updating any task step. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildStepUpdateParameters, - FileTaskStepUpdateParameters, EncodedTaskStepUpdateParameters - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Docker': 'DockerBuildStepUpdateParameters', 'FileTask': 'FileTaskStepUpdateParameters', 'EncodedTask': 'EncodedTaskStepUpdateParameters'} - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, **kwargs) -> None: - super(TaskStepUpdateParameters, self).__init__(**kwargs) - self.context_path = context_path - self.context_access_token = context_access_token - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_update_parameters.py deleted file mode 100644 index 5f446833b893..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_update_parameters.py +++ /dev/null @@ -1,65 +0,0 @@ -# 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 TaskUpdateParameters(Model): - """The parameters for updating a task. - - :param status: The current status of task. Possible values include: - 'Disabled', 'Enabled' - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStatus - :param platform: The platform properties against which the run has to - happen. - :type platform: - ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformUpdateParameters - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties - :param timeout: Run timeout in seconds. - :type timeout: int - :param step: The properties for updating a task step. - :type step: - ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStepUpdateParameters - :param trigger: The properties for updating trigger properties. - :type trigger: - ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerUpdateParameters - :param credentials: The parameters that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials - :param tags: The ARM resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'str'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, - 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, - 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(TaskUpdateParameters, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.timeout = kwargs.get('timeout', None) - self.step = kwargs.get('step', None) - self.trigger = kwargs.get('trigger', None) - self.credentials = kwargs.get('credentials', None) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_update_parameters_py3.py deleted file mode 100644 index 3a2b3963a902..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/task_update_parameters_py3.py +++ /dev/null @@ -1,65 +0,0 @@ -# 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 TaskUpdateParameters(Model): - """The parameters for updating a task. - - :param status: The current status of task. Possible values include: - 'Disabled', 'Enabled' - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStatus - :param platform: The platform properties against which the run has to - happen. - :type platform: - ~azure.mgmt.containerregistry.v2018_09_01.models.PlatformUpdateParameters - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2018_09_01.models.AgentProperties - :param timeout: Run timeout in seconds. - :type timeout: int - :param step: The properties for updating a task step. - :type step: - ~azure.mgmt.containerregistry.v2018_09_01.models.TaskStepUpdateParameters - :param trigger: The properties for updating trigger properties. - :type trigger: - ~azure.mgmt.containerregistry.v2018_09_01.models.TriggerUpdateParameters - :param credentials: The parameters that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2018_09_01.models.Credentials - :param tags: The ARM resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'status': {'key': 'properties.status', 'type': 'str'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, - 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, - 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, status=None, platform=None, agent_configuration=None, timeout: int=None, step=None, trigger=None, credentials=None, tags=None, **kwargs) -> None: - super(TaskUpdateParameters, self).__init__(**kwargs) - self.status = status - self.platform = platform - self.agent_configuration = agent_configuration - self.timeout = timeout - self.step = step - self.trigger = trigger - self.credentials = credentials - self.tags = tags diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trigger_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trigger_properties.py deleted file mode 100644 index 9c683c3f0977..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trigger_properties.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TriggerProperties(Model): - """The properties of a trigger. - - :param source_triggers: The collection of triggers based on source code - repository. - :type source_triggers: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SourceTrigger] - :param base_image_trigger: The trigger based on base image dependencies. - :type base_image_trigger: - ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTrigger - """ - - _attribute_map = { - 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTrigger]'}, - 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTrigger'}, - } - - def __init__(self, **kwargs): - super(TriggerProperties, self).__init__(**kwargs) - self.source_triggers = kwargs.get('source_triggers', None) - self.base_image_trigger = kwargs.get('base_image_trigger', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trigger_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trigger_properties_py3.py deleted file mode 100644 index 80707da8fe49..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trigger_properties_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TriggerProperties(Model): - """The properties of a trigger. - - :param source_triggers: The collection of triggers based on source code - repository. - :type source_triggers: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SourceTrigger] - :param base_image_trigger: The trigger based on base image dependencies. - :type base_image_trigger: - ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTrigger - """ - - _attribute_map = { - 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTrigger]'}, - 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTrigger'}, - } - - def __init__(self, *, source_triggers=None, base_image_trigger=None, **kwargs) -> None: - super(TriggerProperties, self).__init__(**kwargs) - self.source_triggers = source_triggers - self.base_image_trigger = base_image_trigger diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trigger_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trigger_update_parameters.py deleted file mode 100644 index 1a1f5907c52c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trigger_update_parameters.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TriggerUpdateParameters(Model): - """The properties for updating triggers. - - :param source_triggers: The collection of triggers based on source code - repository. - :type source_triggers: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerUpdateParameters] - :param base_image_trigger: The trigger based on base image dependencies. - :type base_image_trigger: - ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTriggerUpdateParameters - """ - - _attribute_map = { - 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTriggerUpdateParameters]'}, - 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTriggerUpdateParameters'}, - } - - def __init__(self, **kwargs): - super(TriggerUpdateParameters, self).__init__(**kwargs) - self.source_triggers = kwargs.get('source_triggers', None) - self.base_image_trigger = kwargs.get('base_image_trigger', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trigger_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trigger_update_parameters_py3.py deleted file mode 100644 index 12c619cf2e11..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trigger_update_parameters_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TriggerUpdateParameters(Model): - """The properties for updating triggers. - - :param source_triggers: The collection of triggers based on source code - repository. - :type source_triggers: - list[~azure.mgmt.containerregistry.v2018_09_01.models.SourceTriggerUpdateParameters] - :param base_image_trigger: The trigger based on base image dependencies. - :type base_image_trigger: - ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageTriggerUpdateParameters - """ - - _attribute_map = { - 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTriggerUpdateParameters]'}, - 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTriggerUpdateParameters'}, - } - - def __init__(self, *, source_triggers=None, base_image_trigger=None, **kwargs) -> None: - super(TriggerUpdateParameters, self).__init__(**kwargs) - self.source_triggers = source_triggers - self.base_image_trigger = base_image_trigger diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trust_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trust_policy.py deleted file mode 100644 index ca75381e22c0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trust_policy.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TrustPolicy(Model): - """An object that represents content trust policy for a container registry. - - :param type: The type of trust policy. Possible values include: 'Notary' - :type type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TrustPolicyType - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.PolicyStatus - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrustPolicy, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trust_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trust_policy_py3.py deleted file mode 100644 index ca89be5aaee9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/trust_policy_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TrustPolicy(Model): - """An object that represents content trust policy for a container registry. - - :param type: The type of trust policy. Possible values include: 'Notary' - :type type: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.TrustPolicyType - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.PolicyStatus - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, type=None, status=None, **kwargs) -> None: - super(TrustPolicy, self).__init__(**kwargs) - self.type = type - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/virtual_network_rule.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/virtual_network_rule.py deleted file mode 100644 index 2a1a4e7417e3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/virtual_network_rule.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual network rule. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.Action - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.action = kwargs.get('action', "Allow") - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/virtual_network_rule_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/virtual_network_rule_py3.py deleted file mode 100644 index 36e56939ac65..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual network rule. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2018_09_01.models.Action - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.action = action - self.virtual_network_resource_id = virtual_network_resource_id diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook.py deleted file mode 100644 index a0a165cf9022..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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_09_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.v2018_09_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.v2018_09_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_create_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_create_parameters.py deleted file mode 100644 index 25b7658722da..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_create_parameters.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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_09_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.v2018_09_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_create_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_create_parameters_py3.py deleted file mode 100644 index 454ab766bd0a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_create_parameters_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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_09_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.v2018_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_paged.py deleted file mode 100644 index e12a3393eed7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_py3.py deleted file mode 100644 index 47cddd02a515..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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_py3 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_09_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.v2018_09_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.v2018_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_update_parameters.py deleted file mode 100644 index 2e258352f7f4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_update_parameters.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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_09_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.v2018_09_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_update_parameters_py3.py deleted file mode 100644 index 3cfdfea03e96..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/models/webhook_update_parameters_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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_09_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.v2018_09_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/__init__.py index d9dadb00c503..b05c49580519 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/__init__.py @@ -9,12 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from .registries_operations import RegistriesOperations -from .operations import Operations -from .replications_operations import ReplicationsOperations -from .webhooks_operations import WebhooksOperations -from .runs_operations import RunsOperations -from .tasks_operations import TasksOperations +from ._registries_operations import RegistriesOperations +from ._operations import Operations +from ._replications_operations import ReplicationsOperations +from ._webhooks_operations import WebhooksOperations +from ._runs_operations import RunsOperations +from ._tasks_operations import TasksOperations __all__ = [ 'RegistriesOperations', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_operations.py new file mode 100644 index 000000000000..0f12ef238ee9 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_operations.py @@ -0,0 +1,103 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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_09_01.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2018_09_01.models.OperationDefinition] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.ContainerRegistry/operations'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_registries_operations.py new file mode 100644 index 000000000000..e3e130cbfca2 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_registries_operations.py @@ -0,0 +1,1255 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 _import_image_initial( + self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2017-10-01" + + # Construct URL + url = self.import_image.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', min_length=1), + '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(parameters, 'ImportImageParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 import_image( + self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Copies an image to this container registry from 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 parameters: The parameters specifying the image to copy and the + source container registry. + :type parameters: + ~azure.mgmt.containerregistry.v2018_09_01.models.ImportImageParameters + :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._import_image_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + parameters=parameters, + 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) + import_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage'} + + 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_09_01.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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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_09_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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_09_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.v2018_09_01.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_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) + 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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_09_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.v2018_09_01.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_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 + ) + + 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_09_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2018_09_01.models.Registry] + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + def prepare_request(next_link=None): + 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', min_length=1) + } + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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_09_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2018_09_01.models.Registry] + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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_09_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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_09_01.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_09_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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_09_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 list_policies( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists the policies 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: RegistryPolicies or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_09_01.models.RegistryPolicies or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + # Construct URL + url = self.list_policies.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'} + + + def _update_policies_initial( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, **operation_config): + registry_policies_update_parameters = models.RegistryPolicies(quarantine_policy=quarantine_policy, trust_policy=trust_policy) + + api_version = "2017-10-01" + + # Construct URL + url = self.update_policies.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', min_length=1), + '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['Accept'] = 'application/json' + 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_policies_update_parameters, 'RegistryPolicies') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_policies( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the policies 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 quarantine_policy: An object that represents quarantine policy + for a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2018_09_01.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy + for a container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2018_09_01.models.TrustPolicy + :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 RegistryPolicies or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_09_01.models.RegistryPolicies] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_01.models.RegistryPolicies]] + :raises: :class:`CloudError` + """ + raw_result = self._update_policies_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + quarantine_policy=quarantine_policy, + trust_policy=trust_policy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RegistryPolicies', 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_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'} + + + def _schedule_run_initial( + self, resource_group_name, registry_name, run_request, custom_headers=None, raw=False, **operation_config): + api_version = "2018-09-01" + + # Construct URL + url = self.schedule_run.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', min_length=1), + '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['Accept'] = 'application/json' + 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(run_request, 'RunRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Run', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def schedule_run( + self, resource_group_name, registry_name, run_request, custom_headers=None, raw=False, polling=True, **operation_config): + """Schedules a new run based on the request parameters and add it to the + run 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 run_request: The parameters of a run that needs to scheduled. + :type run_request: + ~azure.mgmt.containerregistry.v2018_09_01.models.RunRequest + :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 Run or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_09_01.models.Run] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_01.models.Run]] + :raises: :class:`CloudError` + """ + raw_result = self._schedule_run_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + run_request=run_request, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Run', 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) + schedule_run.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun'} + + 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_09_01.models.SourceUploadDefinition + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2018-09-01" + + # 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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}/listBuildSourceUploadUrl'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_replications_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_replications_operations.py new file mode 100644 index 000000000000..5f292bbafce3 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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_09_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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_09_01.models.Replication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_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 = 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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_09_01.models.Replication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_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 + ) + + 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_09_01.models.ReplicationPaged[~azure.mgmt.containerregistry.v2018_09_01.models.Replication] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.ReplicationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_runs_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_runs_operations.py new file mode 100644 index 000000000000..aad518a428da --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_runs_operations.py @@ -0,0 +1,452 @@ +# 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 RunsOperations(object): + """RunsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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-09-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-09-01" + + self.config = config + + def list( + self, resource_group_name, registry_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all the runs 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 runs filter to apply on the operation. Arithmetic + operators are not supported. The allowed string function is + 'contains'. All logical operators except 'Not', 'Has', 'All' are + allowed. + :type filter: str + :param top: $top is supported for get list of runs, which limits the + maximum number of runs to return. + :type top: int + :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 Run + :rtype: + ~azure.mgmt.containerregistry.v2018_09_01.models.RunPaged[~azure.mgmt.containerregistry.v2018_09_01.models.Run] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RunPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs'} + + def get( + self, resource_group_name, registry_name, run_id, custom_headers=None, raw=False, **operation_config): + """Gets the detailed information for a given run. + + :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 run_id: The run ID. + :type run_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: Run or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerregistry.v2018_09_01.models.Run 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Run', 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}/runs/{runId}'} + + + def _update_initial( + self, resource_group_name, registry_name, run_id, is_archive_enabled=None, custom_headers=None, raw=False, **operation_config): + run_update_parameters = models.RunUpdateParameters(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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' + 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(run_update_parameters, 'RunUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Run', response) + if response.status_code == 201: + deserialized = self._deserialize('Run', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, run_id, is_archive_enabled=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Patch the run 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 run_id: The run ID. + :type run_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 Run or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_09_01.models.Run] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_01.models.Run]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + run_id=run_id, + is_archive_enabled=is_archive_enabled, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Run', 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}/runs/{runId}'} + + def get_log_sas_url( + self, resource_group_name, registry_name, run_id, custom_headers=None, raw=False, **operation_config): + """Gets a link to download the run 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 run_id: The run ID. + :type run_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: RunGetLogResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_09_01.models.RunGetLogResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_log_sas_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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('RunGetLogResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_log_sas_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl'} + + + def _cancel_initial( + self, resource_group_name, registry_name, run_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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'runId': self._serialize.url("run_id", run_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 = {} + 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, header_parameters) + response = self._client.send(request, 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, run_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Cancel an existing run. + + :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 run_id: The run ID. + :type run_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, + run_id=run_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}/runs/{runId}/cancel'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_tasks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_tasks_operations.py new file mode 100644 index 000000000000..73b751a2041a --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_tasks_operations.py @@ -0,0 +1,545 @@ +# 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 TasksOperations(object): + """TasksOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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-09-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-09-01" + + self.config = config + + def list( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists all the 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 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 Task + :rtype: + ~azure.mgmt.containerregistry.v2018_09_01.models.TaskPaged[~azure.mgmt.containerregistry.v2018_09_01.models.Task] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.TaskPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks'} + + def get( + self, resource_group_name, registry_name, task_name, custom_headers=None, raw=False, **operation_config): + """Get the properties of a specified 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 task_name: The name of the container registry task. + :type 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: Task or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerregistry.v2018_09_01.models.Task 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Task', 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}/tasks/{taskName}'} + + + def _create_initial( + self, resource_group_name, registry_name, task_name, 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' + 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(task_create_parameters, 'Task') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Task', response) + if response.status_code == 201: + deserialized = self._deserialize('Task', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, task_name, task_create_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a 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 task_name: The name of the container registry task. + :type task_name: str + :param task_create_parameters: The parameters for creating a task. + :type task_create_parameters: + ~azure.mgmt.containerregistry.v2018_09_01.models.Task + :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 Task or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_09_01.models.Task] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_01.models.Task]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + task_name=task_name, + task_create_parameters=task_create_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Task', 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}/tasks/{taskName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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 = {} + 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, header_parameters) + response = self._client.send(request, 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, task_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a specified 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 task_name: The name of the container registry task. + :type 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, + task_name=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}/tasks/{taskName}'} + + + def _update_initial( + self, resource_group_name, registry_name, task_name, 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' + 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(task_update_parameters, 'TaskUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Task', response) + if response.status_code == 201: + deserialized = self._deserialize('Task', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, task_name, task_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a 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 task_name: The name of the container registry task. + :type task_name: str + :param task_update_parameters: The parameters for updating a task. + :type task_update_parameters: + ~azure.mgmt.containerregistry.v2018_09_01.models.TaskUpdateParameters + :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 Task or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_09_01.models.Task] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_01.models.Task]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + task_name=task_name, + task_update_parameters=task_update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Task', 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}/tasks/{taskName}'} + + def get_details( + self, resource_group_name, registry_name, task_name, custom_headers=None, raw=False, **operation_config): + """Returns a task with extended information that includes all secrets. + + :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 task_name: The name of the container registry task. + :type 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: Task or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerregistry.v2018_09_01.models.Task or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_details.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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Task', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_webhooks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_webhooks_operations.py new file mode 100644 index 000000000000..1e01bb8381fa --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/_webhooks_operations.py @@ -0,0 +1,691 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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_09_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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_09_01.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_09_01.models.Webhook] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_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 = 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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_09_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.v2018_09_01.models.Webhook] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_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 + ) + + 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_09_01.models.WebhookPaged[~azure.mgmt.containerregistry.v2018_09_01.models.Webhook] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.WebhookPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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_09_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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_09_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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_09_01.models.EventPaged[~azure.mgmt.containerregistry.v2018_09_01.models.Event] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.EventPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_events.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/operations.py deleted file mode 100644 index 394354d46b90..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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_09_01.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2018_09_01.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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/registries_operations.py deleted file mode 100644 index 3eb4e97c317f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/registries_operations.py +++ /dev/null @@ -1,1256 +0,0 @@ -# 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 _import_image_initial( - self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2017-10-01" - - # Construct URL - url = self.import_image.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', min_length=1), - '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(parameters, 'ImportImageParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 import_image( - self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Copies an image to this container registry from 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 parameters: The parameters specifying the image to copy and the - source container registry. - :type parameters: - ~azure.mgmt.containerregistry.v2018_09_01.models.ImportImageParameters - :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._import_image_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - parameters=parameters, - 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) - import_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage'} - - 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_09_01.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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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_09_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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_09_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.v2018_09_01.models.Registry] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_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) - 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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_09_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.v2018_09_01.models.Registry] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_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 - ) - - 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_09_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2018_09_01.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', min_length=1) - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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_09_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2018_09_01.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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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_09_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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_09_01.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_09_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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_09_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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 list_policies( - self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): - """Lists the policies 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: RegistryPolicies or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerregistry.v2018_09_01.models.RegistryPolicies or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2017-10-01" - - # Construct URL - url = self.list_policies.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('RegistryPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'} - - - def _update_policies_initial( - self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, **operation_config): - registry_policies_update_parameters = models.RegistryPolicies(quarantine_policy=quarantine_policy, trust_policy=trust_policy) - - api_version = "2017-10-01" - - # Construct URL - url = self.update_policies.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', min_length=1), - '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['Accept'] = 'application/json' - 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_policies_update_parameters, 'RegistryPolicies') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('RegistryPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update_policies( - self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates the policies 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 quarantine_policy: An object that represents quarantine policy - for a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2018_09_01.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy - for a container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2018_09_01.models.TrustPolicy - :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 RegistryPolicies or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_09_01.models.RegistryPolicies] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_01.models.RegistryPolicies]] - :raises: :class:`CloudError` - """ - raw_result = self._update_policies_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - quarantine_policy=quarantine_policy, - trust_policy=trust_policy, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('RegistryPolicies', 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_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'} - - - def _schedule_run_initial( - self, resource_group_name, registry_name, run_request, custom_headers=None, raw=False, **operation_config): - api_version = "2018-09-01" - - # Construct URL - url = self.schedule_run.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', min_length=1), - '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['Accept'] = 'application/json' - 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(run_request, 'RunRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Run', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def schedule_run( - self, resource_group_name, registry_name, run_request, custom_headers=None, raw=False, polling=True, **operation_config): - """Schedules a new run based on the request parameters and add it to the - run 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 run_request: The parameters of a run that needs to scheduled. - :type run_request: - ~azure.mgmt.containerregistry.v2018_09_01.models.RunRequest - :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 Run or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_09_01.models.Run] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_01.models.Run]] - :raises: :class:`CloudError` - """ - raw_result = self._schedule_run_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - run_request=run_request, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Run', 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) - schedule_run.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun'} - - 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_09_01.models.SourceUploadDefinition - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2018-09-01" - - # 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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}/listBuildSourceUploadUrl'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/replications_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/replications_operations.py deleted file mode 100644 index 6502b1c4b49d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/replications_operations.py +++ /dev/null @@ -1,485 +0,0 @@ -# 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_09_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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_09_01.models.Replication] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_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 = 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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_09_01.models.Replication] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_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 - ) - - 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_09_01.models.ReplicationPaged[~azure.mgmt.containerregistry.v2018_09_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/runs_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/runs_operations.py deleted file mode 100644 index 8de207f2eadd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/runs_operations.py +++ /dev/null @@ -1,450 +0,0 @@ -# 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 RunsOperations(object): - """RunsOperations 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-09-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-09-01" - - self.config = config - - def list( - self, resource_group_name, registry_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """Gets all the runs 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 runs filter to apply on the operation. Arithmetic - operators are not supported. The allowed string function is - 'contains'. All logical operators except 'Not', 'Has', 'All' are - allowed. - :type filter: str - :param top: $top is supported for get list of runs, which limits the - maximum number of runs to return. - :type top: int - :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 Run - :rtype: - ~azure.mgmt.containerregistry.v2018_09_01.models.RunPaged[~azure.mgmt.containerregistry.v2018_09_01.models.Run] - :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', min_length=1), - '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') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.RunPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.RunPaged(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}/runs'} - - def get( - self, resource_group_name, registry_name, run_id, custom_headers=None, raw=False, **operation_config): - """Gets the detailed information for a given run. - - :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 run_id: The run ID. - :type run_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: Run or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerregistry.v2018_09_01.models.Run 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('Run', 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}/runs/{runId}'} - - - def _update_initial( - self, resource_group_name, registry_name, run_id, is_archive_enabled=None, custom_headers=None, raw=False, **operation_config): - run_update_parameters = models.RunUpdateParameters(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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' - 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(run_update_parameters, 'RunUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Run', response) - if response.status_code == 201: - deserialized = self._deserialize('Run', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, registry_name, run_id, is_archive_enabled=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Patch the run 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 run_id: The run ID. - :type run_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 Run or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_09_01.models.Run] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_01.models.Run]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - run_id=run_id, - is_archive_enabled=is_archive_enabled, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Run', 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}/runs/{runId}'} - - def get_log_sas_url( - self, resource_group_name, registry_name, run_id, custom_headers=None, raw=False, **operation_config): - """Gets a link to download the run 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 run_id: The run ID. - :type run_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: RunGetLogResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerregistry.v2018_09_01.models.RunGetLogResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_log_sas_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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('RunGetLogResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_log_sas_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl'} - - - def _cancel_initial( - self, resource_group_name, registry_name, run_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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'runId': self._serialize.url("run_id", run_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 = {} - 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, header_parameters) - response = self._client.send(request, 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, run_id, custom_headers=None, raw=False, polling=True, **operation_config): - """Cancel an existing run. - - :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 run_id: The run ID. - :type run_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, - run_id=run_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}/runs/{runId}/cancel'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/tasks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/tasks_operations.py deleted file mode 100644 index 950477ebcd4c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/tasks_operations.py +++ /dev/null @@ -1,543 +0,0 @@ -# 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 TasksOperations(object): - """TasksOperations 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-09-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-09-01" - - self.config = config - - def list( - self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): - """Lists all the 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 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 Task - :rtype: - ~azure.mgmt.containerregistry.v2018_09_01.models.TaskPaged[~azure.mgmt.containerregistry.v2018_09_01.models.Task] - :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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.TaskPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.TaskPaged(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}/tasks'} - - def get( - self, resource_group_name, registry_name, task_name, custom_headers=None, raw=False, **operation_config): - """Get the properties of a specified 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 task_name: The name of the container registry task. - :type 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: Task or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerregistry.v2018_09_01.models.Task 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('Task', 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}/tasks/{taskName}'} - - - def _create_initial( - self, resource_group_name, registry_name, task_name, 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' - 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(task_create_parameters, 'Task') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Task', response) - if response.status_code == 201: - deserialized = self._deserialize('Task', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, registry_name, task_name, task_create_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates a 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 task_name: The name of the container registry task. - :type task_name: str - :param task_create_parameters: The parameters for creating a task. - :type task_create_parameters: - ~azure.mgmt.containerregistry.v2018_09_01.models.Task - :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 Task or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_09_01.models.Task] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_01.models.Task]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - task_name=task_name, - task_create_parameters=task_create_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Task', 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}/tasks/{taskName}'} - - - def _delete_initial( - self, resource_group_name, registry_name, 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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 = {} - 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, header_parameters) - response = self._client.send(request, 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, task_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes a specified 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 task_name: The name of the container registry task. - :type 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, - task_name=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}/tasks/{taskName}'} - - - def _update_initial( - self, resource_group_name, registry_name, task_name, 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' - 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(task_update_parameters, 'TaskUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Task', response) - if response.status_code == 201: - deserialized = self._deserialize('Task', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, registry_name, task_name, task_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates a 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 task_name: The name of the container registry task. - :type task_name: str - :param task_update_parameters: The parameters for updating a task. - :type task_update_parameters: - ~azure.mgmt.containerregistry.v2018_09_01.models.TaskUpdateParameters - :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 Task or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_09_01.models.Task] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_01.models.Task]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - task_name=task_name, - task_update_parameters=task_update_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Task', 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}/tasks/{taskName}'} - - def get_details( - self, resource_group_name, registry_name, task_name, custom_headers=None, raw=False, **operation_config): - """Returns a task with extended information that includes all secrets. - - :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 task_name: The name of the container registry task. - :type 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: Task or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerregistry.v2018_09_01.models.Task or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_details.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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('Task', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/webhooks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/webhooks_operations.py deleted file mode 100644 index 398b15ae82e3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_09_01/operations/webhooks_operations.py +++ /dev/null @@ -1,688 +0,0 @@ -# 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_09_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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_09_01.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_09_01.models.Webhook] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_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 = 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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_09_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.v2018_09_01.models.Webhook] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_09_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 - ) - - 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_09_01.models.WebhookPaged[~azure.mgmt.containerregistry.v2018_09_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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_09_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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_09_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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_09_01.models.EventPaged[~azure.mgmt.containerregistry.v2018_09_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/__init__.py index 511d3d37a4aa..81ad2ac1ed64 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .container_registry_management_client import ContainerRegistryManagementClient -from .version import VERSION +from ._configuration import ContainerRegistryManagementClientConfiguration +from ._container_registry_management_client import ContainerRegistryManagementClient +__all__ = ['ContainerRegistryManagementClient', 'ContainerRegistryManagementClientConfiguration'] -__all__ = ['ContainerRegistryManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/_configuration.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/_configuration.py new file mode 100644 index 000000000000..4e021787210f --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +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) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + 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 diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/_container_registry_management_client.py new file mode 100644 index 000000000000..ba5f25698ab6 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/_container_registry_management_client.py @@ -0,0 +1,73 @@ +# 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 ._configuration import ContainerRegistryManagementClientConfiguration +from .operations import RegistriesOperations +from .operations import Operations +from .operations import ReplicationsOperations +from .operations import WebhooksOperations +from .operations import RunsOperations +from .operations import TasksOperations +from . import models + + +class ContainerRegistryManagementClient(SDKClient): + """ContainerRegistryManagementClient + + :ivar config: Configuration for client. + :vartype config: ContainerRegistryManagementClientConfiguration + + :ivar registries: Registries operations + :vartype registries: azure.mgmt.containerregistry.v2019_04_01.operations.RegistriesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerregistry.v2019_04_01.operations.Operations + :ivar replications: Replications operations + :vartype replications: azure.mgmt.containerregistry.v2019_04_01.operations.ReplicationsOperations + :ivar webhooks: Webhooks operations + :vartype webhooks: azure.mgmt.containerregistry.v2019_04_01.operations.WebhooksOperations + :ivar runs: Runs operations + :vartype runs: azure.mgmt.containerregistry.v2019_04_01.operations.RunsOperations + :ivar tasks: Tasks operations + :vartype tasks: azure.mgmt.containerregistry.v2019_04_01.operations.TasksOperations + + :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.runs = RunsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tasks = TasksOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/container_registry_management_client.py deleted file mode 100644 index 752405907b34..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/container_registry_management_client.py +++ /dev/null @@ -1,105 +0,0 @@ -# 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.runs_operations import RunsOperations -from .operations.tasks_operations import TasksOperations -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.v2019_04_01.operations.RegistriesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.containerregistry.v2019_04_01.operations.Operations - :ivar replications: Replications operations - :vartype replications: azure.mgmt.containerregistry.v2019_04_01.operations.ReplicationsOperations - :ivar webhooks: Webhooks operations - :vartype webhooks: azure.mgmt.containerregistry.v2019_04_01.operations.WebhooksOperations - :ivar runs: Runs operations - :vartype runs: azure.mgmt.containerregistry.v2019_04_01.operations.RunsOperations - :ivar tasks: Tasks operations - :vartype tasks: azure.mgmt.containerregistry.v2019_04_01.operations.TasksOperations - - :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.runs = RunsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.tasks = TasksOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/__init__.py index aec547cd04a7..6d5831a4b5d2 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/__init__.py @@ -10,195 +10,195 @@ # -------------------------------------------------------------------------- try: - from .import_source_credentials_py3 import ImportSourceCredentials - from .import_source_py3 import ImportSource - from .import_image_parameters_py3 import ImportImageParameters - from .registry_name_check_request_py3 import RegistryNameCheckRequest - from .registry_name_status_py3 import RegistryNameStatus - from .operation_display_definition_py3 import OperationDisplayDefinition - from .operation_metric_specification_definition_py3 import OperationMetricSpecificationDefinition - from .operation_service_specification_definition_py3 import OperationServiceSpecificationDefinition - from .operation_definition_py3 import OperationDefinition - from .sku_py3 import Sku - from .status_py3 import Status - from .storage_account_properties_py3 import StorageAccountProperties - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - 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 .quarantine_policy_py3 import QuarantinePolicy - from .trust_policy_py3 import TrustPolicy - from .registry_policies_py3 import RegistryPolicies - 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 .run_request_py3 import RunRequest - from .image_descriptor_py3 import ImageDescriptor - from .image_update_trigger_py3 import ImageUpdateTrigger - from .source_trigger_descriptor_py3 import SourceTriggerDescriptor - from .platform_properties_py3 import PlatformProperties - from .agent_properties_py3 import AgentProperties - from .timer_trigger_descriptor_py3 import TimerTriggerDescriptor - from .run_py3 import Run - from .source_upload_definition_py3 import SourceUploadDefinition - from .run_filter_py3 import RunFilter - from .run_update_parameters_py3 import RunUpdateParameters - from .run_get_log_result_py3 import RunGetLogResult - from .user_identity_properties_py3 import UserIdentityProperties - from .identity_properties_py3 import IdentityProperties - from .base_image_dependency_py3 import BaseImageDependency - from .task_step_properties_py3 import TaskStepProperties - from .timer_trigger_py3 import TimerTrigger - from .auth_info_py3 import AuthInfo - from .source_properties_py3 import SourceProperties - from .source_trigger_py3 import SourceTrigger - from .base_image_trigger_py3 import BaseImageTrigger - from .trigger_properties_py3 import TriggerProperties - from .source_registry_credentials_py3 import SourceRegistryCredentials - from .secret_object_py3 import SecretObject - from .custom_registry_credentials_py3 import CustomRegistryCredentials - from .credentials_py3 import Credentials - from .task_py3 import Task - from .platform_update_parameters_py3 import PlatformUpdateParameters - from .task_step_update_parameters_py3 import TaskStepUpdateParameters - from .timer_trigger_update_parameters_py3 import TimerTriggerUpdateParameters - from .auth_info_update_parameters_py3 import AuthInfoUpdateParameters - from .source_update_parameters_py3 import SourceUpdateParameters - from .source_trigger_update_parameters_py3 import SourceTriggerUpdateParameters - from .base_image_trigger_update_parameters_py3 import BaseImageTriggerUpdateParameters - from .trigger_update_parameters_py3 import TriggerUpdateParameters - from .task_update_parameters_py3 import TaskUpdateParameters - from .proxy_resource_py3 import ProxyResource - from .argument_py3 import Argument - from .docker_build_request_py3 import DockerBuildRequest - from .set_value_py3 import SetValue - from .file_task_run_request_py3 import FileTaskRunRequest - from .task_run_request_py3 import TaskRunRequest - from .encoded_task_run_request_py3 import EncodedTaskRunRequest - from .docker_build_step_py3 import DockerBuildStep - from .file_task_step_py3 import FileTaskStep - from .encoded_task_step_py3 import EncodedTaskStep - from .docker_build_step_update_parameters_py3 import DockerBuildStepUpdateParameters - from .file_task_step_update_parameters_py3 import FileTaskStepUpdateParameters - from .encoded_task_step_update_parameters_py3 import EncodedTaskStepUpdateParameters + from ._models_py3 import Actor + from ._models_py3 import AgentProperties + from ._models_py3 import Argument + from ._models_py3 import AuthInfo + from ._models_py3 import AuthInfoUpdateParameters + from ._models_py3 import BaseImageDependency + from ._models_py3 import BaseImageTrigger + from ._models_py3 import BaseImageTriggerUpdateParameters + from ._models_py3 import CallbackConfig + from ._models_py3 import Credentials + from ._models_py3 import CustomRegistryCredentials + from ._models_py3 import DockerBuildRequest + from ._models_py3 import DockerBuildStep + from ._models_py3 import DockerBuildStepUpdateParameters + from ._models_py3 import EncodedTaskRunRequest + from ._models_py3 import EncodedTaskStep + from ._models_py3 import EncodedTaskStepUpdateParameters + from ._models_py3 import Event + from ._models_py3 import EventContent + from ._models_py3 import EventInfo + from ._models_py3 import EventRequestMessage + from ._models_py3 import EventResponseMessage + from ._models_py3 import FileTaskRunRequest + from ._models_py3 import FileTaskStep + from ._models_py3 import FileTaskStepUpdateParameters + from ._models_py3 import IdentityProperties + from ._models_py3 import ImageDescriptor + from ._models_py3 import ImageUpdateTrigger + from ._models_py3 import ImportImageParameters + from ._models_py3 import ImportSource + from ._models_py3 import ImportSourceCredentials + from ._models_py3 import IPRule + from ._models_py3 import NetworkRuleSet + from ._models_py3 import OperationDefinition + from ._models_py3 import OperationDisplayDefinition + from ._models_py3 import OperationMetricSpecificationDefinition + from ._models_py3 import OperationServiceSpecificationDefinition + from ._models_py3 import PlatformProperties + from ._models_py3 import PlatformUpdateParameters + from ._models_py3 import ProxyResource + from ._models_py3 import QuarantinePolicy + from ._models_py3 import RegenerateCredentialParameters + from ._models_py3 import Registry + from ._models_py3 import RegistryListCredentialsResult + from ._models_py3 import RegistryNameCheckRequest + from ._models_py3 import RegistryNameStatus + from ._models_py3 import RegistryPassword + from ._models_py3 import RegistryPolicies + from ._models_py3 import RegistryUpdateParameters + from ._models_py3 import RegistryUsage + from ._models_py3 import RegistryUsageListResult + from ._models_py3 import Replication + from ._models_py3 import ReplicationUpdateParameters + from ._models_py3 import Request + from ._models_py3 import Resource + from ._models_py3 import Run + from ._models_py3 import RunFilter + from ._models_py3 import RunGetLogResult + from ._models_py3 import RunRequest + from ._models_py3 import RunUpdateParameters + from ._models_py3 import SecretObject + from ._models_py3 import SetValue + from ._models_py3 import Sku + from ._models_py3 import Source + from ._models_py3 import SourceProperties + from ._models_py3 import SourceRegistryCredentials + from ._models_py3 import SourceTrigger + from ._models_py3 import SourceTriggerDescriptor + from ._models_py3 import SourceTriggerUpdateParameters + from ._models_py3 import SourceUpdateParameters + from ._models_py3 import SourceUploadDefinition + from ._models_py3 import Status + from ._models_py3 import StorageAccountProperties + from ._models_py3 import Target + from ._models_py3 import Task + from ._models_py3 import TaskRunRequest + from ._models_py3 import TaskStepProperties + from ._models_py3 import TaskStepUpdateParameters + from ._models_py3 import TaskUpdateParameters + from ._models_py3 import TimerTrigger + from ._models_py3 import TimerTriggerDescriptor + from ._models_py3 import TimerTriggerUpdateParameters + from ._models_py3 import TriggerProperties + from ._models_py3 import TriggerUpdateParameters + from ._models_py3 import TrustPolicy + from ._models_py3 import UserIdentityProperties + from ._models_py3 import VirtualNetworkRule + from ._models_py3 import Webhook + from ._models_py3 import WebhookCreateParameters + from ._models_py3 import WebhookUpdateParameters except (SyntaxError, ImportError): - from .import_source_credentials import ImportSourceCredentials - from .import_source import ImportSource - from .import_image_parameters import ImportImageParameters - from .registry_name_check_request import RegistryNameCheckRequest - from .registry_name_status import RegistryNameStatus - from .operation_display_definition import OperationDisplayDefinition - from .operation_metric_specification_definition import OperationMetricSpecificationDefinition - from .operation_service_specification_definition import OperationServiceSpecificationDefinition - from .operation_definition import OperationDefinition - from .sku import Sku - from .status import Status - from .storage_account_properties import StorageAccountProperties - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - 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 .quarantine_policy import QuarantinePolicy - from .trust_policy import TrustPolicy - from .registry_policies import RegistryPolicies - 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 .run_request import RunRequest - from .image_descriptor import ImageDescriptor - from .image_update_trigger import ImageUpdateTrigger - from .source_trigger_descriptor import SourceTriggerDescriptor - from .platform_properties import PlatformProperties - from .agent_properties import AgentProperties - from .timer_trigger_descriptor import TimerTriggerDescriptor - from .run import Run - from .source_upload_definition import SourceUploadDefinition - from .run_filter import RunFilter - from .run_update_parameters import RunUpdateParameters - from .run_get_log_result import RunGetLogResult - from .user_identity_properties import UserIdentityProperties - from .identity_properties import IdentityProperties - from .base_image_dependency import BaseImageDependency - from .task_step_properties import TaskStepProperties - from .timer_trigger import TimerTrigger - from .auth_info import AuthInfo - from .source_properties import SourceProperties - from .source_trigger import SourceTrigger - from .base_image_trigger import BaseImageTrigger - from .trigger_properties import TriggerProperties - from .source_registry_credentials import SourceRegistryCredentials - from .secret_object import SecretObject - from .custom_registry_credentials import CustomRegistryCredentials - from .credentials import Credentials - from .task import Task - from .platform_update_parameters import PlatformUpdateParameters - from .task_step_update_parameters import TaskStepUpdateParameters - from .timer_trigger_update_parameters import TimerTriggerUpdateParameters - from .auth_info_update_parameters import AuthInfoUpdateParameters - from .source_update_parameters import SourceUpdateParameters - from .source_trigger_update_parameters import SourceTriggerUpdateParameters - from .base_image_trigger_update_parameters import BaseImageTriggerUpdateParameters - from .trigger_update_parameters import TriggerUpdateParameters - from .task_update_parameters import TaskUpdateParameters - from .proxy_resource import ProxyResource - from .argument import Argument - from .docker_build_request import DockerBuildRequest - from .set_value import SetValue - from .file_task_run_request import FileTaskRunRequest - from .task_run_request import TaskRunRequest - from .encoded_task_run_request import EncodedTaskRunRequest - from .docker_build_step import DockerBuildStep - from .file_task_step import FileTaskStep - from .encoded_task_step import EncodedTaskStep - from .docker_build_step_update_parameters import DockerBuildStepUpdateParameters - from .file_task_step_update_parameters import FileTaskStepUpdateParameters - from .encoded_task_step_update_parameters import EncodedTaskStepUpdateParameters -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 .run_paged import RunPaged -from .task_paged import TaskPaged -from .container_registry_management_client_enums import ( + from ._models import Actor + from ._models import AgentProperties + from ._models import Argument + from ._models import AuthInfo + from ._models import AuthInfoUpdateParameters + from ._models import BaseImageDependency + from ._models import BaseImageTrigger + from ._models import BaseImageTriggerUpdateParameters + from ._models import CallbackConfig + from ._models import Credentials + from ._models import CustomRegistryCredentials + from ._models import DockerBuildRequest + from ._models import DockerBuildStep + from ._models import DockerBuildStepUpdateParameters + from ._models import EncodedTaskRunRequest + from ._models import EncodedTaskStep + from ._models import EncodedTaskStepUpdateParameters + from ._models import Event + from ._models import EventContent + from ._models import EventInfo + from ._models import EventRequestMessage + from ._models import EventResponseMessage + from ._models import FileTaskRunRequest + from ._models import FileTaskStep + from ._models import FileTaskStepUpdateParameters + from ._models import IdentityProperties + from ._models import ImageDescriptor + from ._models import ImageUpdateTrigger + from ._models import ImportImageParameters + from ._models import ImportSource + from ._models import ImportSourceCredentials + from ._models import IPRule + from ._models import NetworkRuleSet + from ._models import OperationDefinition + from ._models import OperationDisplayDefinition + from ._models import OperationMetricSpecificationDefinition + from ._models import OperationServiceSpecificationDefinition + from ._models import PlatformProperties + from ._models import PlatformUpdateParameters + from ._models import ProxyResource + from ._models import QuarantinePolicy + from ._models import RegenerateCredentialParameters + from ._models import Registry + from ._models import RegistryListCredentialsResult + from ._models import RegistryNameCheckRequest + from ._models import RegistryNameStatus + from ._models import RegistryPassword + from ._models import RegistryPolicies + from ._models import RegistryUpdateParameters + from ._models import RegistryUsage + from ._models import RegistryUsageListResult + from ._models import Replication + from ._models import ReplicationUpdateParameters + from ._models import Request + from ._models import Resource + from ._models import Run + from ._models import RunFilter + from ._models import RunGetLogResult + from ._models import RunRequest + from ._models import RunUpdateParameters + from ._models import SecretObject + from ._models import SetValue + from ._models import Sku + from ._models import Source + from ._models import SourceProperties + from ._models import SourceRegistryCredentials + from ._models import SourceTrigger + from ._models import SourceTriggerDescriptor + from ._models import SourceTriggerUpdateParameters + from ._models import SourceUpdateParameters + from ._models import SourceUploadDefinition + from ._models import Status + from ._models import StorageAccountProperties + from ._models import Target + from ._models import Task + from ._models import TaskRunRequest + from ._models import TaskStepProperties + from ._models import TaskStepUpdateParameters + from ._models import TaskUpdateParameters + from ._models import TimerTrigger + from ._models import TimerTriggerDescriptor + from ._models import TimerTriggerUpdateParameters + from ._models import TriggerProperties + from ._models import TriggerUpdateParameters + from ._models import TrustPolicy + from ._models import UserIdentityProperties + from ._models import VirtualNetworkRule + from ._models import Webhook + from ._models import WebhookCreateParameters + from ._models import WebhookUpdateParameters +from ._paged_models import EventPaged +from ._paged_models import OperationDefinitionPaged +from ._paged_models import RegistryPaged +from ._paged_models import ReplicationPaged +from ._paged_models import RunPaged +from ._paged_models import TaskPaged +from ._paged_models import WebhookPaged +from ._container_registry_management_client_enums import ( ImportMode, SkuName, SkuTier, @@ -229,96 +229,96 @@ ) __all__ = [ - 'ImportSourceCredentials', - 'ImportSource', + 'Actor', + 'AgentProperties', + 'Argument', + 'AuthInfo', + 'AuthInfoUpdateParameters', + 'BaseImageDependency', + 'BaseImageTrigger', + 'BaseImageTriggerUpdateParameters', + 'CallbackConfig', + 'Credentials', + 'CustomRegistryCredentials', + 'DockerBuildRequest', + 'DockerBuildStep', + 'DockerBuildStepUpdateParameters', + 'EncodedTaskRunRequest', + 'EncodedTaskStep', + 'EncodedTaskStepUpdateParameters', + 'Event', + 'EventContent', + 'EventInfo', + 'EventRequestMessage', + 'EventResponseMessage', + 'FileTaskRunRequest', + 'FileTaskStep', + 'FileTaskStepUpdateParameters', + 'IdentityProperties', + 'ImageDescriptor', + 'ImageUpdateTrigger', 'ImportImageParameters', - 'RegistryNameCheckRequest', - 'RegistryNameStatus', + 'ImportSource', + 'ImportSourceCredentials', + 'IPRule', + 'NetworkRuleSet', + 'OperationDefinition', 'OperationDisplayDefinition', 'OperationMetricSpecificationDefinition', 'OperationServiceSpecificationDefinition', - 'OperationDefinition', - 'Sku', - 'Status', - 'StorageAccountProperties', - 'VirtualNetworkRule', - 'IPRule', - 'NetworkRuleSet', + 'PlatformProperties', + 'PlatformUpdateParameters', + 'ProxyResource', + 'QuarantinePolicy', + 'RegenerateCredentialParameters', 'Registry', - 'RegistryUpdateParameters', - 'RegistryPassword', 'RegistryListCredentialsResult', - 'RegenerateCredentialParameters', + 'RegistryNameCheckRequest', + 'RegistryNameStatus', + 'RegistryPassword', + 'RegistryPolicies', + 'RegistryUpdateParameters', 'RegistryUsage', 'RegistryUsageListResult', - 'QuarantinePolicy', - 'TrustPolicy', - 'RegistryPolicies', 'Replication', 'ReplicationUpdateParameters', - 'Webhook', - 'WebhookCreateParameters', - 'WebhookUpdateParameters', - 'EventInfo', - 'CallbackConfig', - 'Target', 'Request', - 'Actor', - 'Source', - 'EventContent', - 'EventRequestMessage', - 'EventResponseMessage', - 'Event', 'Resource', - 'RunRequest', - 'ImageDescriptor', - 'ImageUpdateTrigger', - 'SourceTriggerDescriptor', - 'PlatformProperties', - 'AgentProperties', - 'TimerTriggerDescriptor', 'Run', - 'SourceUploadDefinition', 'RunFilter', - 'RunUpdateParameters', 'RunGetLogResult', - 'UserIdentityProperties', - 'IdentityProperties', - 'BaseImageDependency', - 'TaskStepProperties', - 'TimerTrigger', - 'AuthInfo', + 'RunRequest', + 'RunUpdateParameters', + 'SecretObject', + 'SetValue', + 'Sku', + 'Source', 'SourceProperties', - 'SourceTrigger', - 'BaseImageTrigger', - 'TriggerProperties', 'SourceRegistryCredentials', - 'SecretObject', - 'CustomRegistryCredentials', - 'Credentials', + 'SourceTrigger', + 'SourceTriggerDescriptor', + 'SourceTriggerUpdateParameters', + 'SourceUpdateParameters', + 'SourceUploadDefinition', + 'Status', + 'StorageAccountProperties', + 'Target', 'Task', - 'PlatformUpdateParameters', + 'TaskRunRequest', + 'TaskStepProperties', 'TaskStepUpdateParameters', + 'TaskUpdateParameters', + 'TimerTrigger', + 'TimerTriggerDescriptor', 'TimerTriggerUpdateParameters', - 'AuthInfoUpdateParameters', - 'SourceUpdateParameters', - 'SourceTriggerUpdateParameters', - 'BaseImageTriggerUpdateParameters', + 'TriggerProperties', 'TriggerUpdateParameters', - 'TaskUpdateParameters', - 'ProxyResource', - 'Argument', - 'DockerBuildRequest', - 'SetValue', - 'FileTaskRunRequest', - 'TaskRunRequest', - 'EncodedTaskRunRequest', - 'DockerBuildStep', - 'FileTaskStep', - 'EncodedTaskStep', - 'DockerBuildStepUpdateParameters', - 'FileTaskStepUpdateParameters', - 'EncodedTaskStepUpdateParameters', + 'TrustPolicy', + 'UserIdentityProperties', + 'VirtualNetworkRule', + 'Webhook', + 'WebhookCreateParameters', + 'WebhookUpdateParameters', 'RegistryPaged', 'OperationDefinitionPaged', 'ReplicationPaged', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/container_registry_management_client_enums.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/_container_registry_management_client_enums.py similarity index 100% rename from sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/container_registry_management_client_enums.py rename to sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/_container_registry_management_client_enums.py diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/_models.py new file mode 100644 index 000000000000..127ab5e5af4a --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/_models.py @@ -0,0 +1,3420 @@ +# 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) + + +class AgentProperties(Model): + """The properties that determine the run agent configuration. + + :param cpu: The CPU configuration in terms of number of cores required for + the run. + :type cpu: int + """ + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AgentProperties, self).__init__(**kwargs) + self.cpu = kwargs.get('cpu', None) + + +class Argument(Model): + """The properties of a run argument. + + All required parameters must be populated in order to send to Azure. + + :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 = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Argument, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.is_secret = kwargs.get('is_secret', False) + + +class AuthInfo(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: Required. The type of Auth token. Possible values + include: 'PAT', 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.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_type': {'required': True}, + '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(AuthInfo, 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) + + +class AuthInfoUpdateParameters(Model): + """The authorization properties for accessing the source code repository. + + :param token_type: The type of Auth token. Possible values include: 'PAT', + 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TokenType + :param token: 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 + """ + + _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(AuthInfoUpdateParameters, 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) + + +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.v2019_04_01.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) + + +class BaseImageTrigger(Model): + """The trigger based on base image dependency. + + All required parameters must be populated in order to send to Azure. + + :param base_image_trigger_type: Required. The type of the auto trigger for + base image dependency updates. Possible values include: 'All', 'Runtime' + :type base_image_trigger_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerType + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'base_image_trigger_type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BaseImageTrigger, self).__init__(**kwargs) + self.base_image_trigger_type = kwargs.get('base_image_trigger_type', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class BaseImageTriggerUpdateParameters(Model): + """The properties for updating base image dependency trigger. + + All required parameters must be populated in order to send to Azure. + + :param base_image_trigger_type: The type of the auto trigger for base + image dependency updates. Possible values include: 'All', 'Runtime' + :type base_image_trigger_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerType + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BaseImageTriggerUpdateParameters, self).__init__(**kwargs) + self.base_image_trigger_type = kwargs.get('base_image_trigger_type', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +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) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class Credentials(Model): + """The parameters that describes a set of credentials that will be used when a + run is invoked. + + :param source_registry: Describes the credential parameters for accessing + the source registry. + :type source_registry: + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceRegistryCredentials + :param custom_registries: Describes the credential parameters for + accessing other custom registries. The key + for the dictionary item will be the registry login server + (myregistry.azurecr.io) and + the value of the item will be the registry credentials for accessing the + registry. + :type custom_registries: dict[str, + ~azure.mgmt.containerregistry.v2019_04_01.models.CustomRegistryCredentials] + """ + + _attribute_map = { + 'source_registry': {'key': 'sourceRegistry', 'type': 'SourceRegistryCredentials'}, + 'custom_registries': {'key': 'customRegistries', 'type': '{CustomRegistryCredentials}'}, + } + + def __init__(self, **kwargs): + super(Credentials, self).__init__(**kwargs) + self.source_registry = kwargs.get('source_registry', None) + self.custom_registries = kwargs.get('custom_registries', None) + + +class CustomRegistryCredentials(Model): + """Describes the credentials that will be used to access a custom registry + during a run. + + :param user_name: The username for logging into the custom registry. + :type user_name: + ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObject + :param password: The password for logging into the custom registry. The + password is a secret + object that allows multiple ways of providing the value for it. + :type password: + ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObject + :param identity: Indicates the managed identity assigned to the custom + credential. If a user-assigned identity + this value is the Client ID. If a system-assigned identity, the value will + be `system`. In + the case of a system-assigned identity, the Client ID will be determined + by the runner. This + identity may be used to authenticate to key vault to retrieve credentials + or it may be the only + source of authentication used for accessing the registry. + :type identity: str + """ + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'SecretObject'}, + 'password': {'key': 'password', 'type': 'SecretObject'}, + 'identity': {'key': 'identity', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomRegistryCredentials, self).__init__(**kwargs) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) + self.identity = kwargs.get('identity', None) + + +class RunRequest(Model): + """The request parameters for scheduling a run. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildRequest, FileTaskRunRequest, TaskRunRequest, + EncodedTaskRunRequest + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} + } + + def __init__(self, **kwargs): + super(RunRequest, self).__init__(**kwargs) + self.is_archive_enabled = kwargs.get('is_archive_enabled', False) + self.type = None + + +class DockerBuildRequest(RunRequest): + """The parameters for a docker quick build. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :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 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: Required. The Docker file path relative to the + source location. + :type docker_file_path: str + :param target: The name of the target build stage for the docker build. + :type target: str + :param arguments: The collection of override arguments to be used when + executing the run. + :type arguments: + list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'docker_file_path': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', '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'}, + 'target': {'key': 'target', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, **kwargs): + super(DockerBuildRequest, self).__init__(**kwargs) + 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.target = kwargs.get('target', None) + self.arguments = kwargs.get('arguments', None) + self.timeout = kwargs.get('timeout', 3600) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.source_location = kwargs.get('source_location', None) + self.credentials = kwargs.get('credentials', None) + self.type = 'DockerBuildRequest' + + +class TaskStepProperties(Model): + """Base properties for any task step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStep, FileTaskStep, EncodedTaskStep + + 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStep', 'FileTask': 'FileTaskStep', 'EncodedTask': 'EncodedTaskStep'} + } + + def __init__(self, **kwargs): + super(TaskStepProperties, self).__init__(**kwargs) + self.base_image_dependencies = None + self.context_path = kwargs.get('context_path', None) + self.context_access_token = kwargs.get('context_access_token', None) + self.type = None + + +class DockerBuildStep(TaskStepProperties): + """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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :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 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: Required. The Docker file path relative to the + source context. + :type docker_file_path: str + :param target: The name of the target build stage for the docker build. + :type target: str + :param arguments: The collection of override arguments to be used when + executing this build step. + :type arguments: + list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'docker_file_path': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + 'target': {'key': 'target', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + } + + def __init__(self, **kwargs): + super(DockerBuildStep, self).__init__(**kwargs) + 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.target = kwargs.get('target', None) + self.arguments = kwargs.get('arguments', None) + self.type = 'Docker' + + +class TaskStepUpdateParameters(Model): + """Base properties for updating any task step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStepUpdateParameters, + FileTaskStepUpdateParameters, EncodedTaskStepUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStepUpdateParameters', 'FileTask': 'FileTaskStepUpdateParameters', 'EncodedTask': 'EncodedTaskStepUpdateParameters'} + } + + def __init__(self, **kwargs): + super(TaskStepUpdateParameters, self).__init__(**kwargs) + self.context_path = kwargs.get('context_path', None) + self.context_access_token = kwargs.get('context_access_token', None) + self.type = None + + +class DockerBuildStepUpdateParameters(TaskStepUpdateParameters): + """The properties for updating a docker build step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :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 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 + context. + :type docker_file_path: str + :param arguments: The collection of override arguments to be used when + executing this build step. + :type arguments: + list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument] + :param target: The name of the target build stage for the docker build. + :type target: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DockerBuildStepUpdateParameters, self).__init__(**kwargs) + 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.arguments = kwargs.get('arguments', None) + self.target = kwargs.get('target', None) + self.type = 'Docker' + + +class EncodedTaskRunRequest(RunRequest): + """The parameters for a quick task run request. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Required. Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'encoded_task_content': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, **kwargs): + super(EncodedTaskRunRequest, self).__init__(**kwargs) + self.encoded_task_content = kwargs.get('encoded_task_content', None) + self.encoded_values_content = kwargs.get('encoded_values_content', None) + self.values = kwargs.get('values', None) + self.timeout = kwargs.get('timeout', 3600) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.source_location = kwargs.get('source_location', None) + self.credentials = kwargs.get('credentials', None) + self.type = 'EncodedTaskRunRequest' + + +class EncodedTaskStep(TaskStepProperties): + """The properties of a encoded task 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Required. Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'encoded_task_content': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(EncodedTaskStep, self).__init__(**kwargs) + self.encoded_task_content = kwargs.get('encoded_task_content', None) + self.encoded_values_content = kwargs.get('encoded_values_content', None) + self.values = kwargs.get('values', None) + self.type = 'EncodedTask' + + +class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters): + """The properties for updating encoded task step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(EncodedTaskStepUpdateParameters, self).__init__(**kwargs) + self.encoded_task_content = kwargs.get('encoded_task_content', None) + self.encoded_values_content = kwargs.get('encoded_values_content', None) + self.values = kwargs.get('values', None) + self.type = 'EncodedTask' + + +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) + + +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.v2019_04_01.models.EventRequestMessage + :param event_response_message: The event response message received from + the service URI. + :type event_response_message: + ~azure.mgmt.containerregistry.v2019_04_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, **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) + + +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.v2019_04_01.models.Target + :param request: The request that generated the event. + :type request: ~azure.mgmt.containerregistry.v2019_04_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.v2019_04_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.v2019_04_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, **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) + + +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.v2019_04_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, **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) + + +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) + + +class FileTaskRunRequest(RunRequest): + """The request parameters for a scheduling run against a task file. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: Required. The template/definition file path + relative to the source. + :type task_file_path: str + :param values_file_path: The values/parameters file path relative to the + source. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'task_file_path': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, **kwargs): + super(FileTaskRunRequest, self).__init__(**kwargs) + self.task_file_path = kwargs.get('task_file_path', None) + self.values_file_path = kwargs.get('values_file_path', None) + self.values = kwargs.get('values', None) + self.timeout = kwargs.get('timeout', 3600) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.source_location = kwargs.get('source_location', None) + self.credentials = kwargs.get('credentials', None) + self.type = 'FileTaskRunRequest' + + +class FileTaskStep(TaskStepProperties): + """The properties of a task 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: Required. The task template/definition file path + relative to the source context. + :type task_file_path: str + :param values_file_path: The task values/parameters file path relative to + the source context. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'task_file_path': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(FileTaskStep, self).__init__(**kwargs) + self.task_file_path = kwargs.get('task_file_path', None) + self.values_file_path = kwargs.get('values_file_path', None) + self.values = kwargs.get('values', None) + self.type = 'FileTask' + + +class FileTaskStepUpdateParameters(TaskStepUpdateParameters): + """The properties of updating a task step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: The task template/definition file path relative to + the source context. + :type task_file_path: str + :param values_file_path: The values/parameters file path relative to the + source context. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(FileTaskStepUpdateParameters, self).__init__(**kwargs) + self.task_file_path = kwargs.get('task_file_path', None) + self.values_file_path = kwargs.get('values_file_path', None) + self.values = kwargs.get('values', None) + self.type = 'FileTask' + + +class IdentityProperties(Model): + """Managed identity for the resource. + + :param principal_id: The principal ID of resource identity. + :type principal_id: str + :param tenant_id: The tenant ID of resource. + :type tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned', + 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated + with the resource. The user identity + dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.containerregistry.v2019_04_01.models.UserIdentityProperties] + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentityProperties}'}, + } + + def __init__(self, **kwargs): + super(IdentityProperties, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +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) + + +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.v2019_04_01.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) + + +class ImportImageParameters(Model): + """ImportImageParameters. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the image. + :type source: + ~azure.mgmt.containerregistry.v2019_04_01.models.ImportSource + :param target_tags: List of strings of the form repo[:tag]. When tag is + omitted the source will be used (or 'latest' if source tag is also + omitted). + :type target_tags: list[str] + :param untagged_target_repositories: List of strings of repository names + to do a manifest only copy. No tag will be created. + :type untagged_target_repositories: list[str] + :param mode: When Force, any existing target tags will be overwritten. + When NoForce, any existing target tags will fail the operation before any + copying begins. Possible values include: 'NoForce', 'Force'. Default + value: "NoForce" . + :type mode: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.ImportMode + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ImportSource'}, + 'target_tags': {'key': 'targetTags', 'type': '[str]'}, + 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportImageParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.target_tags = kwargs.get('target_tags', None) + self.untagged_target_repositories = kwargs.get('untagged_target_repositories', None) + self.mode = kwargs.get('mode', "NoForce") + + +class ImportSource(Model): + """ImportSource. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: The resource identifier of the source Azure Container + Registry. + :type resource_id: str + :param registry_uri: The address of the source registry (e.g. + 'mcr.microsoft.com'). + :type registry_uri: str + :param credentials: Credentials used when importing from a registry uri. + :type credentials: + ~azure.mgmt.containerregistry.v2019_04_01.models.ImportSourceCredentials + :param source_image: Required. Repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' + tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest + ('hello-world@sha256:abc123'). + :type source_image: str + """ + + _validation = { + 'source_image': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'registry_uri': {'key': 'registryUri', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, + 'source_image': {'key': 'sourceImage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportSource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.registry_uri = kwargs.get('registry_uri', None) + self.credentials = kwargs.get('credentials', None) + self.source_image = kwargs.get('source_image', None) + + +class ImportSourceCredentials(Model): + """ImportSourceCredentials. + + All required parameters must be populated in order to send to Azure. + + :param username: The username to authenticate with the source registry. + :type username: str + :param password: Required. The password used to authenticate with the + source registry. + :type password: str + """ + + _validation = { + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportSourceCredentials, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.Action + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.action = kwargs.get('action', "Allow") + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + + +class NetworkRuleSet(Model): + """The network rule set for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Required. The default action of allow or deny when + no other rules match. Possible values include: 'Allow', 'Deny'. Default + value: "Allow" . + :type default_action: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.DefaultAction + :param virtual_network_rules: The virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.containerregistry.v2019_04_01.models.VirtualNetworkRule] + :param ip_rules: The IP ACL rules. + :type ip_rules: + list[~azure.mgmt.containerregistry.v2019_04_01.models.IPRule] + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = kwargs.get('default_action', "Allow") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param origin: The origin information of the container registry operation. + :type origin: str + :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.v2019_04_01.models.OperationDisplayDefinition + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2019_04_01.models.OperationServiceSpecificationDefinition + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, + } + + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.origin = kwargs.get('origin', None) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.service_specification = kwargs.get('service_specification', None) + + +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) + + +class OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) + + +class OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2019_04_01.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, **kwargs): + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class PlatformProperties(Model): + """The platform properties against which the run has to happen. + + All required parameters must be populated in order to send to Azure. + + :param os: Required. The operating system type required for the run. + Possible values include: 'Windows', 'Linux' + :type os: str or ~azure.mgmt.containerregistry.v2019_04_01.models.OS + :param architecture: The OS architecture. Possible values include: + 'amd64', 'x86', 'arm' + :type architecture: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.Architecture + :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', + 'v8' + :type variant: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.Variant + """ + + _validation = { + 'os': {'required': True}, + } + + _attribute_map = { + 'os': {'key': 'os', 'type': 'str'}, + 'architecture': {'key': 'architecture', 'type': 'str'}, + 'variant': {'key': 'variant', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PlatformProperties, self).__init__(**kwargs) + self.os = kwargs.get('os', None) + self.architecture = kwargs.get('architecture', None) + self.variant = kwargs.get('variant', None) + + +class PlatformUpdateParameters(Model): + """The properties for updating the platform configuration. + + :param os: The operating system type required for the run. Possible values + include: 'Windows', 'Linux' + :type os: str or ~azure.mgmt.containerregistry.v2019_04_01.models.OS + :param architecture: The OS architecture. Possible values include: + 'amd64', 'x86', 'arm' + :type architecture: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.Architecture + :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', + 'v8' + :type variant: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.Variant + """ + + _attribute_map = { + 'os': {'key': 'os', 'type': 'str'}, + 'architecture': {'key': 'architecture', 'type': 'str'}, + 'variant': {'key': 'variant', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PlatformUpdateParameters, self).__init__(**kwargs) + self.os = kwargs.get('os', None) + self.architecture = kwargs.get('architecture', None) + self.variant = kwargs.get('variant', None) + + +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 + + +class QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + +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.v2019_04_01.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) + + +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) + + +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.v2019_04_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.v2019_04_01.models.ProvisioningState + :ivar status: The status of the container registry at the time the + operation was called. + :vartype status: ~azure.mgmt.containerregistry.v2019_04_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.v2019_04_01.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2019_04_01.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + 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) + self.network_rule_set = kwargs.get('network_rule_set', None) + + +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.v2019_04_01.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) + + +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) + + +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) + + +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.v2019_04_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, **kwargs): + super(RegistryPassword, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2019_04_01.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2019_04_01.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, **kwargs): + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = kwargs.get('quarantine_policy', None) + self.trust_policy = kwargs.get('trust_policy', None) + + +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.v2019_04_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.v2019_04_01.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2019_04_01.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + 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) + self.network_rule_set = kwargs.get('network_rule_set', None) + + +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.v2019_04_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, **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) + + +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.v2019_04_01.models.RegistryUsage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RegistryUsage]'}, + } + + def __init__(self, **kwargs): + super(RegistryUsageListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +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.v2019_04_01.models.ProvisioningState + :ivar status: The status of the replication at the time the operation was + called. + :vartype status: ~azure.mgmt.containerregistry.v2019_04_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, **kwargs): + super(Replication, self).__init__(**kwargs) + self.provisioning_state = None + self.status = None + + +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) + + +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) + + +class Run(ProxyResource): + """Run 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 run_id: The unique identifier for the run. + :type run_id: str + :param status: The current status of the run. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.RunStatus + :param last_updated_time: The last updated time for the run. + :type last_updated_time: datetime + :param run_type: The type of run. Possible values include: 'QuickBuild', + 'QuickRun', 'AutoBuild', 'AutoRun' + :type run_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.RunType + :param create_time: The time the run was scheduled. + :type create_time: datetime + :param start_time: The time the run started. + :type start_time: datetime + :param finish_time: The time the run finished. + :type finish_time: datetime + :param output_images: The list of all images that were generated from the + run. This is applicable if the run generates base image dependencies. + :type output_images: + list[~azure.mgmt.containerregistry.v2019_04_01.models.ImageDescriptor] + :param task: The task against which run was scheduled. + :type task: str + :param image_update_trigger: The image update trigger that caused the run. + This is applicable if the task has base image trigger configured. + :type image_update_trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.ImageUpdateTrigger + :param source_trigger: The source trigger that caused the run. + :type source_trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerDescriptor + :param platform: The platform properties against which the run will + happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties + :param source_registry_auth: The scope of the credentials that were used + to login to the source registry during this run. + :type source_registry_auth: str + :param custom_registries: The list of custom registries that were logged + in during this run. + :type custom_registries: list[str] + :ivar run_error_message: The error message received from backend systems + after the run is scheduled. + :vartype run_error_message: str + :param provisioning_state: The provisioning state of a run. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :type provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.ProvisioningState + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. Default value: False . + :type is_archive_enabled: bool + :param timer_trigger: The timer trigger that caused the run. + :type timer_trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.TimerTriggerDescriptor + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'run_error_message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'run_id': {'key': 'properties.runId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'run_type': {'key': 'properties.runType', '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]'}, + 'task': {'key': 'properties.task', 'type': 'str'}, + 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, + 'source_trigger': {'key': 'properties.sourceTrigger', 'type': 'SourceTriggerDescriptor'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'source_registry_auth': {'key': 'properties.sourceRegistryAuth', 'type': 'str'}, + 'custom_registries': {'key': 'properties.customRegistries', 'type': '[str]'}, + 'run_error_message': {'key': 'properties.runErrorMessage', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, + 'timer_trigger': {'key': 'properties.timerTrigger', 'type': 'TimerTriggerDescriptor'}, + } + + def __init__(self, **kwargs): + super(Run, self).__init__(**kwargs) + self.run_id = kwargs.get('run_id', None) + self.status = kwargs.get('status', None) + self.last_updated_time = kwargs.get('last_updated_time', None) + self.run_type = kwargs.get('run_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.task = kwargs.get('task', None) + self.image_update_trigger = kwargs.get('image_update_trigger', None) + self.source_trigger = kwargs.get('source_trigger', None) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.source_registry_auth = kwargs.get('source_registry_auth', None) + self.custom_registries = kwargs.get('custom_registries', None) + self.run_error_message = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.is_archive_enabled = kwargs.get('is_archive_enabled', False) + self.timer_trigger = kwargs.get('timer_trigger', None) + + +class RunFilter(Model): + """Properties that are enabled for Odata querying on runs. + + :param run_id: The unique identifier for the run. + :type run_id: str + :param run_type: The type of run. Possible values include: 'QuickBuild', + 'QuickRun', 'AutoBuild', 'AutoRun' + :type run_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.RunType + :param status: The current status of the run. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.RunStatus + :param create_time: The create time for a run. + :type create_time: datetime + :param finish_time: The time the run finished. + :type finish_time: datetime + :param output_image_manifests: The list of comma-separated image manifests + that were generated from the run. This is applicable if the run is of + build type. + :type output_image_manifests: str + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. + :type is_archive_enabled: bool + :param task_name: The name of the task that the run corresponds to. + :type task_name: str + """ + + _attribute_map = { + 'run_id': {'key': 'runId', 'type': 'str'}, + 'run_type': {'key': 'runType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunFilter, self).__init__(**kwargs) + self.run_id = kwargs.get('run_id', None) + self.run_type = kwargs.get('run_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_manifests = kwargs.get('output_image_manifests', None) + self.is_archive_enabled = kwargs.get('is_archive_enabled', None) + self.task_name = kwargs.get('task_name', None) + + +class RunGetLogResult(Model): + """The result of get log link operation. + + :param log_link: The link to logs for a run on a azure container registry. + :type log_link: str + """ + + _attribute_map = { + 'log_link': {'key': 'logLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunGetLogResult, self).__init__(**kwargs) + self.log_link = kwargs.get('log_link', None) + + +class RunUpdateParameters(Model): + """The set of run 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(RunUpdateParameters, self).__init__(**kwargs) + self.is_archive_enabled = kwargs.get('is_archive_enabled', None) + + +class SecretObject(Model): + """Describes the properties of a secret object value. + + :param value: The value of the secret. The format of this value will be + determined + based on the type of the secret object. If the type is Opaque, the value + will be + used as is without any modification. + :type value: str + :param type: The type of the secret object which determines how the value + of the secret object has to be + interpreted. Possible values include: 'Opaque', 'Vaultsecret' + :type type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObjectType + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecretObject, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.type = kwargs.get('type', None) + + +class SetValue(Model): + """The properties of a overridable value that can be passed to a task + template. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the overridable value. + :type name: str + :param value: Required. The overridable value. + :type value: str + :param is_secret: Flag to indicate whether the value represents a secret + or not. Default value: False . + :type is_secret: bool + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SetValue, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.is_secret = kwargs.get('is_secret', False) + + +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.v2019_04_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.v2019_04_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, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + + +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) + + +class SourceProperties(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.v2019_04_01.models.SourceControlType + :param repository_url: Required. The full URL to the source code + repository + :type repository_url: str + :param branch: The branch name of the source code. + :type branch: str + :param source_control_auth_properties: The authorization properties for + accessing the source code repository and to set up + webhooks for notifications. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2019_04_01.models.AuthInfo + """ + + _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'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfo'}, + } + + def __init__(self, **kwargs): + super(SourceProperties, self).__init__(**kwargs) + self.source_control_type = kwargs.get('source_control_type', None) + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) + + +class SourceRegistryCredentials(Model): + """Describes the credential parameters for accessing the source registry. + + :param login_mode: The authentication mode which determines the source + registry login scope. The credentials for the source registry + will be generated using the given scope. These credentials will be used to + login to + the source registry during the run. Possible values include: 'None', + 'Default' + :type login_mode: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceRegistryLoginMode + """ + + _attribute_map = { + 'login_mode': {'key': 'loginMode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceRegistryCredentials, self).__init__(**kwargs) + self.login_mode = kwargs.get('login_mode', None) + + +class SourceTrigger(Model): + """The properties of a source based trigger. + + All required parameters must be populated in order to send to Azure. + + :param source_repository: Required. The properties that describes the + source(code) for the task. + :type source_repository: + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceProperties + :param source_trigger_events: Required. The source event corresponding to + the trigger. + :type source_trigger_events: list[str or + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerEvent] + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'source_repository': {'required': True}, + 'source_trigger_events': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'source_repository': {'key': 'sourceRepository', 'type': 'SourceProperties'}, + 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceTrigger, self).__init__(**kwargs) + self.source_repository = kwargs.get('source_repository', None) + self.source_trigger_events = kwargs.get('source_trigger_events', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class SourceTriggerDescriptor(Model): + """The source trigger that caused a run. + + :param id: The unique ID of the trigger. + :type id: str + :param event_type: The event type of the trigger. + :type event_type: str + :param commit_id: The unique ID that identifies a commit. + :type commit_id: str + :param pull_request_id: The unique ID that identifies pull request. + :type pull_request_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'}, + 'event_type': {'key': 'eventType', 'type': 'str'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'pull_request_id': {'key': 'pullRequestId', '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(SourceTriggerDescriptor, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.event_type = kwargs.get('event_type', None) + self.commit_id = kwargs.get('commit_id', None) + self.pull_request_id = kwargs.get('pull_request_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) + + +class SourceTriggerUpdateParameters(Model): + """The properties for updating a source based trigger. + + All required parameters must be populated in order to send to Azure. + + :param source_repository: The properties that describes the source(code) + for the task. + :type source_repository: + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceUpdateParameters + :param source_trigger_events: The source event corresponding to the + trigger. + :type source_trigger_events: list[str or + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerEvent] + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'source_repository': {'key': 'sourceRepository', 'type': 'SourceUpdateParameters'}, + 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceTriggerUpdateParameters, self).__init__(**kwargs) + self.source_repository = kwargs.get('source_repository', None) + self.source_trigger_events = kwargs.get('source_trigger_events', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class SourceUpdateParameters(Model): + """The properties for updating the source code repository. + + :param source_control_type: The type of source control service. Possible + values include: 'Github', 'VisualStudioTeamService' + :type source_control_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceControlType + :param repository_url: The full URL to the source code repository + :type repository_url: str + :param branch: The branch name of the source code. + :type branch: str + :param source_control_auth_properties: The authorization properties for + accessing the source code repository and to set up + webhooks for notifications. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2019_04_01.models.AuthInfoUpdateParameters + """ + + _attribute_map = { + 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, + 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfoUpdateParameters'}, + } + + def __init__(self, **kwargs): + super(SourceUpdateParameters, self).__init__(**kwargs) + self.source_control_type = kwargs.get('source_control_type', None) + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) + + +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) + + +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 + + +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) + + +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 + :param name: The name of the artifact. + :type name: str + :param version: The version of the artifact. + :type version: 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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', '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) + self.name = kwargs.get('name', None) + self.version = kwargs.get('version', None) + + +class Task(Resource): + """The task that has the ARM resource and task properties. + The task will have all information to schedule a run 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] + :param identity: Identity for the resource. + :type identity: + ~azure.mgmt.containerregistry.v2019_04_01.models.IdentityProperties + :ivar provisioning_state: The provisioning state of the task. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.ProvisioningState + :ivar creation_date: The creation date of task. + :vartype creation_date: datetime + :param status: The current status of task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStatus + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param step: Required. The properties of a task step. + :type step: + ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStepProperties + :param trigger: The properties that describe all triggers for the task. + :type trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerProperties + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'platform': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'step': {'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}'}, + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, + 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, + 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, + } + + def __init__(self, **kwargs): + super(Task, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.creation_date = None + self.status = kwargs.get('status', None) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.timeout = kwargs.get('timeout', 3600) + self.step = kwargs.get('step', None) + self.trigger = kwargs.get('trigger', None) + self.credentials = kwargs.get('credentials', None) + + +class TaskRunRequest(RunRequest): + """The parameters for a task run request. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param task_name: Required. The name of task against which run has to be + queued. + :type task_name: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + 'task_name': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(TaskRunRequest, self).__init__(**kwargs) + self.task_name = kwargs.get('task_name', None) + self.values = kwargs.get('values', None) + self.type = 'TaskRunRequest' + + +class TaskUpdateParameters(Model): + """The parameters for updating a task. + + :param identity: Identity for the resource. + :type identity: + ~azure.mgmt.containerregistry.v2019_04_01.models.IdentityProperties + :param status: The current status of task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStatus + :param platform: The platform properties against which the run has to + happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformUpdateParameters + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties + :param timeout: Run timeout in seconds. + :type timeout: int + :param step: The properties for updating a task step. + :type step: + ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStepUpdateParameters + :param trigger: The properties for updating trigger properties. + :type trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerUpdateParameters + :param credentials: The parameters that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, + 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, + 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TaskUpdateParameters, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.status = kwargs.get('status', None) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.timeout = kwargs.get('timeout', None) + self.step = kwargs.get('step', None) + self.trigger = kwargs.get('trigger', None) + self.credentials = kwargs.get('credentials', None) + self.tags = kwargs.get('tags', None) + + +class TimerTrigger(Model): + """The properties of a timer trigger. + + All required parameters must be populated in order to send to Azure. + + :param schedule: Required. The CRON expression for the task schedule + :type schedule: str + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'schedule': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TimerTrigger, self).__init__(**kwargs) + self.schedule = kwargs.get('schedule', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class TimerTriggerDescriptor(Model): + """TimerTriggerDescriptor. + + :param timer_trigger_name: The timer trigger name that caused the run. + :type timer_trigger_name: str + :param schedule_occurrence: The occurrence that triggered the run. + :type schedule_occurrence: str + """ + + _attribute_map = { + 'timer_trigger_name': {'key': 'timerTriggerName', 'type': 'str'}, + 'schedule_occurrence': {'key': 'scheduleOccurrence', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TimerTriggerDescriptor, self).__init__(**kwargs) + self.timer_trigger_name = kwargs.get('timer_trigger_name', None) + self.schedule_occurrence = kwargs.get('schedule_occurrence', None) + + +class TimerTriggerUpdateParameters(Model): + """The properties for updating a timer trigger. + + All required parameters must be populated in order to send to Azure. + + :param schedule: The CRON expression for the task schedule + :type schedule: str + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TimerTriggerUpdateParameters, self).__init__(**kwargs) + self.schedule = kwargs.get('schedule', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class TriggerProperties(Model): + """The properties of a trigger. + + :param timer_triggers: The collection of timer triggers. + :type timer_triggers: + list[~azure.mgmt.containerregistry.v2019_04_01.models.TimerTrigger] + :param source_triggers: The collection of triggers based on source code + repository. + :type source_triggers: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SourceTrigger] + :param base_image_trigger: The trigger based on base image dependencies. + :type base_image_trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTrigger + """ + + _attribute_map = { + 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTrigger]'}, + 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTrigger]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTrigger'}, + } + + def __init__(self, **kwargs): + super(TriggerProperties, self).__init__(**kwargs) + self.timer_triggers = kwargs.get('timer_triggers', None) + self.source_triggers = kwargs.get('source_triggers', None) + self.base_image_trigger = kwargs.get('base_image_trigger', None) + + +class TriggerUpdateParameters(Model): + """The properties for updating triggers. + + :param timer_triggers: The collection of timer triggers. + :type timer_triggers: + list[~azure.mgmt.containerregistry.v2019_04_01.models.TimerTriggerUpdateParameters] + :param source_triggers: The collection of triggers based on source code + repository. + :type source_triggers: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerUpdateParameters] + :param base_image_trigger: The trigger based on base image dependencies. + :type base_image_trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerUpdateParameters + """ + + _attribute_map = { + 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTriggerUpdateParameters]'}, + 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTriggerUpdateParameters]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTriggerUpdateParameters'}, + } + + def __init__(self, **kwargs): + super(TriggerUpdateParameters, self).__init__(**kwargs) + self.timer_triggers = kwargs.get('timer_triggers', None) + self.source_triggers = kwargs.get('source_triggers', None) + self.base_image_trigger = kwargs.get('base_image_trigger', None) + + +class TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrustPolicy, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.status = kwargs.get('status', None) + + +class UserIdentityProperties(Model): + """UserIdentityProperties. + + :param principal_id: The principal id of user assigned identity. + :type principal_id: str + :param client_id: The client id of user assigned identity. + :type client_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserIdentityProperties, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.client_id = kwargs.get('client_id', None) + + +class VirtualNetworkRule(Model): + """Virtual network rule. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.Action + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.action = kwargs.get('action', "Allow") + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + + +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.v2019_04_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.v2019_04_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.v2019_04_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, **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 + + +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.v2019_04_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.v2019_04_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, **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) + + +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.v2019_04_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.v2019_04_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/_models_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/_models_py3.py new file mode 100644 index 000000000000..b8b23a07761a --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/_models_py3.py @@ -0,0 +1,3420 @@ +# 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 + + +class AgentProperties(Model): + """The properties that determine the run agent configuration. + + :param cpu: The CPU configuration in terms of number of cores required for + the run. + :type cpu: int + """ + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'int'}, + } + + def __init__(self, *, cpu: int=None, **kwargs) -> None: + super(AgentProperties, self).__init__(**kwargs) + self.cpu = cpu + + +class Argument(Model): + """The properties of a run argument. + + All required parameters must be populated in order to send to Azure. + + :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 = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: + super(Argument, self).__init__(**kwargs) + self.name = name + self.value = value + self.is_secret = is_secret + + +class AuthInfo(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: Required. The type of Auth token. Possible values + include: 'PAT', 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.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_type': {'required': True}, + '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_type, token: str, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: + super(AuthInfo, self).__init__(**kwargs) + self.token_type = token_type + self.token = token + self.refresh_token = refresh_token + self.scope = scope + self.expires_in = expires_in + + +class AuthInfoUpdateParameters(Model): + """The authorization properties for accessing the source code repository. + + :param token_type: The type of Auth token. Possible values include: 'PAT', + 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TokenType + :param token: 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 + """ + + _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_type=None, token: str=None, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: + super(AuthInfoUpdateParameters, self).__init__(**kwargs) + self.token_type = token_type + self.token = token + self.refresh_token = refresh_token + self.scope = scope + self.expires_in = expires_in + + +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.v2019_04_01.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 + + +class BaseImageTrigger(Model): + """The trigger based on base image dependency. + + All required parameters must be populated in order to send to Azure. + + :param base_image_trigger_type: Required. The type of the auto trigger for + base image dependency updates. Possible values include: 'All', 'Runtime' + :type base_image_trigger_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerType + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'base_image_trigger_type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, base_image_trigger_type, name: str, status="Enabled", **kwargs) -> None: + super(BaseImageTrigger, self).__init__(**kwargs) + self.base_image_trigger_type = base_image_trigger_type + self.status = status + self.name = name + + +class BaseImageTriggerUpdateParameters(Model): + """The properties for updating base image dependency trigger. + + All required parameters must be populated in order to send to Azure. + + :param base_image_trigger_type: The type of the auto trigger for base + image dependency updates. Possible values include: 'All', 'Runtime' + :type base_image_trigger_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerType + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, base_image_trigger_type=None, status="Enabled", **kwargs) -> None: + super(BaseImageTriggerUpdateParameters, self).__init__(**kwargs) + self.base_image_trigger_type = base_image_trigger_type + self.status = status + self.name = name + + +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 + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class Credentials(Model): + """The parameters that describes a set of credentials that will be used when a + run is invoked. + + :param source_registry: Describes the credential parameters for accessing + the source registry. + :type source_registry: + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceRegistryCredentials + :param custom_registries: Describes the credential parameters for + accessing other custom registries. The key + for the dictionary item will be the registry login server + (myregistry.azurecr.io) and + the value of the item will be the registry credentials for accessing the + registry. + :type custom_registries: dict[str, + ~azure.mgmt.containerregistry.v2019_04_01.models.CustomRegistryCredentials] + """ + + _attribute_map = { + 'source_registry': {'key': 'sourceRegistry', 'type': 'SourceRegistryCredentials'}, + 'custom_registries': {'key': 'customRegistries', 'type': '{CustomRegistryCredentials}'}, + } + + def __init__(self, *, source_registry=None, custom_registries=None, **kwargs) -> None: + super(Credentials, self).__init__(**kwargs) + self.source_registry = source_registry + self.custom_registries = custom_registries + + +class CustomRegistryCredentials(Model): + """Describes the credentials that will be used to access a custom registry + during a run. + + :param user_name: The username for logging into the custom registry. + :type user_name: + ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObject + :param password: The password for logging into the custom registry. The + password is a secret + object that allows multiple ways of providing the value for it. + :type password: + ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObject + :param identity: Indicates the managed identity assigned to the custom + credential. If a user-assigned identity + this value is the Client ID. If a system-assigned identity, the value will + be `system`. In + the case of a system-assigned identity, the Client ID will be determined + by the runner. This + identity may be used to authenticate to key vault to retrieve credentials + or it may be the only + source of authentication used for accessing the registry. + :type identity: str + """ + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'SecretObject'}, + 'password': {'key': 'password', 'type': 'SecretObject'}, + 'identity': {'key': 'identity', 'type': 'str'}, + } + + def __init__(self, *, user_name=None, password=None, identity: str=None, **kwargs) -> None: + super(CustomRegistryCredentials, self).__init__(**kwargs) + self.user_name = user_name + self.password = password + self.identity = identity + + +class RunRequest(Model): + """The request parameters for scheduling a run. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildRequest, FileTaskRunRequest, TaskRunRequest, + EncodedTaskRunRequest + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} + } + + def __init__(self, *, is_archive_enabled: bool=False, **kwargs) -> None: + super(RunRequest, self).__init__(**kwargs) + self.is_archive_enabled = is_archive_enabled + self.type = None + + +class DockerBuildRequest(RunRequest): + """The parameters for a docker quick build. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :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 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: Required. The Docker file path relative to the + source location. + :type docker_file_path: str + :param target: The name of the target build stage for the docker build. + :type target: str + :param arguments: The collection of override arguments to be used when + executing the run. + :type arguments: + list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'docker_file_path': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', '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'}, + 'target': {'key': 'target', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, *, docker_file_path: str, platform, is_archive_enabled: bool=False, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(DockerBuildRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + 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.target = target + self.arguments = arguments + self.timeout = timeout + self.platform = platform + self.agent_configuration = agent_configuration + self.source_location = source_location + self.credentials = credentials + self.type = 'DockerBuildRequest' + + +class TaskStepProperties(Model): + """Base properties for any task step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStep, FileTaskStep, EncodedTaskStep + + 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStep', 'FileTask': 'FileTaskStep', 'EncodedTask': 'EncodedTaskStep'} + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, **kwargs) -> None: + super(TaskStepProperties, self).__init__(**kwargs) + self.base_image_dependencies = None + self.context_path = context_path + self.context_access_token = context_access_token + self.type = None + + +class DockerBuildStep(TaskStepProperties): + """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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :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 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: Required. The Docker file path relative to the + source context. + :type docker_file_path: str + :param target: The name of the target build stage for the docker build. + :type target: str + :param arguments: The collection of override arguments to be used when + executing this build step. + :type arguments: + list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'docker_file_path': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + 'target': {'key': 'target', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + } + + def __init__(self, *, docker_file_path: str, context_path: str=None, context_access_token: str=None, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, **kwargs) -> None: + super(DockerBuildStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + 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.target = target + self.arguments = arguments + self.type = 'Docker' + + +class TaskStepUpdateParameters(Model): + """Base properties for updating any task step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStepUpdateParameters, + FileTaskStepUpdateParameters, EncodedTaskStepUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStepUpdateParameters', 'FileTask': 'FileTaskStepUpdateParameters', 'EncodedTask': 'EncodedTaskStepUpdateParameters'} + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, **kwargs) -> None: + super(TaskStepUpdateParameters, self).__init__(**kwargs) + self.context_path = context_path + self.context_access_token = context_access_token + self.type = None + + +class DockerBuildStepUpdateParameters(TaskStepUpdateParameters): + """The properties for updating a docker build step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :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 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 + context. + :type docker_file_path: str + :param arguments: The collection of override arguments to be used when + executing this build step. + :type arguments: + list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument] + :param target: The name of the target build stage for the docker build. + :type target: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, image_names=None, is_push_enabled: bool=None, no_cache: bool=None, docker_file_path: str=None, arguments=None, target: str=None, **kwargs) -> None: + super(DockerBuildStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + 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.arguments = arguments + self.target = target + self.type = 'Docker' + + +class EncodedTaskRunRequest(RunRequest): + """The parameters for a quick task run request. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Required. Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'encoded_task_content': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, *, encoded_task_content: str, platform, is_archive_enabled: bool=False, encoded_values_content: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(EncodedTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + self.encoded_task_content = encoded_task_content + self.encoded_values_content = encoded_values_content + self.values = values + self.timeout = timeout + self.platform = platform + self.agent_configuration = agent_configuration + self.source_location = source_location + self.credentials = credentials + self.type = 'EncodedTaskRunRequest' + + +class EncodedTaskStep(TaskStepProperties): + """The properties of a encoded task 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Required. Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'encoded_task_content': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, encoded_task_content: str, context_path: str=None, context_access_token: str=None, encoded_values_content: str=None, values=None, **kwargs) -> None: + super(EncodedTaskStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + self.encoded_task_content = encoded_task_content + self.encoded_values_content = encoded_values_content + self.values = values + self.type = 'EncodedTask' + + +class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters): + """The properties for updating encoded task step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, encoded_task_content: str=None, encoded_values_content: str=None, values=None, **kwargs) -> None: + super(EncodedTaskStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + self.encoded_task_content = encoded_task_content + self.encoded_values_content = encoded_values_content + self.values = values + self.type = 'EncodedTask' + + +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 + + +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.v2019_04_01.models.EventRequestMessage + :param event_response_message: The event response message received from + the service URI. + :type event_response_message: + ~azure.mgmt.containerregistry.v2019_04_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 + + +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.v2019_04_01.models.Target + :param request: The request that generated the event. + :type request: ~azure.mgmt.containerregistry.v2019_04_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.v2019_04_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.v2019_04_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 + + +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.v2019_04_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 + + +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 + + +class FileTaskRunRequest(RunRequest): + """The request parameters for a scheduling run against a task file. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: Required. The template/definition file path + relative to the source. + :type task_file_path: str + :param values_file_path: The values/parameters file path relative to the + source. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'task_file_path': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, *, task_file_path: str, platform, is_archive_enabled: bool=False, values_file_path: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(FileTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + self.task_file_path = task_file_path + self.values_file_path = values_file_path + self.values = values + self.timeout = timeout + self.platform = platform + self.agent_configuration = agent_configuration + self.source_location = source_location + self.credentials = credentials + self.type = 'FileTaskRunRequest' + + +class FileTaskStep(TaskStepProperties): + """The properties of a task 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: Required. The task template/definition file path + relative to the source context. + :type task_file_path: str + :param values_file_path: The task values/parameters file path relative to + the source context. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'task_file_path': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, task_file_path: str, context_path: str=None, context_access_token: str=None, values_file_path: str=None, values=None, **kwargs) -> None: + super(FileTaskStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + self.task_file_path = task_file_path + self.values_file_path = values_file_path + self.values = values + self.type = 'FileTask' + + +class FileTaskStepUpdateParameters(TaskStepUpdateParameters): + """The properties of updating a task step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: The task template/definition file path relative to + the source context. + :type task_file_path: str + :param values_file_path: The values/parameters file path relative to the + source context. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, task_file_path: str=None, values_file_path: str=None, values=None, **kwargs) -> None: + super(FileTaskStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + self.task_file_path = task_file_path + self.values_file_path = values_file_path + self.values = values + self.type = 'FileTask' + + +class IdentityProperties(Model): + """Managed identity for the resource. + + :param principal_id: The principal ID of resource identity. + :type principal_id: str + :param tenant_id: The tenant ID of resource. + :type tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned', + 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated + with the resource. The user identity + dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.containerregistry.v2019_04_01.models.UserIdentityProperties] + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentityProperties}'}, + } + + def __init__(self, *, principal_id: str=None, tenant_id: str=None, type=None, user_assigned_identities=None, **kwargs) -> None: + super(IdentityProperties, self).__init__(**kwargs) + self.principal_id = principal_id + self.tenant_id = tenant_id + self.type = type + self.user_assigned_identities = user_assigned_identities + + +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 + + +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.v2019_04_01.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 + + +class ImportImageParameters(Model): + """ImportImageParameters. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the image. + :type source: + ~azure.mgmt.containerregistry.v2019_04_01.models.ImportSource + :param target_tags: List of strings of the form repo[:tag]. When tag is + omitted the source will be used (or 'latest' if source tag is also + omitted). + :type target_tags: list[str] + :param untagged_target_repositories: List of strings of repository names + to do a manifest only copy. No tag will be created. + :type untagged_target_repositories: list[str] + :param mode: When Force, any existing target tags will be overwritten. + When NoForce, any existing target tags will fail the operation before any + copying begins. Possible values include: 'NoForce', 'Force'. Default + value: "NoForce" . + :type mode: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.ImportMode + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ImportSource'}, + 'target_tags': {'key': 'targetTags', 'type': '[str]'}, + 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, *, source, target_tags=None, untagged_target_repositories=None, mode="NoForce", **kwargs) -> None: + super(ImportImageParameters, self).__init__(**kwargs) + self.source = source + self.target_tags = target_tags + self.untagged_target_repositories = untagged_target_repositories + self.mode = mode + + +class ImportSource(Model): + """ImportSource. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: The resource identifier of the source Azure Container + Registry. + :type resource_id: str + :param registry_uri: The address of the source registry (e.g. + 'mcr.microsoft.com'). + :type registry_uri: str + :param credentials: Credentials used when importing from a registry uri. + :type credentials: + ~azure.mgmt.containerregistry.v2019_04_01.models.ImportSourceCredentials + :param source_image: Required. Repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' + tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest + ('hello-world@sha256:abc123'). + :type source_image: str + """ + + _validation = { + 'source_image': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'registry_uri': {'key': 'registryUri', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, + 'source_image': {'key': 'sourceImage', 'type': 'str'}, + } + + def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None: + super(ImportSource, self).__init__(**kwargs) + self.resource_id = resource_id + self.registry_uri = registry_uri + self.credentials = credentials + self.source_image = source_image + + +class ImportSourceCredentials(Model): + """ImportSourceCredentials. + + All required parameters must be populated in order to send to Azure. + + :param username: The username to authenticate with the source registry. + :type username: str + :param password: Required. The password used to authenticate with the + source registry. + :type password: str + """ + + _validation = { + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, password: str, username: str=None, **kwargs) -> None: + super(ImportSourceCredentials, self).__init__(**kwargs) + self.username = username + self.password = password + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.Action + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.action = action + self.ip_address_or_range = ip_address_or_range + + +class NetworkRuleSet(Model): + """The network rule set for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Required. The default action of allow or deny when + no other rules match. Possible values include: 'Allow', 'Deny'. Default + value: "Allow" . + :type default_action: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.DefaultAction + :param virtual_network_rules: The virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.containerregistry.v2019_04_01.models.VirtualNetworkRule] + :param ip_rules: The IP ACL rules. + :type ip_rules: + list[~azure.mgmt.containerregistry.v2019_04_01.models.IPRule] + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + } + + def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = default_action + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param origin: The origin information of the container registry operation. + :type origin: str + :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.v2019_04_01.models.OperationDisplayDefinition + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2019_04_01.models.OperationServiceSpecificationDefinition + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, + } + + def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.origin = origin + self.name = name + self.display = display + self.service_specification = service_specification + + +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 + + +class OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.internal_metric_name = internal_metric_name + + +class OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2019_04_01.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class PlatformProperties(Model): + """The platform properties against which the run has to happen. + + All required parameters must be populated in order to send to Azure. + + :param os: Required. The operating system type required for the run. + Possible values include: 'Windows', 'Linux' + :type os: str or ~azure.mgmt.containerregistry.v2019_04_01.models.OS + :param architecture: The OS architecture. Possible values include: + 'amd64', 'x86', 'arm' + :type architecture: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.Architecture + :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', + 'v8' + :type variant: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.Variant + """ + + _validation = { + 'os': {'required': True}, + } + + _attribute_map = { + 'os': {'key': 'os', 'type': 'str'}, + 'architecture': {'key': 'architecture', 'type': 'str'}, + 'variant': {'key': 'variant', 'type': 'str'}, + } + + def __init__(self, *, os, architecture=None, variant=None, **kwargs) -> None: + super(PlatformProperties, self).__init__(**kwargs) + self.os = os + self.architecture = architecture + self.variant = variant + + +class PlatformUpdateParameters(Model): + """The properties for updating the platform configuration. + + :param os: The operating system type required for the run. Possible values + include: 'Windows', 'Linux' + :type os: str or ~azure.mgmt.containerregistry.v2019_04_01.models.OS + :param architecture: The OS architecture. Possible values include: + 'amd64', 'x86', 'arm' + :type architecture: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.Architecture + :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', + 'v8' + :type variant: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.Variant + """ + + _attribute_map = { + 'os': {'key': 'os', 'type': 'str'}, + 'architecture': {'key': 'architecture', 'type': 'str'}, + 'variant': {'key': 'variant', 'type': 'str'}, + } + + def __init__(self, *, os=None, architecture=None, variant=None, **kwargs) -> None: + super(PlatformUpdateParameters, self).__init__(**kwargs) + self.os = os + self.architecture = architecture + self.variant = variant + + +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 + + +class QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status=None, **kwargs) -> None: + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = status + + +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.v2019_04_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 + + +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 + + +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.v2019_04_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.v2019_04_01.models.ProvisioningState + :ivar status: The status of the container registry at the time the + operation was called. + :vartype status: ~azure.mgmt.containerregistry.v2019_04_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.v2019_04_01.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2019_04_01.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=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 + self.network_rule_set = network_rule_set + + +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.v2019_04_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 + + +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 + + +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 + + +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.v2019_04_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 + + +class RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2019_04_01.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2019_04_01.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, *, quarantine_policy=None, trust_policy=None, **kwargs) -> None: + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = quarantine_policy + self.trust_policy = trust_policy + + +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.v2019_04_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.v2019_04_01.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2019_04_01.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, network_rule_set=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 + self.network_rule_set = network_rule_set + + +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.v2019_04_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 + + +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.v2019_04_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 + + +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.v2019_04_01.models.ProvisioningState + :ivar status: The status of the replication at the time the operation was + called. + :vartype status: ~azure.mgmt.containerregistry.v2019_04_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 + + +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 + + +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 + + +class Run(ProxyResource): + """Run 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 run_id: The unique identifier for the run. + :type run_id: str + :param status: The current status of the run. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.RunStatus + :param last_updated_time: The last updated time for the run. + :type last_updated_time: datetime + :param run_type: The type of run. Possible values include: 'QuickBuild', + 'QuickRun', 'AutoBuild', 'AutoRun' + :type run_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.RunType + :param create_time: The time the run was scheduled. + :type create_time: datetime + :param start_time: The time the run started. + :type start_time: datetime + :param finish_time: The time the run finished. + :type finish_time: datetime + :param output_images: The list of all images that were generated from the + run. This is applicable if the run generates base image dependencies. + :type output_images: + list[~azure.mgmt.containerregistry.v2019_04_01.models.ImageDescriptor] + :param task: The task against which run was scheduled. + :type task: str + :param image_update_trigger: The image update trigger that caused the run. + This is applicable if the task has base image trigger configured. + :type image_update_trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.ImageUpdateTrigger + :param source_trigger: The source trigger that caused the run. + :type source_trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerDescriptor + :param platform: The platform properties against which the run will + happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties + :param source_registry_auth: The scope of the credentials that were used + to login to the source registry during this run. + :type source_registry_auth: str + :param custom_registries: The list of custom registries that were logged + in during this run. + :type custom_registries: list[str] + :ivar run_error_message: The error message received from backend systems + after the run is scheduled. + :vartype run_error_message: str + :param provisioning_state: The provisioning state of a run. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :type provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.ProvisioningState + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. Default value: False . + :type is_archive_enabled: bool + :param timer_trigger: The timer trigger that caused the run. + :type timer_trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.TimerTriggerDescriptor + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'run_error_message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'run_id': {'key': 'properties.runId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'run_type': {'key': 'properties.runType', '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]'}, + 'task': {'key': 'properties.task', 'type': 'str'}, + 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, + 'source_trigger': {'key': 'properties.sourceTrigger', 'type': 'SourceTriggerDescriptor'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'source_registry_auth': {'key': 'properties.sourceRegistryAuth', 'type': 'str'}, + 'custom_registries': {'key': 'properties.customRegistries', 'type': '[str]'}, + 'run_error_message': {'key': 'properties.runErrorMessage', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, + 'timer_trigger': {'key': 'properties.timerTrigger', 'type': 'TimerTriggerDescriptor'}, + } + + def __init__(self, *, run_id: str=None, status=None, last_updated_time=None, run_type=None, create_time=None, start_time=None, finish_time=None, output_images=None, task: str=None, image_update_trigger=None, source_trigger=None, platform=None, agent_configuration=None, source_registry_auth: str=None, custom_registries=None, provisioning_state=None, is_archive_enabled: bool=False, timer_trigger=None, **kwargs) -> None: + super(Run, self).__init__(**kwargs) + self.run_id = run_id + self.status = status + self.last_updated_time = last_updated_time + self.run_type = run_type + self.create_time = create_time + self.start_time = start_time + self.finish_time = finish_time + self.output_images = output_images + self.task = task + self.image_update_trigger = image_update_trigger + self.source_trigger = source_trigger + self.platform = platform + self.agent_configuration = agent_configuration + self.source_registry_auth = source_registry_auth + self.custom_registries = custom_registries + self.run_error_message = None + self.provisioning_state = provisioning_state + self.is_archive_enabled = is_archive_enabled + self.timer_trigger = timer_trigger + + +class RunFilter(Model): + """Properties that are enabled for Odata querying on runs. + + :param run_id: The unique identifier for the run. + :type run_id: str + :param run_type: The type of run. Possible values include: 'QuickBuild', + 'QuickRun', 'AutoBuild', 'AutoRun' + :type run_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.RunType + :param status: The current status of the run. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.RunStatus + :param create_time: The create time for a run. + :type create_time: datetime + :param finish_time: The time the run finished. + :type finish_time: datetime + :param output_image_manifests: The list of comma-separated image manifests + that were generated from the run. This is applicable if the run is of + build type. + :type output_image_manifests: str + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. + :type is_archive_enabled: bool + :param task_name: The name of the task that the run corresponds to. + :type task_name: str + """ + + _attribute_map = { + 'run_id': {'key': 'runId', 'type': 'str'}, + 'run_type': {'key': 'runType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + } + + def __init__(self, *, run_id: str=None, run_type=None, status=None, create_time=None, finish_time=None, output_image_manifests: str=None, is_archive_enabled: bool=None, task_name: str=None, **kwargs) -> None: + super(RunFilter, self).__init__(**kwargs) + self.run_id = run_id + self.run_type = run_type + self.status = status + self.create_time = create_time + self.finish_time = finish_time + self.output_image_manifests = output_image_manifests + self.is_archive_enabled = is_archive_enabled + self.task_name = task_name + + +class RunGetLogResult(Model): + """The result of get log link operation. + + :param log_link: The link to logs for a run on a azure container registry. + :type log_link: str + """ + + _attribute_map = { + 'log_link': {'key': 'logLink', 'type': 'str'}, + } + + def __init__(self, *, log_link: str=None, **kwargs) -> None: + super(RunGetLogResult, self).__init__(**kwargs) + self.log_link = log_link + + +class RunUpdateParameters(Model): + """The set of run 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(RunUpdateParameters, self).__init__(**kwargs) + self.is_archive_enabled = is_archive_enabled + + +class SecretObject(Model): + """Describes the properties of a secret object value. + + :param value: The value of the secret. The format of this value will be + determined + based on the type of the secret object. If the type is Opaque, the value + will be + used as is without any modification. + :type value: str + :param type: The type of the secret object which determines how the value + of the secret object has to be + interpreted. Possible values include: 'Opaque', 'Vaultsecret' + :type type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObjectType + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, type=None, **kwargs) -> None: + super(SecretObject, self).__init__(**kwargs) + self.value = value + self.type = type + + +class SetValue(Model): + """The properties of a overridable value that can be passed to a task + template. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the overridable value. + :type name: str + :param value: Required. The overridable value. + :type value: str + :param is_secret: Flag to indicate whether the value represents a secret + or not. Default value: False . + :type is_secret: bool + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: + super(SetValue, self).__init__(**kwargs) + self.name = name + self.value = value + self.is_secret = is_secret + + +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.v2019_04_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.v2019_04_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 + + +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 + + +class SourceProperties(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.v2019_04_01.models.SourceControlType + :param repository_url: Required. The full URL to the source code + repository + :type repository_url: str + :param branch: The branch name of the source code. + :type branch: str + :param source_control_auth_properties: The authorization properties for + accessing the source code repository and to set up + webhooks for notifications. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2019_04_01.models.AuthInfo + """ + + _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'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfo'}, + } + + def __init__(self, *, source_control_type, repository_url: str, branch: str=None, source_control_auth_properties=None, **kwargs) -> None: + super(SourceProperties, self).__init__(**kwargs) + self.source_control_type = source_control_type + self.repository_url = repository_url + self.branch = branch + self.source_control_auth_properties = source_control_auth_properties + + +class SourceRegistryCredentials(Model): + """Describes the credential parameters for accessing the source registry. + + :param login_mode: The authentication mode which determines the source + registry login scope. The credentials for the source registry + will be generated using the given scope. These credentials will be used to + login to + the source registry during the run. Possible values include: 'None', + 'Default' + :type login_mode: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceRegistryLoginMode + """ + + _attribute_map = { + 'login_mode': {'key': 'loginMode', 'type': 'str'}, + } + + def __init__(self, *, login_mode=None, **kwargs) -> None: + super(SourceRegistryCredentials, self).__init__(**kwargs) + self.login_mode = login_mode + + +class SourceTrigger(Model): + """The properties of a source based trigger. + + All required parameters must be populated in order to send to Azure. + + :param source_repository: Required. The properties that describes the + source(code) for the task. + :type source_repository: + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceProperties + :param source_trigger_events: Required. The source event corresponding to + the trigger. + :type source_trigger_events: list[str or + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerEvent] + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'source_repository': {'required': True}, + 'source_trigger_events': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'source_repository': {'key': 'sourceRepository', 'type': 'SourceProperties'}, + 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, source_repository, source_trigger_events, name: str, status="Enabled", **kwargs) -> None: + super(SourceTrigger, self).__init__(**kwargs) + self.source_repository = source_repository + self.source_trigger_events = source_trigger_events + self.status = status + self.name = name + + +class SourceTriggerDescriptor(Model): + """The source trigger that caused a run. + + :param id: The unique ID of the trigger. + :type id: str + :param event_type: The event type of the trigger. + :type event_type: str + :param commit_id: The unique ID that identifies a commit. + :type commit_id: str + :param pull_request_id: The unique ID that identifies pull request. + :type pull_request_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'}, + 'event_type': {'key': 'eventType', 'type': 'str'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'pull_request_id': {'key': 'pullRequestId', '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, event_type: str=None, commit_id: str=None, pull_request_id: str=None, repository_url: str=None, branch_name: str=None, provider_type: str=None, **kwargs) -> None: + super(SourceTriggerDescriptor, self).__init__(**kwargs) + self.id = id + self.event_type = event_type + self.commit_id = commit_id + self.pull_request_id = pull_request_id + self.repository_url = repository_url + self.branch_name = branch_name + self.provider_type = provider_type + + +class SourceTriggerUpdateParameters(Model): + """The properties for updating a source based trigger. + + All required parameters must be populated in order to send to Azure. + + :param source_repository: The properties that describes the source(code) + for the task. + :type source_repository: + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceUpdateParameters + :param source_trigger_events: The source event corresponding to the + trigger. + :type source_trigger_events: list[str or + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerEvent] + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'source_repository': {'key': 'sourceRepository', 'type': 'SourceUpdateParameters'}, + 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, source_repository=None, source_trigger_events=None, status="Enabled", **kwargs) -> None: + super(SourceTriggerUpdateParameters, self).__init__(**kwargs) + self.source_repository = source_repository + self.source_trigger_events = source_trigger_events + self.status = status + self.name = name + + +class SourceUpdateParameters(Model): + """The properties for updating the source code repository. + + :param source_control_type: The type of source control service. Possible + values include: 'Github', 'VisualStudioTeamService' + :type source_control_type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.SourceControlType + :param repository_url: The full URL to the source code repository + :type repository_url: str + :param branch: The branch name of the source code. + :type branch: str + :param source_control_auth_properties: The authorization properties for + accessing the source code repository and to set up + webhooks for notifications. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2019_04_01.models.AuthInfoUpdateParameters + """ + + _attribute_map = { + 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, + 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfoUpdateParameters'}, + } + + def __init__(self, *, source_control_type=None, repository_url: str=None, branch: str=None, source_control_auth_properties=None, **kwargs) -> None: + super(SourceUpdateParameters, self).__init__(**kwargs) + self.source_control_type = source_control_type + self.repository_url = repository_url + self.branch = branch + self.source_control_auth_properties = source_control_auth_properties + + +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 + + +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 + + +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 + + +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 + :param name: The name of the artifact. + :type name: str + :param version: The version of the artifact. + :type version: 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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', '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, name: str=None, version: 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 + self.name = name + self.version = version + + +class Task(Resource): + """The task that has the ARM resource and task properties. + The task will have all information to schedule a run 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] + :param identity: Identity for the resource. + :type identity: + ~azure.mgmt.containerregistry.v2019_04_01.models.IdentityProperties + :ivar provisioning_state: The provisioning state of the task. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.ProvisioningState + :ivar creation_date: The creation date of task. + :vartype creation_date: datetime + :param status: The current status of task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStatus + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param step: Required. The properties of a task step. + :type step: + ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStepProperties + :param trigger: The properties that describe all triggers for the task. + :type trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerProperties + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'platform': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'step': {'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}'}, + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, + 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, + 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, + } + + def __init__(self, *, location: str, platform, step, tags=None, identity=None, status=None, agent_configuration=None, timeout: int=3600, trigger=None, credentials=None, **kwargs) -> None: + super(Task, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity + self.provisioning_state = None + self.creation_date = None + self.status = status + self.platform = platform + self.agent_configuration = agent_configuration + self.timeout = timeout + self.step = step + self.trigger = trigger + self.credentials = credentials + + +class TaskRunRequest(RunRequest): + """The parameters for a task run request. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param task_name: Required. The name of task against which run has to be + queued. + :type task_name: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + 'task_name': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, task_name: str, is_archive_enabled: bool=False, values=None, **kwargs) -> None: + super(TaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + self.task_name = task_name + self.values = values + self.type = 'TaskRunRequest' + + +class TaskUpdateParameters(Model): + """The parameters for updating a task. + + :param identity: Identity for the resource. + :type identity: + ~azure.mgmt.containerregistry.v2019_04_01.models.IdentityProperties + :param status: The current status of task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStatus + :param platform: The platform properties against which the run has to + happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformUpdateParameters + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties + :param timeout: Run timeout in seconds. + :type timeout: int + :param step: The properties for updating a task step. + :type step: + ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStepUpdateParameters + :param trigger: The properties for updating trigger properties. + :type trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerUpdateParameters + :param credentials: The parameters that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, + 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, + 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, identity=None, status=None, platform=None, agent_configuration=None, timeout: int=None, step=None, trigger=None, credentials=None, tags=None, **kwargs) -> None: + super(TaskUpdateParameters, self).__init__(**kwargs) + self.identity = identity + self.status = status + self.platform = platform + self.agent_configuration = agent_configuration + self.timeout = timeout + self.step = step + self.trigger = trigger + self.credentials = credentials + self.tags = tags + + +class TimerTrigger(Model): + """The properties of a timer trigger. + + All required parameters must be populated in order to send to Azure. + + :param schedule: Required. The CRON expression for the task schedule + :type schedule: str + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'schedule': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, schedule: str, name: str, status="Enabled", **kwargs) -> None: + super(TimerTrigger, self).__init__(**kwargs) + self.schedule = schedule + self.status = status + self.name = name + + +class TimerTriggerDescriptor(Model): + """TimerTriggerDescriptor. + + :param timer_trigger_name: The timer trigger name that caused the run. + :type timer_trigger_name: str + :param schedule_occurrence: The occurrence that triggered the run. + :type schedule_occurrence: str + """ + + _attribute_map = { + 'timer_trigger_name': {'key': 'timerTriggerName', 'type': 'str'}, + 'schedule_occurrence': {'key': 'scheduleOccurrence', 'type': 'str'}, + } + + def __init__(self, *, timer_trigger_name: str=None, schedule_occurrence: str=None, **kwargs) -> None: + super(TimerTriggerDescriptor, self).__init__(**kwargs) + self.timer_trigger_name = timer_trigger_name + self.schedule_occurrence = schedule_occurrence + + +class TimerTriggerUpdateParameters(Model): + """The properties for updating a timer trigger. + + All required parameters must be populated in order to send to Azure. + + :param schedule: The CRON expression for the task schedule + :type schedule: str + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, schedule: str=None, status="Enabled", **kwargs) -> None: + super(TimerTriggerUpdateParameters, self).__init__(**kwargs) + self.schedule = schedule + self.status = status + self.name = name + + +class TriggerProperties(Model): + """The properties of a trigger. + + :param timer_triggers: The collection of timer triggers. + :type timer_triggers: + list[~azure.mgmt.containerregistry.v2019_04_01.models.TimerTrigger] + :param source_triggers: The collection of triggers based on source code + repository. + :type source_triggers: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SourceTrigger] + :param base_image_trigger: The trigger based on base image dependencies. + :type base_image_trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTrigger + """ + + _attribute_map = { + 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTrigger]'}, + 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTrigger]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTrigger'}, + } + + def __init__(self, *, timer_triggers=None, source_triggers=None, base_image_trigger=None, **kwargs) -> None: + super(TriggerProperties, self).__init__(**kwargs) + self.timer_triggers = timer_triggers + self.source_triggers = source_triggers + self.base_image_trigger = base_image_trigger + + +class TriggerUpdateParameters(Model): + """The properties for updating triggers. + + :param timer_triggers: The collection of timer triggers. + :type timer_triggers: + list[~azure.mgmt.containerregistry.v2019_04_01.models.TimerTriggerUpdateParameters] + :param source_triggers: The collection of triggers based on source code + repository. + :type source_triggers: + list[~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerUpdateParameters] + :param base_image_trigger: The trigger based on base image dependencies. + :type base_image_trigger: + ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerUpdateParameters + """ + + _attribute_map = { + 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTriggerUpdateParameters]'}, + 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTriggerUpdateParameters]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTriggerUpdateParameters'}, + } + + def __init__(self, *, timer_triggers=None, source_triggers=None, base_image_trigger=None, **kwargs) -> None: + super(TriggerUpdateParameters, self).__init__(**kwargs) + self.timer_triggers = timer_triggers + self.source_triggers = source_triggers + self.base_image_trigger = base_image_trigger + + +class TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, type=None, status=None, **kwargs) -> None: + super(TrustPolicy, self).__init__(**kwargs) + self.type = type + self.status = status + + +class UserIdentityProperties(Model): + """UserIdentityProperties. + + :param principal_id: The principal id of user assigned identity. + :type principal_id: str + :param client_id: The client id of user assigned identity. + :type client_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, client_id: str=None, **kwargs) -> None: + super(UserIdentityProperties, self).__init__(**kwargs) + self.principal_id = principal_id + self.client_id = client_id + + +class VirtualNetworkRule(Model): + """Virtual network rule. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2019_04_01.models.Action + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.action = action + self.virtual_network_resource_id = virtual_network_resource_id + + +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.v2019_04_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.v2019_04_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.v2019_04_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 + + +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.v2019_04_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.v2019_04_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 + + +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.v2019_04_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.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/_paged_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/_paged_models.py new file mode 100644 index 000000000000..0cb02d046624 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/_paged_models.py @@ -0,0 +1,105 @@ +# 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) +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) +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) +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) +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) +class RunPaged(Paged): + """ + A paging container for iterating over a list of :class:`Run ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Run]'} + } + + def __init__(self, *args, **kwargs): + + super(RunPaged, self).__init__(*args, **kwargs) +class TaskPaged(Paged): + """ + A paging container for iterating over a list of :class:`Task ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Task]'} + } + + def __init__(self, *args, **kwargs): + + super(TaskPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/actor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/actor.py deleted file mode 100644 index a662f9008a31..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/actor.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/actor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/actor_py3.py deleted file mode 100644 index fdd8b96dda52..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/actor_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/agent_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/agent_properties.py deleted file mode 100644 index c002042a921b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/agent_properties.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 AgentProperties(Model): - """The properties that determine the run agent configuration. - - :param cpu: The CPU configuration in terms of number of cores required for - the run. - :type cpu: int - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(AgentProperties, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/agent_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/agent_properties_py3.py deleted file mode 100644 index 055a36946db8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/agent_properties_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 AgentProperties(Model): - """The properties that determine the run agent configuration. - - :param cpu: The CPU configuration in terms of number of cores required for - the run. - :type cpu: int - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'int'}, - } - - def __init__(self, *, cpu: int=None, **kwargs) -> None: - super(AgentProperties, self).__init__(**kwargs) - self.cpu = cpu diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/argument.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/argument.py deleted file mode 100644 index d081a86245b0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/argument.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 Argument(Model): - """The properties of a run argument. - - All required parameters must be populated in order to send to Azure. - - :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 = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(Argument, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/argument_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/argument_py3.py deleted file mode 100644 index 1f520368d006..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/argument_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 Argument(Model): - """The properties of a run argument. - - All required parameters must be populated in order to send to Azure. - - :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 = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - } - - def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: - super(Argument, self).__init__(**kwargs) - self.name = name - self.value = value - self.is_secret = is_secret diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/auth_info.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/auth_info.py deleted file mode 100644 index 1d131580464d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/auth_info.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 AuthInfo(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: Required. The type of Auth token. Possible values - include: 'PAT', 'OAuth' - :type token_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.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_type': {'required': True}, - '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(AuthInfo, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/auth_info_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/auth_info_py3.py deleted file mode 100644 index a24df2e43a24..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/auth_info_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 AuthInfo(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: Required. The type of Auth token. Possible values - include: 'PAT', 'OAuth' - :type token_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.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_type': {'required': True}, - '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_type, token: str, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: - super(AuthInfo, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/auth_info_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/auth_info_update_parameters.py deleted file mode 100644 index 242773296fb1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/auth_info_update_parameters.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 AuthInfoUpdateParameters(Model): - """The authorization properties for accessing the source code repository. - - :param token_type: The type of Auth token. Possible values include: 'PAT', - 'OAuth' - :type token_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TokenType - :param token: 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 - """ - - _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(AuthInfoUpdateParameters, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/auth_info_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/auth_info_update_parameters_py3.py deleted file mode 100644 index c53157a6f0e5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/auth_info_update_parameters_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 AuthInfoUpdateParameters(Model): - """The authorization properties for accessing the source code repository. - - :param token_type: The type of Auth token. Possible values include: 'PAT', - 'OAuth' - :type token_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TokenType - :param token: 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 - """ - - _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_type=None, token: str=None, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: - super(AuthInfoUpdateParameters, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_dependency.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_dependency.py deleted file mode 100644 index 8b716a34d356..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_dependency.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.v2019_04_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_dependency_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_dependency_py3.py deleted file mode 100644 index 9acc1bd24f02..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_dependency_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.v2019_04_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_trigger.py deleted file mode 100644 index d81f3afde922..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_trigger.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 BaseImageTrigger(Model): - """The trigger based on base image dependency. - - All required parameters must be populated in order to send to Azure. - - :param base_image_trigger_type: Required. The type of the auto trigger for - base image dependency updates. Possible values include: 'All', 'Runtime' - :type base_image_trigger_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerType - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'base_image_trigger_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(BaseImageTrigger, self).__init__(**kwargs) - self.base_image_trigger_type = kwargs.get('base_image_trigger_type', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_trigger_py3.py deleted file mode 100644 index b7b02dfcb6a9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_trigger_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 BaseImageTrigger(Model): - """The trigger based on base image dependency. - - All required parameters must be populated in order to send to Azure. - - :param base_image_trigger_type: Required. The type of the auto trigger for - base image dependency updates. Possible values include: 'All', 'Runtime' - :type base_image_trigger_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerType - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'base_image_trigger_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, base_image_trigger_type, name: str, status="Enabled", **kwargs) -> None: - super(BaseImageTrigger, self).__init__(**kwargs) - self.base_image_trigger_type = base_image_trigger_type - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_trigger_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_trigger_update_parameters.py deleted file mode 100644 index 09b564d6a01a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_trigger_update_parameters.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 BaseImageTriggerUpdateParameters(Model): - """The properties for updating base image dependency trigger. - - All required parameters must be populated in order to send to Azure. - - :param base_image_trigger_type: The type of the auto trigger for base - image dependency updates. Possible values include: 'All', 'Runtime' - :type base_image_trigger_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerType - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(BaseImageTriggerUpdateParameters, self).__init__(**kwargs) - self.base_image_trigger_type = kwargs.get('base_image_trigger_type', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_trigger_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_trigger_update_parameters_py3.py deleted file mode 100644 index 2a15bca06814..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/base_image_trigger_update_parameters_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 BaseImageTriggerUpdateParameters(Model): - """The properties for updating base image dependency trigger. - - All required parameters must be populated in order to send to Azure. - - :param base_image_trigger_type: The type of the auto trigger for base - image dependency updates. Possible values include: 'All', 'Runtime' - :type base_image_trigger_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerType - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str, base_image_trigger_type=None, status="Enabled", **kwargs) -> None: - super(BaseImageTriggerUpdateParameters, self).__init__(**kwargs) - self.base_image_trigger_type = base_image_trigger_type - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/callback_config.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/callback_config.py deleted file mode 100644 index 8ad43a9f785a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/callback_config.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/callback_config_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/callback_config_py3.py deleted file mode 100644 index 27ffc7825431..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/callback_config_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/credentials.py deleted file mode 100644 index b1f70fb84c2e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/credentials.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 Credentials(Model): - """The parameters that describes a set of credentials that will be used when a - run is invoked. - - :param source_registry: Describes the credential parameters for accessing - the source registry. - :type source_registry: - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceRegistryCredentials - :param custom_registries: Describes the credential parameters for - accessing other custom registries. The key - for the dictionary item will be the registry login server - (myregistry.azurecr.io) and - the value of the item will be the registry credentials for accessing the - registry. - :type custom_registries: dict[str, - ~azure.mgmt.containerregistry.v2019_04_01.models.CustomRegistryCredentials] - """ - - _attribute_map = { - 'source_registry': {'key': 'sourceRegistry', 'type': 'SourceRegistryCredentials'}, - 'custom_registries': {'key': 'customRegistries', 'type': '{CustomRegistryCredentials}'}, - } - - def __init__(self, **kwargs): - super(Credentials, self).__init__(**kwargs) - self.source_registry = kwargs.get('source_registry', None) - self.custom_registries = kwargs.get('custom_registries', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/credentials_py3.py deleted file mode 100644 index 96d891a1a65e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/credentials_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 Credentials(Model): - """The parameters that describes a set of credentials that will be used when a - run is invoked. - - :param source_registry: Describes the credential parameters for accessing - the source registry. - :type source_registry: - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceRegistryCredentials - :param custom_registries: Describes the credential parameters for - accessing other custom registries. The key - for the dictionary item will be the registry login server - (myregistry.azurecr.io) and - the value of the item will be the registry credentials for accessing the - registry. - :type custom_registries: dict[str, - ~azure.mgmt.containerregistry.v2019_04_01.models.CustomRegistryCredentials] - """ - - _attribute_map = { - 'source_registry': {'key': 'sourceRegistry', 'type': 'SourceRegistryCredentials'}, - 'custom_registries': {'key': 'customRegistries', 'type': '{CustomRegistryCredentials}'}, - } - - def __init__(self, *, source_registry=None, custom_registries=None, **kwargs) -> None: - super(Credentials, self).__init__(**kwargs) - self.source_registry = source_registry - self.custom_registries = custom_registries diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/custom_registry_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/custom_registry_credentials.py deleted file mode 100644 index db8d9b167b52..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/custom_registry_credentials.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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 CustomRegistryCredentials(Model): - """Describes the credentials that will be used to access a custom registry - during a run. - - :param user_name: The username for logging into the custom registry. - :type user_name: - ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObject - :param password: The password for logging into the custom registry. The - password is a secret - object that allows multiple ways of providing the value for it. - :type password: - ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObject - :param identity: Indicates the managed identity assigned to the custom - credential. If a user-assigned identity - this value is the Client ID. If a system-assigned identity, the value will - be `system`. In - the case of a system-assigned identity, the Client ID will be determined - by the runner. This - identity may be used to authenticate to key vault to retrieve credentials - or it may be the only - source of authentication used for accessing the registry. - :type identity: str - """ - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'SecretObject'}, - 'password': {'key': 'password', 'type': 'SecretObject'}, - 'identity': {'key': 'identity', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CustomRegistryCredentials, self).__init__(**kwargs) - self.user_name = kwargs.get('user_name', None) - self.password = kwargs.get('password', None) - self.identity = kwargs.get('identity', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/custom_registry_credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/custom_registry_credentials_py3.py deleted file mode 100644 index f0de8299f30f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/custom_registry_credentials_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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 CustomRegistryCredentials(Model): - """Describes the credentials that will be used to access a custom registry - during a run. - - :param user_name: The username for logging into the custom registry. - :type user_name: - ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObject - :param password: The password for logging into the custom registry. The - password is a secret - object that allows multiple ways of providing the value for it. - :type password: - ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObject - :param identity: Indicates the managed identity assigned to the custom - credential. If a user-assigned identity - this value is the Client ID. If a system-assigned identity, the value will - be `system`. In - the case of a system-assigned identity, the Client ID will be determined - by the runner. This - identity may be used to authenticate to key vault to retrieve credentials - or it may be the only - source of authentication used for accessing the registry. - :type identity: str - """ - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'SecretObject'}, - 'password': {'key': 'password', 'type': 'SecretObject'}, - 'identity': {'key': 'identity', 'type': 'str'}, - } - - def __init__(self, *, user_name=None, password=None, identity: str=None, **kwargs) -> None: - super(CustomRegistryCredentials, self).__init__(**kwargs) - self.user_name = user_name - self.password = password - self.identity = identity diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_request.py deleted file mode 100644 index 3a5f9dd0f123..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_request.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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 .run_request import RunRequest - - -class DockerBuildRequest(RunRequest): - """The parameters for a docker quick build. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :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 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: Required. The Docker file path relative to the - source location. - :type docker_file_path: str - :param target: The name of the target build stage for the docker build. - :type target: str - :param arguments: The collection of override arguments to be used when - executing the run. - :type arguments: - list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'docker_file_path': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', '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'}, - 'target': {'key': 'target', 'type': 'str'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, **kwargs): - super(DockerBuildRequest, self).__init__(**kwargs) - 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.target = kwargs.get('target', None) - self.arguments = kwargs.get('arguments', None) - self.timeout = kwargs.get('timeout', 3600) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.source_location = kwargs.get('source_location', None) - self.credentials = kwargs.get('credentials', None) - self.type = 'DockerBuildRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_request_py3.py deleted file mode 100644 index 09f6f07455ce..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_request_py3.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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 .run_request_py3 import RunRequest - - -class DockerBuildRequest(RunRequest): - """The parameters for a docker quick build. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :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 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: Required. The Docker file path relative to the - source location. - :type docker_file_path: str - :param target: The name of the target build stage for the docker build. - :type target: str - :param arguments: The collection of override arguments to be used when - executing the run. - :type arguments: - list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'docker_file_path': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', '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'}, - 'target': {'key': 'target', 'type': 'str'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, *, docker_file_path: str, platform, is_archive_enabled: bool=False, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(DockerBuildRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) - 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.target = target - self.arguments = arguments - self.timeout = timeout - self.platform = platform - self.agent_configuration = agent_configuration - self.source_location = source_location - self.credentials = credentials - self.type = 'DockerBuildRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_step.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_step.py deleted file mode 100644 index d001d6aeb24a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_step.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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 .task_step_properties import TaskStepProperties - - -class DockerBuildStep(TaskStepProperties): - """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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :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 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: Required. The Docker file path relative to the - source context. - :type docker_file_path: str - :param target: The name of the target build stage for the docker build. - :type target: str - :param arguments: The collection of override arguments to be used when - executing this build step. - :type arguments: - list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'docker_file_path': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', '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'}, - 'target': {'key': 'target', 'type': 'str'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - } - - def __init__(self, **kwargs): - super(DockerBuildStep, self).__init__(**kwargs) - 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.target = kwargs.get('target', None) - self.arguments = kwargs.get('arguments', None) - self.type = 'Docker' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_step_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_step_py3.py deleted file mode 100644 index f0c8ae1e0490..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_step_py3.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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 .task_step_properties_py3 import TaskStepProperties - - -class DockerBuildStep(TaskStepProperties): - """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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :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 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: Required. The Docker file path relative to the - source context. - :type docker_file_path: str - :param target: The name of the target build stage for the docker build. - :type target: str - :param arguments: The collection of override arguments to be used when - executing this build step. - :type arguments: - list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'docker_file_path': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', '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'}, - 'target': {'key': 'target', 'type': 'str'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - } - - def __init__(self, *, docker_file_path: str, context_path: str=None, context_access_token: str=None, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, **kwargs) -> None: - super(DockerBuildStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - 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.target = target - self.arguments = arguments - self.type = 'Docker' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_step_update_parameters.py deleted file mode 100644 index fbaf24874496..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_step_update_parameters.py +++ /dev/null @@ -1,72 +0,0 @@ -# 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 .task_step_update_parameters import TaskStepUpdateParameters - - -class DockerBuildStepUpdateParameters(TaskStepUpdateParameters): - """The properties for updating a docker build step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :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 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 - context. - :type docker_file_path: str - :param arguments: The collection of override arguments to be used when - executing this build step. - :type arguments: - list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument] - :param target: The name of the target build stage for the docker build. - :type target: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', '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'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DockerBuildStepUpdateParameters, self).__init__(**kwargs) - 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.arguments = kwargs.get('arguments', None) - self.target = kwargs.get('target', None) - self.type = 'Docker' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_step_update_parameters_py3.py deleted file mode 100644 index 8f0549941088..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/docker_build_step_update_parameters_py3.py +++ /dev/null @@ -1,72 +0,0 @@ -# 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 .task_step_update_parameters_py3 import TaskStepUpdateParameters - - -class DockerBuildStepUpdateParameters(TaskStepUpdateParameters): - """The properties for updating a docker build step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :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 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 - context. - :type docker_file_path: str - :param arguments: The collection of override arguments to be used when - executing this build step. - :type arguments: - list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument] - :param target: The name of the target build stage for the docker build. - :type target: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', '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'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, image_names=None, is_push_enabled: bool=None, no_cache: bool=None, docker_file_path: str=None, arguments=None, target: str=None, **kwargs) -> None: - super(DockerBuildStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - 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.arguments = arguments - self.target = target - self.type = 'Docker' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_run_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_run_request.py deleted file mode 100644 index 058798bcdf48..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_run_request.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 .run_request import RunRequest - - -class EncodedTaskRunRequest(RunRequest): - """The parameters for a quick task run request. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Required. Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'encoded_task_content': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, **kwargs): - super(EncodedTaskRunRequest, self).__init__(**kwargs) - self.encoded_task_content = kwargs.get('encoded_task_content', None) - self.encoded_values_content = kwargs.get('encoded_values_content', None) - self.values = kwargs.get('values', None) - self.timeout = kwargs.get('timeout', 3600) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.source_location = kwargs.get('source_location', None) - self.credentials = kwargs.get('credentials', None) - self.type = 'EncodedTaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_run_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_run_request_py3.py deleted file mode 100644 index b441b2eb6974..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_run_request_py3.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 .run_request_py3 import RunRequest - - -class EncodedTaskRunRequest(RunRequest): - """The parameters for a quick task run request. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Required. Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'encoded_task_content': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, *, encoded_task_content: str, platform, is_archive_enabled: bool=False, encoded_values_content: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(EncodedTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) - self.encoded_task_content = encoded_task_content - self.encoded_values_content = encoded_values_content - self.values = values - self.timeout = timeout - self.platform = platform - self.agent_configuration = agent_configuration - self.source_location = source_location - self.credentials = credentials - self.type = 'EncodedTaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_step.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_step.py deleted file mode 100644 index 3ec1e7241ab3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_step.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .task_step_properties import TaskStepProperties - - -class EncodedTaskStep(TaskStepProperties): - """The properties of a encoded task 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Required. Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'encoded_task_content': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(EncodedTaskStep, self).__init__(**kwargs) - self.encoded_task_content = kwargs.get('encoded_task_content', None) - self.encoded_values_content = kwargs.get('encoded_values_content', None) - self.values = kwargs.get('values', None) - self.type = 'EncodedTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_step_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_step_py3.py deleted file mode 100644 index 44a636525bba..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_step_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .task_step_properties_py3 import TaskStepProperties - - -class EncodedTaskStep(TaskStepProperties): - """The properties of a encoded task 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Required. Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'encoded_task_content': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, encoded_task_content: str, context_path: str=None, context_access_token: str=None, encoded_values_content: str=None, values=None, **kwargs) -> None: - super(EncodedTaskStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - self.encoded_task_content = encoded_task_content - self.encoded_values_content = encoded_values_content - self.values = values - self.type = 'EncodedTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_step_update_parameters.py deleted file mode 100644 index 0131180875ea..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_step_update_parameters.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 .task_step_update_parameters import TaskStepUpdateParameters - - -class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters): - """The properties for updating encoded task step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(EncodedTaskStepUpdateParameters, self).__init__(**kwargs) - self.encoded_task_content = kwargs.get('encoded_task_content', None) - self.encoded_values_content = kwargs.get('encoded_values_content', None) - self.values = kwargs.get('values', None) - self.type = 'EncodedTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_step_update_parameters_py3.py deleted file mode 100644 index 0a6d81a51e56..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/encoded_task_step_update_parameters_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 .task_step_update_parameters_py3 import TaskStepUpdateParameters - - -class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters): - """The properties for updating encoded task step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, encoded_task_content: str=None, encoded_values_content: str=None, values=None, **kwargs) -> None: - super(EncodedTaskStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - self.encoded_task_content = encoded_task_content - self.encoded_values_content = encoded_values_content - self.values = values - self.type = 'EncodedTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event.py deleted file mode 100644 index 551570ca39ce..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.v2019_04_01.models.EventRequestMessage - :param event_response_message: The event response message received from - the service URI. - :type event_response_message: - ~azure.mgmt.containerregistry.v2019_04_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_content.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_content.py deleted file mode 100644 index ed0dcaf37e40..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_content.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.v2019_04_01.models.Target - :param request: The request that generated the event. - :type request: ~azure.mgmt.containerregistry.v2019_04_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.v2019_04_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.v2019_04_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_content_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_content_py3.py deleted file mode 100644 index 6a1aaa48e6f8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_content_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.v2019_04_01.models.Target - :param request: The request that generated the event. - :type request: ~azure.mgmt.containerregistry.v2019_04_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.v2019_04_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.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_info.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_info.py deleted file mode 100644 index 7199044b2e39..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_info.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_info_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_info_py3.py deleted file mode 100644 index 192990067407..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_info_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_paged.py deleted file mode 100644 index 8383a31d9908..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_py3.py deleted file mode 100644 index 194ab2d9f4c3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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_py3 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.v2019_04_01.models.EventRequestMessage - :param event_response_message: The event response message received from - the service URI. - :type event_response_message: - ~azure.mgmt.containerregistry.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_request_message.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_request_message.py deleted file mode 100644 index a61ee45522e9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_request_message.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.v2019_04_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_request_message_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_request_message_py3.py deleted file mode 100644 index 5cd12ce3df27..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_request_message_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_response_message.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_response_message.py deleted file mode 100644 index ffb8feb12a1e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_response_message.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_response_message_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_response_message_py3.py deleted file mode 100644 index 4b1351377b4b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/event_response_message_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_run_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_run_request.py deleted file mode 100644 index 6f37fbb28bad..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_run_request.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 .run_request import RunRequest - - -class FileTaskRunRequest(RunRequest): - """The request parameters for a scheduling run against a task file. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: Required. The template/definition file path - relative to the source. - :type task_file_path: str - :param values_file_path: The values/parameters file path relative to the - source. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'task_file_path': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, **kwargs): - super(FileTaskRunRequest, self).__init__(**kwargs) - self.task_file_path = kwargs.get('task_file_path', None) - self.values_file_path = kwargs.get('values_file_path', None) - self.values = kwargs.get('values', None) - self.timeout = kwargs.get('timeout', 3600) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.source_location = kwargs.get('source_location', None) - self.credentials = kwargs.get('credentials', None) - self.type = 'FileTaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_run_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_run_request_py3.py deleted file mode 100644 index 8cbe60aec880..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_run_request_py3.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 .run_request_py3 import RunRequest - - -class FileTaskRunRequest(RunRequest): - """The request parameters for a scheduling run against a task file. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: Required. The template/definition file path - relative to the source. - :type task_file_path: str - :param values_file_path: The values/parameters file path relative to the - source. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'task_file_path': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, *, task_file_path: str, platform, is_archive_enabled: bool=False, values_file_path: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(FileTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) - self.task_file_path = task_file_path - self.values_file_path = values_file_path - self.values = values - self.timeout = timeout - self.platform = platform - self.agent_configuration = agent_configuration - self.source_location = source_location - self.credentials = credentials - self.type = 'FileTaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_step.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_step.py deleted file mode 100644 index 746cdf1e7b0e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_step.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .task_step_properties import TaskStepProperties - - -class FileTaskStep(TaskStepProperties): - """The properties of a task 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: Required. The task template/definition file path - relative to the source context. - :type task_file_path: str - :param values_file_path: The task values/parameters file path relative to - the source context. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'task_file_path': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(FileTaskStep, self).__init__(**kwargs) - self.task_file_path = kwargs.get('task_file_path', None) - self.values_file_path = kwargs.get('values_file_path', None) - self.values = kwargs.get('values', None) - self.type = 'FileTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_step_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_step_py3.py deleted file mode 100644 index 96f1572af084..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_step_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .task_step_properties_py3 import TaskStepProperties - - -class FileTaskStep(TaskStepProperties): - """The properties of a task 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: Required. The task template/definition file path - relative to the source context. - :type task_file_path: str - :param values_file_path: The task values/parameters file path relative to - the source context. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'task_file_path': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, task_file_path: str, context_path: str=None, context_access_token: str=None, values_file_path: str=None, values=None, **kwargs) -> None: - super(FileTaskStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - self.task_file_path = task_file_path - self.values_file_path = values_file_path - self.values = values - self.type = 'FileTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_step_update_parameters.py deleted file mode 100644 index 77ee6084d307..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_step_update_parameters.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 .task_step_update_parameters import TaskStepUpdateParameters - - -class FileTaskStepUpdateParameters(TaskStepUpdateParameters): - """The properties of updating a task step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: The task template/definition file path relative to - the source context. - :type task_file_path: str - :param values_file_path: The values/parameters file path relative to the - source context. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(FileTaskStepUpdateParameters, self).__init__(**kwargs) - self.task_file_path = kwargs.get('task_file_path', None) - self.values_file_path = kwargs.get('values_file_path', None) - self.values = kwargs.get('values', None) - self.type = 'FileTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_step_update_parameters_py3.py deleted file mode 100644 index 37fe85897e23..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/file_task_step_update_parameters_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 .task_step_update_parameters_py3 import TaskStepUpdateParameters - - -class FileTaskStepUpdateParameters(TaskStepUpdateParameters): - """The properties of updating a task step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: The task template/definition file path relative to - the source context. - :type task_file_path: str - :param values_file_path: The values/parameters file path relative to the - source context. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, task_file_path: str=None, values_file_path: str=None, values=None, **kwargs) -> None: - super(FileTaskStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - self.task_file_path = task_file_path - self.values_file_path = values_file_path - self.values = values - self.type = 'FileTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/identity_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/identity_properties.py deleted file mode 100644 index 22eaca73e566..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/identity_properties.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 IdentityProperties(Model): - """Managed identity for the resource. - - :param principal_id: The principal ID of resource identity. - :type principal_id: str - :param tenant_id: The tenant ID of resource. - :type tenant_id: str - :param type: The identity type. Possible values include: 'SystemAssigned', - 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' - :type type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.ResourceIdentityType - :param user_assigned_identities: The list of user identities associated - with the resource. The user identity - dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ - providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerregistry.v2019_04_01.models.UserIdentityProperties] - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentityProperties}'}, - } - - def __init__(self, **kwargs): - super(IdentityProperties, self).__init__(**kwargs) - self.principal_id = kwargs.get('principal_id', None) - self.tenant_id = kwargs.get('tenant_id', None) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/identity_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/identity_properties_py3.py deleted file mode 100644 index 7ec2fcdd8645..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/identity_properties_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 IdentityProperties(Model): - """Managed identity for the resource. - - :param principal_id: The principal ID of resource identity. - :type principal_id: str - :param tenant_id: The tenant ID of resource. - :type tenant_id: str - :param type: The identity type. Possible values include: 'SystemAssigned', - 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' - :type type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.ResourceIdentityType - :param user_assigned_identities: The list of user identities associated - with the resource. The user identity - dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ - providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerregistry.v2019_04_01.models.UserIdentityProperties] - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentityProperties}'}, - } - - def __init__(self, *, principal_id: str=None, tenant_id: str=None, type=None, user_assigned_identities=None, **kwargs) -> None: - super(IdentityProperties, self).__init__(**kwargs) - self.principal_id = principal_id - self.tenant_id = tenant_id - self.type = type - self.user_assigned_identities = user_assigned_identities diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/image_descriptor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/image_descriptor.py deleted file mode 100644 index 1cfd03ed778c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/image_descriptor.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/image_descriptor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/image_descriptor_py3.py deleted file mode 100644 index 72928cf47326..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/image_descriptor_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/image_update_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/image_update_trigger.py deleted file mode 100644 index dd1f19185b2c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/image_update_trigger.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.v2019_04_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/image_update_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/image_update_trigger_py3.py deleted file mode 100644 index 68b25f93bf6b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/image_update_trigger_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.v2019_04_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_image_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_image_parameters.py deleted file mode 100644 index 784f6906ead5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_image_parameters.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportImageParameters(Model): - """ImportImageParameters. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. The source of the image. - :type source: - ~azure.mgmt.containerregistry.v2019_04_01.models.ImportSource - :param target_tags: List of strings of the form repo[:tag]. When tag is - omitted the source will be used (or 'latest' if source tag is also - omitted). - :type target_tags: list[str] - :param untagged_target_repositories: List of strings of repository names - to do a manifest only copy. No tag will be created. - :type untagged_target_repositories: list[str] - :param mode: When Force, any existing target tags will be overwritten. - When NoForce, any existing target tags will fail the operation before any - copying begins. Possible values include: 'NoForce', 'Force'. Default - value: "NoForce" . - :type mode: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.ImportMode - """ - - _validation = { - 'source': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ImportSource'}, - 'target_tags': {'key': 'targetTags', 'type': '[str]'}, - 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportImageParameters, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.target_tags = kwargs.get('target_tags', None) - self.untagged_target_repositories = kwargs.get('untagged_target_repositories', None) - self.mode = kwargs.get('mode', "NoForce") diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_image_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_image_parameters_py3.py deleted file mode 100644 index f7bb5736546e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_image_parameters_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportImageParameters(Model): - """ImportImageParameters. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. The source of the image. - :type source: - ~azure.mgmt.containerregistry.v2019_04_01.models.ImportSource - :param target_tags: List of strings of the form repo[:tag]. When tag is - omitted the source will be used (or 'latest' if source tag is also - omitted). - :type target_tags: list[str] - :param untagged_target_repositories: List of strings of repository names - to do a manifest only copy. No tag will be created. - :type untagged_target_repositories: list[str] - :param mode: When Force, any existing target tags will be overwritten. - When NoForce, any existing target tags will fail the operation before any - copying begins. Possible values include: 'NoForce', 'Force'. Default - value: "NoForce" . - :type mode: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.ImportMode - """ - - _validation = { - 'source': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ImportSource'}, - 'target_tags': {'key': 'targetTags', 'type': '[str]'}, - 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__(self, *, source, target_tags=None, untagged_target_repositories=None, mode="NoForce", **kwargs) -> None: - super(ImportImageParameters, self).__init__(**kwargs) - self.source = source - self.target_tags = target_tags - self.untagged_target_repositories = untagged_target_repositories - self.mode = mode diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_source.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_source.py deleted file mode 100644 index 65e5e6d136fa..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_source.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportSource(Model): - """ImportSource. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource identifier of the source Azure Container - Registry. - :type resource_id: str - :param registry_uri: The address of the source registry (e.g. - 'mcr.microsoft.com'). - :type registry_uri: str - :param credentials: Credentials used when importing from a registry uri. - :type credentials: - ~azure.mgmt.containerregistry.v2019_04_01.models.ImportSourceCredentials - :param source_image: Required. Repository name of the source image. - Specify an image by repository ('hello-world'). This will use the 'latest' - tag. - Specify an image by tag ('hello-world:latest'). - Specify an image by sha256-based manifest digest - ('hello-world@sha256:abc123'). - :type source_image: str - """ - - _validation = { - 'source_image': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'registry_uri': {'key': 'registryUri', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, - 'source_image': {'key': 'sourceImage', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportSource, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.registry_uri = kwargs.get('registry_uri', None) - self.credentials = kwargs.get('credentials', None) - self.source_image = kwargs.get('source_image', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_source_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_source_credentials.py deleted file mode 100644 index b31e5f7e8405..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_source_credentials.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ImportSourceCredentials(Model): - """ImportSourceCredentials. - - All required parameters must be populated in order to send to Azure. - - :param username: The username to authenticate with the source registry. - :type username: str - :param password: Required. The password used to authenticate with the - source registry. - :type password: str - """ - - _validation = { - 'password': {'required': True}, - } - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportSourceCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_source_credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_source_credentials_py3.py deleted file mode 100644 index 4a610e022f88..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_source_credentials_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ImportSourceCredentials(Model): - """ImportSourceCredentials. - - All required parameters must be populated in order to send to Azure. - - :param username: The username to authenticate with the source registry. - :type username: str - :param password: Required. The password used to authenticate with the - source registry. - :type password: str - """ - - _validation = { - 'password': {'required': True}, - } - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__(self, *, password: str, username: str=None, **kwargs) -> None: - super(ImportSourceCredentials, self).__init__(**kwargs) - self.username = username - self.password = password diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_source_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_source_py3.py deleted file mode 100644 index 142bc14834e2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/import_source_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportSource(Model): - """ImportSource. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource identifier of the source Azure Container - Registry. - :type resource_id: str - :param registry_uri: The address of the source registry (e.g. - 'mcr.microsoft.com'). - :type registry_uri: str - :param credentials: Credentials used when importing from a registry uri. - :type credentials: - ~azure.mgmt.containerregistry.v2019_04_01.models.ImportSourceCredentials - :param source_image: Required. Repository name of the source image. - Specify an image by repository ('hello-world'). This will use the 'latest' - tag. - Specify an image by tag ('hello-world:latest'). - Specify an image by sha256-based manifest digest - ('hello-world@sha256:abc123'). - :type source_image: str - """ - - _validation = { - 'source_image': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'registry_uri': {'key': 'registryUri', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, - 'source_image': {'key': 'sourceImage', 'type': 'str'}, - } - - def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None: - super(ImportSource, self).__init__(**kwargs) - self.resource_id = resource_id - self.registry_uri = registry_uri - self.credentials = credentials - self.source_image = source_image diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/ip_rule.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/ip_rule.py deleted file mode 100644 index 200f0cae45e4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/ip_rule.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.Action - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.action = kwargs.get('action', "Allow") - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/ip_rule_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/ip_rule_py3.py deleted file mode 100644 index 1c0f12ff25c5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/ip_rule_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.Action - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.action = action - self.ip_address_or_range = ip_address_or_range diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/network_rule_set.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/network_rule_set.py deleted file mode 100644 index c849dad32a14..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/network_rule_set.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 NetworkRuleSet(Model): - """The network rule set for a container registry. - - All required parameters must be populated in order to send to Azure. - - :param default_action: Required. The default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . - :type default_action: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.DefaultAction - :param virtual_network_rules: The virtual network rules. - :type virtual_network_rules: - list[~azure.mgmt.containerregistry.v2019_04_01.models.VirtualNetworkRule] - :param ip_rules: The IP ACL rules. - :type ip_rules: - list[~azure.mgmt.containerregistry.v2019_04_01.models.IPRule] - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.default_action = kwargs.get('default_action', "Allow") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/network_rule_set_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/network_rule_set_py3.py deleted file mode 100644 index 2a0226a2ccb5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/network_rule_set_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 NetworkRuleSet(Model): - """The network rule set for a container registry. - - All required parameters must be populated in order to send to Azure. - - :param default_action: Required. The default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . - :type default_action: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.DefaultAction - :param virtual_network_rules: The virtual network rules. - :type virtual_network_rules: - list[~azure.mgmt.containerregistry.v2019_04_01.models.VirtualNetworkRule] - :param ip_rules: The IP ACL rules. - :type ip_rules: - list[~azure.mgmt.containerregistry.v2019_04_01.models.IPRule] - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.default_action = default_action - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_definition.py deleted file mode 100644 index d337076b65fd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_definition.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 origin: The origin information of the container registry operation. - :type origin: str - :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.v2019_04_01.models.OperationDisplayDefinition - :param service_specification: The definition of Azure Monitoring service. - :type service_specification: - ~azure.mgmt.containerregistry.v2019_04_01.models.OperationServiceSpecificationDefinition - """ - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, - } - - def __init__(self, **kwargs): - super(OperationDefinition, self).__init__(**kwargs) - self.origin = kwargs.get('origin', None) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_definition_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_definition_paged.py deleted file mode 100644 index 5740dfc64070..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_definition_py3.py deleted file mode 100644 index c9b5e40b3876..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_definition_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 origin: The origin information of the container registry operation. - :type origin: str - :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.v2019_04_01.models.OperationDisplayDefinition - :param service_specification: The definition of Azure Monitoring service. - :type service_specification: - ~azure.mgmt.containerregistry.v2019_04_01.models.OperationServiceSpecificationDefinition - """ - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, - } - - def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: - super(OperationDefinition, self).__init__(**kwargs) - self.origin = origin - self.name = name - self.display = display - self.service_specification = service_specification diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_display_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_display_definition.py deleted file mode 100644 index 6cb8463b21fc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_display_definition.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_display_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_display_definition_py3.py deleted file mode 100644 index 98abb699335c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_display_definition_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_metric_specification_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_metric_specification_definition.py deleted file mode 100644 index 8b40b3b4d6f1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_metric_specification_definition.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 OperationMetricSpecificationDefinition(Model): - """The definition of Azure Monitoring metric. - - :param name: Metric name. - :type name: str - :param display_name: Metric display name. - :type display_name: str - :param display_description: Metric description. - :type display_description: str - :param unit: Metric unit. - :type unit: str - :param aggregation_type: Metric aggregation type. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.internal_metric_name = kwargs.get('internal_metric_name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_metric_specification_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_metric_specification_definition_py3.py deleted file mode 100644 index db4f31c14a17..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_metric_specification_definition_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 OperationMetricSpecificationDefinition(Model): - """The definition of Azure Monitoring metric. - - :param name: Metric name. - :type name: str - :param display_name: Metric display name. - :type display_name: str - :param display_description: Metric description. - :type display_description: str - :param unit: Metric unit. - :type unit: str - :param aggregation_type: Metric aggregation type. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: - super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.internal_metric_name = internal_metric_name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_service_specification_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_service_specification_definition.py deleted file mode 100644 index 0b88d00ee3e0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_service_specification_definition.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 OperationServiceSpecificationDefinition(Model): - """The definition of Azure Monitoring metrics list. - - :param metric_specifications: A list of Azure Monitoring metrics - definition. - :type metric_specifications: - list[~azure.mgmt.containerregistry.v2019_04_01.models.OperationMetricSpecificationDefinition] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, - } - - def __init__(self, **kwargs): - super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_service_specification_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_service_specification_definition_py3.py deleted file mode 100644 index f6bbbdc462da..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/operation_service_specification_definition_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 OperationServiceSpecificationDefinition(Model): - """The definition of Azure Monitoring metrics list. - - :param metric_specifications: A list of Azure Monitoring metrics - definition. - :type metric_specifications: - list[~azure.mgmt.containerregistry.v2019_04_01.models.OperationMetricSpecificationDefinition] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/platform_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/platform_properties.py deleted file mode 100644 index cb38e1c54f10..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/platform_properties.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 run has to happen. - - All required parameters must be populated in order to send to Azure. - - :param os: Required. The operating system type required for the run. - Possible values include: 'Windows', 'Linux' - :type os: str or ~azure.mgmt.containerregistry.v2019_04_01.models.OS - :param architecture: The OS architecture. Possible values include: - 'amd64', 'x86', 'arm' - :type architecture: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.Architecture - :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', - 'v8' - :type variant: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.Variant - """ - - _validation = { - 'os': {'required': True}, - } - - _attribute_map = { - 'os': {'key': 'os', 'type': 'str'}, - 'architecture': {'key': 'architecture', 'type': 'str'}, - 'variant': {'key': 'variant', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PlatformProperties, self).__init__(**kwargs) - self.os = kwargs.get('os', None) - self.architecture = kwargs.get('architecture', None) - self.variant = kwargs.get('variant', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/platform_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/platform_properties_py3.py deleted file mode 100644 index 780b96c78187..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/platform_properties_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 run has to happen. - - All required parameters must be populated in order to send to Azure. - - :param os: Required. The operating system type required for the run. - Possible values include: 'Windows', 'Linux' - :type os: str or ~azure.mgmt.containerregistry.v2019_04_01.models.OS - :param architecture: The OS architecture. Possible values include: - 'amd64', 'x86', 'arm' - :type architecture: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.Architecture - :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', - 'v8' - :type variant: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.Variant - """ - - _validation = { - 'os': {'required': True}, - } - - _attribute_map = { - 'os': {'key': 'os', 'type': 'str'}, - 'architecture': {'key': 'architecture', 'type': 'str'}, - 'variant': {'key': 'variant', 'type': 'str'}, - } - - def __init__(self, *, os, architecture=None, variant=None, **kwargs) -> None: - super(PlatformProperties, self).__init__(**kwargs) - self.os = os - self.architecture = architecture - self.variant = variant diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/platform_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/platform_update_parameters.py deleted file mode 100644 index bcbf907eebe8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/platform_update_parameters.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 PlatformUpdateParameters(Model): - """The properties for updating the platform configuration. - - :param os: The operating system type required for the run. Possible values - include: 'Windows', 'Linux' - :type os: str or ~azure.mgmt.containerregistry.v2019_04_01.models.OS - :param architecture: The OS architecture. Possible values include: - 'amd64', 'x86', 'arm' - :type architecture: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.Architecture - :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', - 'v8' - :type variant: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.Variant - """ - - _attribute_map = { - 'os': {'key': 'os', 'type': 'str'}, - 'architecture': {'key': 'architecture', 'type': 'str'}, - 'variant': {'key': 'variant', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PlatformUpdateParameters, self).__init__(**kwargs) - self.os = kwargs.get('os', None) - self.architecture = kwargs.get('architecture', None) - self.variant = kwargs.get('variant', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/platform_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/platform_update_parameters_py3.py deleted file mode 100644 index 098b04bcf15b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/platform_update_parameters_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 PlatformUpdateParameters(Model): - """The properties for updating the platform configuration. - - :param os: The operating system type required for the run. Possible values - include: 'Windows', 'Linux' - :type os: str or ~azure.mgmt.containerregistry.v2019_04_01.models.OS - :param architecture: The OS architecture. Possible values include: - 'amd64', 'x86', 'arm' - :type architecture: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.Architecture - :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', - 'v8' - :type variant: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.Variant - """ - - _attribute_map = { - 'os': {'key': 'os', 'type': 'str'}, - 'architecture': {'key': 'architecture', 'type': 'str'}, - 'variant': {'key': 'variant', 'type': 'str'}, - } - - def __init__(self, *, os=None, architecture=None, variant=None, **kwargs) -> None: - super(PlatformUpdateParameters, self).__init__(**kwargs) - self.os = os - self.architecture = architecture - self.variant = variant diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/proxy_resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/proxy_resource.py deleted file mode 100644 index 5c52aad9de10..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/proxy_resource.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/proxy_resource_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/proxy_resource_py3.py deleted file mode 100644 index d310c7cbf9b1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/proxy_resource_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/quarantine_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/quarantine_policy.py deleted file mode 100644 index c4c115adfc25..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/quarantine_policy.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 QuarantinePolicy(Model): - """An object that represents quarantine policy for a container registry. - - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.PolicyStatus - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(QuarantinePolicy, self).__init__(**kwargs) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/quarantine_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/quarantine_policy_py3.py deleted file mode 100644 index bf9a7c5422ee..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/quarantine_policy_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 QuarantinePolicy(Model): - """An object that represents quarantine policy for a container registry. - - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.PolicyStatus - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, status=None, **kwargs) -> None: - super(QuarantinePolicy, self).__init__(**kwargs) - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/regenerate_credential_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/regenerate_credential_parameters.py deleted file mode 100644 index 95830bce27c8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/regenerate_credential_parameters.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.v2019_04_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/regenerate_credential_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/regenerate_credential_parameters_py3.py deleted file mode 100644 index e4ca5b2b54d5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/regenerate_credential_parameters_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry.py deleted file mode 100644 index f92559ffb17b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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.v2019_04_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.v2019_04_01.models.ProvisioningState - :ivar status: The status of the container registry at the time the - operation was called. - :vartype status: ~azure.mgmt.containerregistry.v2019_04_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.v2019_04_01.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2019_04_01.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - 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) - self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_list_credentials_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_list_credentials_result.py deleted file mode 100644 index dfe620c8005b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_list_credentials_result.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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.v2019_04_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_list_credentials_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_list_credentials_result_py3.py deleted file mode 100644 index 3447a2a4c8b6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_list_credentials_result_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_name_check_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_name_check_request.py deleted file mode 100644 index 9d4a575eac04..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_name_check_request.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_name_check_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_name_check_request_py3.py deleted file mode 100644 index 67f5ff9be671..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_name_check_request_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_name_status.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_name_status.py deleted file mode 100644 index 94345ba6d549..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_name_status.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_name_status_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_name_status_py3.py deleted file mode 100644 index 8b7b264c2d0d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_name_status_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_paged.py deleted file mode 100644 index c2004a08edd7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_password.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_password.py deleted file mode 100644 index c2b61dbff370..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_password.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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.v2019_04_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, **kwargs): - super(RegistryPassword, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.value = kwargs.get('value', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_password_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_password_py3.py deleted file mode 100644 index 3d2338db95d9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_password_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_policies.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_policies.py deleted file mode 100644 index ec1a20cdf3b1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_policies.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 RegistryPolicies(Model): - """An object that represents policies for a container registry. - - :param quarantine_policy: An object that represents quarantine policy for - a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2019_04_01.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy for a - container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2019_04_01.models.TrustPolicy - """ - - _attribute_map = { - 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, - 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, - } - - def __init__(self, **kwargs): - super(RegistryPolicies, self).__init__(**kwargs) - self.quarantine_policy = kwargs.get('quarantine_policy', None) - self.trust_policy = kwargs.get('trust_policy', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_policies_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_policies_py3.py deleted file mode 100644 index 26168f40905f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_policies_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 RegistryPolicies(Model): - """An object that represents policies for a container registry. - - :param quarantine_policy: An object that represents quarantine policy for - a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2019_04_01.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy for a - container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2019_04_01.models.TrustPolicy - """ - - _attribute_map = { - 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, - 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, - } - - def __init__(self, *, quarantine_policy=None, trust_policy=None, **kwargs) -> None: - super(RegistryPolicies, self).__init__(**kwargs) - self.quarantine_policy = quarantine_policy - self.trust_policy = trust_policy diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_py3.py deleted file mode 100644 index 67a96ad49076..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_py3.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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_py3 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.v2019_04_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.v2019_04_01.models.ProvisioningState - :ivar status: The status of the container registry at the time the - operation was called. - :vartype status: ~azure.mgmt.containerregistry.v2019_04_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.v2019_04_01.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2019_04_01.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=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 - self.network_rule_set = network_rule_set diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_update_parameters.py deleted file mode 100644 index 54038a5800a6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_update_parameters.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.v2019_04_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.v2019_04_01.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2019_04_01.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - 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) - self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_update_parameters_py3.py deleted file mode 100644 index 9e2d8dbd36eb..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_update_parameters_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.v2019_04_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.v2019_04_01.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2019_04_01.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, network_rule_set=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 - self.network_rule_set = network_rule_set diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_usage.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_usage.py deleted file mode 100644 index 694508c46913..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_usage.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.v2019_04_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_usage_list_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_usage_list_result.py deleted file mode 100644 index 2db448e9c8f8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_usage_list_result.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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.v2019_04_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_usage_list_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_usage_list_result_py3.py deleted file mode 100644 index 653514e329b3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_usage_list_result_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_usage_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_usage_py3.py deleted file mode 100644 index 63fb33b318ca..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/registry_usage_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication.py deleted file mode 100644 index 1a43a771f27e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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.v2019_04_01.models.ProvisioningState - :ivar status: The status of the replication at the time the operation was - called. - :vartype status: ~azure.mgmt.containerregistry.v2019_04_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, **kwargs): - super(Replication, self).__init__(**kwargs) - self.provisioning_state = None - self.status = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication_paged.py deleted file mode 100644 index ee77a9541435..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication_py3.py deleted file mode 100644 index 0e03cf9e4c4c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication_py3.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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_py3 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.v2019_04_01.models.ProvisioningState - :ivar status: The status of the replication at the time the operation was - called. - :vartype status: ~azure.mgmt.containerregistry.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication_update_parameters.py deleted file mode 100644 index 003b15583a55..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication_update_parameters.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication_update_parameters_py3.py deleted file mode 100644 index 5497bcdbc1f7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/replication_update_parameters_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/request.py deleted file mode 100644 index e08090f53205..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/request.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/request_py3.py deleted file mode 100644 index f42dae28c955..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/request_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/resource.py deleted file mode 100644 index 3965a6f0cf40..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/resource.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/resource_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/resource_py3.py deleted file mode 100644 index 3a1d4bc4edd1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/resource_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run.py deleted file mode 100644 index bee56deb1e40..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run.py +++ /dev/null @@ -1,140 +0,0 @@ -# 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 Run(ProxyResource): - """Run 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 run_id: The unique identifier for the run. - :type run_id: str - :param status: The current status of the run. Possible values include: - 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', - 'Error', 'Timeout' - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.RunStatus - :param last_updated_time: The last updated time for the run. - :type last_updated_time: datetime - :param run_type: The type of run. Possible values include: 'QuickBuild', - 'QuickRun', 'AutoBuild', 'AutoRun' - :type run_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.RunType - :param create_time: The time the run was scheduled. - :type create_time: datetime - :param start_time: The time the run started. - :type start_time: datetime - :param finish_time: The time the run finished. - :type finish_time: datetime - :param output_images: The list of all images that were generated from the - run. This is applicable if the run generates base image dependencies. - :type output_images: - list[~azure.mgmt.containerregistry.v2019_04_01.models.ImageDescriptor] - :param task: The task against which run was scheduled. - :type task: str - :param image_update_trigger: The image update trigger that caused the run. - This is applicable if the task has base image trigger configured. - :type image_update_trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.ImageUpdateTrigger - :param source_trigger: The source trigger that caused the run. - :type source_trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerDescriptor - :param platform: The platform properties against which the run will - happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties - :param source_registry_auth: The scope of the credentials that were used - to login to the source registry during this run. - :type source_registry_auth: str - :param custom_registries: The list of custom registries that were logged - in during this run. - :type custom_registries: list[str] - :ivar run_error_message: The error message received from backend systems - after the run is scheduled. - :vartype run_error_message: str - :param provisioning_state: The provisioning state of a run. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :type provisioning_state: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.ProvisioningState - :param is_archive_enabled: The value that indicates whether archiving is - enabled or not. Default value: False . - :type is_archive_enabled: bool - :param timer_trigger: The timer trigger that caused the run. - :type timer_trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.TimerTriggerDescriptor - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'run_error_message': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'run_id': {'key': 'properties.runId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, - 'run_type': {'key': 'properties.runType', '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]'}, - 'task': {'key': 'properties.task', 'type': 'str'}, - 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, - 'source_trigger': {'key': 'properties.sourceTrigger', 'type': 'SourceTriggerDescriptor'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'source_registry_auth': {'key': 'properties.sourceRegistryAuth', 'type': 'str'}, - 'custom_registries': {'key': 'properties.customRegistries', 'type': '[str]'}, - 'run_error_message': {'key': 'properties.runErrorMessage', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, - 'timer_trigger': {'key': 'properties.timerTrigger', 'type': 'TimerTriggerDescriptor'}, - } - - def __init__(self, **kwargs): - super(Run, self).__init__(**kwargs) - self.run_id = kwargs.get('run_id', None) - self.status = kwargs.get('status', None) - self.last_updated_time = kwargs.get('last_updated_time', None) - self.run_type = kwargs.get('run_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.task = kwargs.get('task', None) - self.image_update_trigger = kwargs.get('image_update_trigger', None) - self.source_trigger = kwargs.get('source_trigger', None) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.source_registry_auth = kwargs.get('source_registry_auth', None) - self.custom_registries = kwargs.get('custom_registries', None) - self.run_error_message = None - self.provisioning_state = kwargs.get('provisioning_state', None) - self.is_archive_enabled = kwargs.get('is_archive_enabled', False) - self.timer_trigger = kwargs.get('timer_trigger', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_filter.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_filter.py deleted file mode 100644 index 59867044ab2d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_filter.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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 RunFilter(Model): - """Properties that are enabled for Odata querying on runs. - - :param run_id: The unique identifier for the run. - :type run_id: str - :param run_type: The type of run. Possible values include: 'QuickBuild', - 'QuickRun', 'AutoBuild', 'AutoRun' - :type run_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.RunType - :param status: The current status of the run. Possible values include: - 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', - 'Error', 'Timeout' - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.RunStatus - :param create_time: The create time for a run. - :type create_time: datetime - :param finish_time: The time the run finished. - :type finish_time: datetime - :param output_image_manifests: The list of comma-separated image manifests - that were generated from the run. This is applicable if the run is of - build type. - :type output_image_manifests: str - :param is_archive_enabled: The value that indicates whether archiving is - enabled or not. - :type is_archive_enabled: bool - :param task_name: The name of the task that the run corresponds to. - :type task_name: str - """ - - _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'run_type': {'key': 'runType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, - 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'task_name': {'key': 'taskName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RunFilter, self).__init__(**kwargs) - self.run_id = kwargs.get('run_id', None) - self.run_type = kwargs.get('run_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_manifests = kwargs.get('output_image_manifests', None) - self.is_archive_enabled = kwargs.get('is_archive_enabled', None) - self.task_name = kwargs.get('task_name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_filter_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_filter_py3.py deleted file mode 100644 index e41ee0d30c2b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_filter_py3.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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 RunFilter(Model): - """Properties that are enabled for Odata querying on runs. - - :param run_id: The unique identifier for the run. - :type run_id: str - :param run_type: The type of run. Possible values include: 'QuickBuild', - 'QuickRun', 'AutoBuild', 'AutoRun' - :type run_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.RunType - :param status: The current status of the run. Possible values include: - 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', - 'Error', 'Timeout' - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.RunStatus - :param create_time: The create time for a run. - :type create_time: datetime - :param finish_time: The time the run finished. - :type finish_time: datetime - :param output_image_manifests: The list of comma-separated image manifests - that were generated from the run. This is applicable if the run is of - build type. - :type output_image_manifests: str - :param is_archive_enabled: The value that indicates whether archiving is - enabled or not. - :type is_archive_enabled: bool - :param task_name: The name of the task that the run corresponds to. - :type task_name: str - """ - - _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'run_type': {'key': 'runType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, - 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'task_name': {'key': 'taskName', 'type': 'str'}, - } - - def __init__(self, *, run_id: str=None, run_type=None, status=None, create_time=None, finish_time=None, output_image_manifests: str=None, is_archive_enabled: bool=None, task_name: str=None, **kwargs) -> None: - super(RunFilter, self).__init__(**kwargs) - self.run_id = run_id - self.run_type = run_type - self.status = status - self.create_time = create_time - self.finish_time = finish_time - self.output_image_manifests = output_image_manifests - self.is_archive_enabled = is_archive_enabled - self.task_name = task_name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_get_log_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_get_log_result.py deleted file mode 100644 index bfe07c60ccee..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_get_log_result.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 RunGetLogResult(Model): - """The result of get log link operation. - - :param log_link: The link to logs for a run on a azure container registry. - :type log_link: str - """ - - _attribute_map = { - 'log_link': {'key': 'logLink', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RunGetLogResult, self).__init__(**kwargs) - self.log_link = kwargs.get('log_link', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_get_log_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_get_log_result_py3.py deleted file mode 100644 index dc68e84d93db..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_get_log_result_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 RunGetLogResult(Model): - """The result of get log link operation. - - :param log_link: The link to logs for a run on a azure container registry. - :type log_link: str - """ - - _attribute_map = { - 'log_link': {'key': 'logLink', 'type': 'str'}, - } - - def __init__(self, *, log_link: str=None, **kwargs) -> None: - super(RunGetLogResult, self).__init__(**kwargs) - self.log_link = log_link diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_paged.py deleted file mode 100644 index 3c45d3ae976f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 RunPaged(Paged): - """ - A paging container for iterating over a list of :class:`Run ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Run]'} - } - - def __init__(self, *args, **kwargs): - - super(RunPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_py3.py deleted file mode 100644 index 232591c6833f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_py3.py +++ /dev/null @@ -1,140 +0,0 @@ -# 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_py3 import ProxyResource - - -class Run(ProxyResource): - """Run 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 run_id: The unique identifier for the run. - :type run_id: str - :param status: The current status of the run. Possible values include: - 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', - 'Error', 'Timeout' - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.RunStatus - :param last_updated_time: The last updated time for the run. - :type last_updated_time: datetime - :param run_type: The type of run. Possible values include: 'QuickBuild', - 'QuickRun', 'AutoBuild', 'AutoRun' - :type run_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.RunType - :param create_time: The time the run was scheduled. - :type create_time: datetime - :param start_time: The time the run started. - :type start_time: datetime - :param finish_time: The time the run finished. - :type finish_time: datetime - :param output_images: The list of all images that were generated from the - run. This is applicable if the run generates base image dependencies. - :type output_images: - list[~azure.mgmt.containerregistry.v2019_04_01.models.ImageDescriptor] - :param task: The task against which run was scheduled. - :type task: str - :param image_update_trigger: The image update trigger that caused the run. - This is applicable if the task has base image trigger configured. - :type image_update_trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.ImageUpdateTrigger - :param source_trigger: The source trigger that caused the run. - :type source_trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerDescriptor - :param platform: The platform properties against which the run will - happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties - :param source_registry_auth: The scope of the credentials that were used - to login to the source registry during this run. - :type source_registry_auth: str - :param custom_registries: The list of custom registries that were logged - in during this run. - :type custom_registries: list[str] - :ivar run_error_message: The error message received from backend systems - after the run is scheduled. - :vartype run_error_message: str - :param provisioning_state: The provisioning state of a run. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :type provisioning_state: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.ProvisioningState - :param is_archive_enabled: The value that indicates whether archiving is - enabled or not. Default value: False . - :type is_archive_enabled: bool - :param timer_trigger: The timer trigger that caused the run. - :type timer_trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.TimerTriggerDescriptor - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'run_error_message': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'run_id': {'key': 'properties.runId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, - 'run_type': {'key': 'properties.runType', '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]'}, - 'task': {'key': 'properties.task', 'type': 'str'}, - 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, - 'source_trigger': {'key': 'properties.sourceTrigger', 'type': 'SourceTriggerDescriptor'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'source_registry_auth': {'key': 'properties.sourceRegistryAuth', 'type': 'str'}, - 'custom_registries': {'key': 'properties.customRegistries', 'type': '[str]'}, - 'run_error_message': {'key': 'properties.runErrorMessage', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, - 'timer_trigger': {'key': 'properties.timerTrigger', 'type': 'TimerTriggerDescriptor'}, - } - - def __init__(self, *, run_id: str=None, status=None, last_updated_time=None, run_type=None, create_time=None, start_time=None, finish_time=None, output_images=None, task: str=None, image_update_trigger=None, source_trigger=None, platform=None, agent_configuration=None, source_registry_auth: str=None, custom_registries=None, provisioning_state=None, is_archive_enabled: bool=False, timer_trigger=None, **kwargs) -> None: - super(Run, self).__init__(**kwargs) - self.run_id = run_id - self.status = status - self.last_updated_time = last_updated_time - self.run_type = run_type - self.create_time = create_time - self.start_time = start_time - self.finish_time = finish_time - self.output_images = output_images - self.task = task - self.image_update_trigger = image_update_trigger - self.source_trigger = source_trigger - self.platform = platform - self.agent_configuration = agent_configuration - self.source_registry_auth = source_registry_auth - self.custom_registries = custom_registries - self.run_error_message = None - self.provisioning_state = provisioning_state - self.is_archive_enabled = is_archive_enabled - self.timer_trigger = timer_trigger diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_request.py deleted file mode 100644 index 6a49775b5fe9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_request.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 RunRequest(Model): - """The request parameters for scheduling a run. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildRequest, FileTaskRunRequest, TaskRunRequest, - EncodedTaskRunRequest - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} - } - - def __init__(self, **kwargs): - super(RunRequest, self).__init__(**kwargs) - self.is_archive_enabled = kwargs.get('is_archive_enabled', False) - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_request_py3.py deleted file mode 100644 index 1bf6cabe0c2d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_request_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 RunRequest(Model): - """The request parameters for scheduling a run. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildRequest, FileTaskRunRequest, TaskRunRequest, - EncodedTaskRunRequest - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} - } - - def __init__(self, *, is_archive_enabled: bool=False, **kwargs) -> None: - super(RunRequest, self).__init__(**kwargs) - self.is_archive_enabled = is_archive_enabled - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_update_parameters.py deleted file mode 100644 index 7c99f1e212d0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_update_parameters.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 RunUpdateParameters(Model): - """The set of run 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(RunUpdateParameters, self).__init__(**kwargs) - self.is_archive_enabled = kwargs.get('is_archive_enabled', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_update_parameters_py3.py deleted file mode 100644 index 62bcd0c6f4bd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/run_update_parameters_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 RunUpdateParameters(Model): - """The set of run 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(RunUpdateParameters, self).__init__(**kwargs) - self.is_archive_enabled = is_archive_enabled diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/secret_object.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/secret_object.py deleted file mode 100644 index 14b6399aaebe..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/secret_object.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 SecretObject(Model): - """Describes the properties of a secret object value. - - :param value: The value of the secret. The format of this value will be - determined - based on the type of the secret object. If the type is Opaque, the value - will be - used as is without any modification. - :type value: str - :param type: The type of the secret object which determines how the value - of the secret object has to be - interpreted. Possible values include: 'Opaque', 'Vaultsecret' - :type type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObjectType - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SecretObject, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.type = kwargs.get('type', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/secret_object_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/secret_object_py3.py deleted file mode 100644 index f5e5b0100ae0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/secret_object_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 SecretObject(Model): - """Describes the properties of a secret object value. - - :param value: The value of the secret. The format of this value will be - determined - based on the type of the secret object. If the type is Opaque, the value - will be - used as is without any modification. - :type value: str - :param type: The type of the secret object which determines how the value - of the secret object has to be - interpreted. Possible values include: 'Opaque', 'Vaultsecret' - :type type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObjectType - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, *, value: str=None, type=None, **kwargs) -> None: - super(SecretObject, self).__init__(**kwargs) - self.value = value - self.type = type diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/set_value.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/set_value.py deleted file mode 100644 index ec349f6bb414..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/set_value.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 SetValue(Model): - """The properties of a overridable value that can be passed to a task - template. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the overridable value. - :type name: str - :param value: Required. The overridable value. - :type value: str - :param is_secret: Flag to indicate whether the value represents a secret - or not. Default value: False . - :type is_secret: bool - """ - - _validation = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(SetValue, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/set_value_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/set_value_py3.py deleted file mode 100644 index cce869040a6a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/set_value_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 SetValue(Model): - """The properties of a overridable value that can be passed to a task - template. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the overridable value. - :type name: str - :param value: Required. The overridable value. - :type value: str - :param is_secret: Flag to indicate whether the value represents a secret - or not. Default value: False . - :type is_secret: bool - """ - - _validation = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - } - - def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: - super(SetValue, self).__init__(**kwargs) - self.name = name - self.value = value - self.is_secret = is_secret diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/sku.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/sku.py deleted file mode 100644 index c56cbccd54ef..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/sku.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.v2019_04_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.v2019_04_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, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/sku_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/sku_py3.py deleted file mode 100644 index 3866df527bf9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/sku_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.v2019_04_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.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source.py deleted file mode 100644 index 132f4b2c1324..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_properties.py deleted file mode 100644 index dbef4d55e747..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_properties.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 SourceProperties(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.v2019_04_01.models.SourceControlType - :param repository_url: Required. The full URL to the source code - repository - :type repository_url: str - :param branch: The branch name of the source code. - :type branch: str - :param source_control_auth_properties: The authorization properties for - accessing the source code repository and to set up - webhooks for notifications. - :type source_control_auth_properties: - ~azure.mgmt.containerregistry.v2019_04_01.models.AuthInfo - """ - - _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'}, - 'branch': {'key': 'branch', 'type': 'str'}, - 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfo'}, - } - - def __init__(self, **kwargs): - super(SourceProperties, self).__init__(**kwargs) - self.source_control_type = kwargs.get('source_control_type', None) - self.repository_url = kwargs.get('repository_url', None) - self.branch = kwargs.get('branch', None) - self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_properties_py3.py deleted file mode 100644 index d93199cbfcc3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_properties_py3.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 SourceProperties(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.v2019_04_01.models.SourceControlType - :param repository_url: Required. The full URL to the source code - repository - :type repository_url: str - :param branch: The branch name of the source code. - :type branch: str - :param source_control_auth_properties: The authorization properties for - accessing the source code repository and to set up - webhooks for notifications. - :type source_control_auth_properties: - ~azure.mgmt.containerregistry.v2019_04_01.models.AuthInfo - """ - - _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'}, - 'branch': {'key': 'branch', 'type': 'str'}, - 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfo'}, - } - - def __init__(self, *, source_control_type, repository_url: str, branch: str=None, source_control_auth_properties=None, **kwargs) -> None: - super(SourceProperties, self).__init__(**kwargs) - self.source_control_type = source_control_type - self.repository_url = repository_url - self.branch = branch - self.source_control_auth_properties = source_control_auth_properties diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_py3.py deleted file mode 100644 index 5aadcd407862..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_registry_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_registry_credentials.py deleted file mode 100644 index c97651852d16..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_registry_credentials.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 SourceRegistryCredentials(Model): - """Describes the credential parameters for accessing the source registry. - - :param login_mode: The authentication mode which determines the source - registry login scope. The credentials for the source registry - will be generated using the given scope. These credentials will be used to - login to - the source registry during the run. Possible values include: 'None', - 'Default' - :type login_mode: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceRegistryLoginMode - """ - - _attribute_map = { - 'login_mode': {'key': 'loginMode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SourceRegistryCredentials, self).__init__(**kwargs) - self.login_mode = kwargs.get('login_mode', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_registry_credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_registry_credentials_py3.py deleted file mode 100644 index d2a5a774c754..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_registry_credentials_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 SourceRegistryCredentials(Model): - """Describes the credential parameters for accessing the source registry. - - :param login_mode: The authentication mode which determines the source - registry login scope. The credentials for the source registry - will be generated using the given scope. These credentials will be used to - login to - the source registry during the run. Possible values include: 'None', - 'Default' - :type login_mode: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceRegistryLoginMode - """ - - _attribute_map = { - 'login_mode': {'key': 'loginMode', 'type': 'str'}, - } - - def __init__(self, *, login_mode=None, **kwargs) -> None: - super(SourceRegistryCredentials, self).__init__(**kwargs) - self.login_mode = login_mode diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger.py deleted file mode 100644 index 1dd3f6970e00..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 SourceTrigger(Model): - """The properties of a source based trigger. - - All required parameters must be populated in order to send to Azure. - - :param source_repository: Required. The properties that describes the - source(code) for the task. - :type source_repository: - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceProperties - :param source_trigger_events: Required. The source event corresponding to - the trigger. - :type source_trigger_events: list[str or - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerEvent] - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'source_repository': {'required': True}, - 'source_trigger_events': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceProperties'}, - 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SourceTrigger, self).__init__(**kwargs) - self.source_repository = kwargs.get('source_repository', None) - self.source_trigger_events = kwargs.get('source_trigger_events', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_descriptor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_descriptor.py deleted file mode 100644 index 4ee9a9b20c64..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_descriptor.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 SourceTriggerDescriptor(Model): - """The source trigger that caused a run. - - :param id: The unique ID of the trigger. - :type id: str - :param event_type: The event type of the trigger. - :type event_type: str - :param commit_id: The unique ID that identifies a commit. - :type commit_id: str - :param pull_request_id: The unique ID that identifies pull request. - :type pull_request_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'}, - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'commit_id': {'key': 'commitId', 'type': 'str'}, - 'pull_request_id': {'key': 'pullRequestId', '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(SourceTriggerDescriptor, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.event_type = kwargs.get('event_type', None) - self.commit_id = kwargs.get('commit_id', None) - self.pull_request_id = kwargs.get('pull_request_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_descriptor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_descriptor_py3.py deleted file mode 100644 index bb35eb70537d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_descriptor_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 SourceTriggerDescriptor(Model): - """The source trigger that caused a run. - - :param id: The unique ID of the trigger. - :type id: str - :param event_type: The event type of the trigger. - :type event_type: str - :param commit_id: The unique ID that identifies a commit. - :type commit_id: str - :param pull_request_id: The unique ID that identifies pull request. - :type pull_request_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'}, - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'commit_id': {'key': 'commitId', 'type': 'str'}, - 'pull_request_id': {'key': 'pullRequestId', '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, event_type: str=None, commit_id: str=None, pull_request_id: str=None, repository_url: str=None, branch_name: str=None, provider_type: str=None, **kwargs) -> None: - super(SourceTriggerDescriptor, self).__init__(**kwargs) - self.id = id - self.event_type = event_type - self.commit_id = commit_id - self.pull_request_id = pull_request_id - self.repository_url = repository_url - self.branch_name = branch_name - self.provider_type = provider_type diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_py3.py deleted file mode 100644 index ba1e1403dfc9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 SourceTrigger(Model): - """The properties of a source based trigger. - - All required parameters must be populated in order to send to Azure. - - :param source_repository: Required. The properties that describes the - source(code) for the task. - :type source_repository: - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceProperties - :param source_trigger_events: Required. The source event corresponding to - the trigger. - :type source_trigger_events: list[str or - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerEvent] - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'source_repository': {'required': True}, - 'source_trigger_events': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceProperties'}, - 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, source_repository, source_trigger_events, name: str, status="Enabled", **kwargs) -> None: - super(SourceTrigger, self).__init__(**kwargs) - self.source_repository = source_repository - self.source_trigger_events = source_trigger_events - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_update_parameters.py deleted file mode 100644 index aa6e13a9e8b0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_update_parameters.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 SourceTriggerUpdateParameters(Model): - """The properties for updating a source based trigger. - - All required parameters must be populated in order to send to Azure. - - :param source_repository: The properties that describes the source(code) - for the task. - :type source_repository: - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceUpdateParameters - :param source_trigger_events: The source event corresponding to the - trigger. - :type source_trigger_events: list[str or - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerEvent] - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceUpdateParameters'}, - 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SourceTriggerUpdateParameters, self).__init__(**kwargs) - self.source_repository = kwargs.get('source_repository', None) - self.source_trigger_events = kwargs.get('source_trigger_events', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_update_parameters_py3.py deleted file mode 100644 index 8cd0847036d4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_trigger_update_parameters_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 SourceTriggerUpdateParameters(Model): - """The properties for updating a source based trigger. - - All required parameters must be populated in order to send to Azure. - - :param source_repository: The properties that describes the source(code) - for the task. - :type source_repository: - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceUpdateParameters - :param source_trigger_events: The source event corresponding to the - trigger. - :type source_trigger_events: list[str or - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerEvent] - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceUpdateParameters'}, - 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str, source_repository=None, source_trigger_events=None, status="Enabled", **kwargs) -> None: - super(SourceTriggerUpdateParameters, self).__init__(**kwargs) - self.source_repository = source_repository - self.source_trigger_events = source_trigger_events - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_update_parameters.py deleted file mode 100644 index c8c2c9b10f0d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_update_parameters.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 SourceUpdateParameters(Model): - """The properties for updating the source code repository. - - :param source_control_type: The type of source control service. Possible - values include: 'Github', 'VisualStudioTeamService' - :type source_control_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceControlType - :param repository_url: The full URL to the source code repository - :type repository_url: str - :param branch: The branch name of the source code. - :type branch: str - :param source_control_auth_properties: The authorization properties for - accessing the source code repository and to set up - webhooks for notifications. - :type source_control_auth_properties: - ~azure.mgmt.containerregistry.v2019_04_01.models.AuthInfoUpdateParameters - """ - - _attribute_map = { - 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, - 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, - 'branch': {'key': 'branch', 'type': 'str'}, - 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfoUpdateParameters'}, - } - - def __init__(self, **kwargs): - super(SourceUpdateParameters, self).__init__(**kwargs) - self.source_control_type = kwargs.get('source_control_type', None) - self.repository_url = kwargs.get('repository_url', None) - self.branch = kwargs.get('branch', None) - self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_update_parameters_py3.py deleted file mode 100644 index 464266656cea..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_update_parameters_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 SourceUpdateParameters(Model): - """The properties for updating the source code repository. - - :param source_control_type: The type of source control service. Possible - values include: 'Github', 'VisualStudioTeamService' - :type source_control_type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.SourceControlType - :param repository_url: The full URL to the source code repository - :type repository_url: str - :param branch: The branch name of the source code. - :type branch: str - :param source_control_auth_properties: The authorization properties for - accessing the source code repository and to set up - webhooks for notifications. - :type source_control_auth_properties: - ~azure.mgmt.containerregistry.v2019_04_01.models.AuthInfoUpdateParameters - """ - - _attribute_map = { - 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, - 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, - 'branch': {'key': 'branch', 'type': 'str'}, - 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfoUpdateParameters'}, - } - - def __init__(self, *, source_control_type=None, repository_url: str=None, branch: str=None, source_control_auth_properties=None, **kwargs) -> None: - super(SourceUpdateParameters, self).__init__(**kwargs) - self.source_control_type = source_control_type - self.repository_url = repository_url - self.branch = branch - self.source_control_auth_properties = source_control_auth_properties diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_upload_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_upload_definition.py deleted file mode 100644 index 381fd538e9e3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_upload_definition.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_upload_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_upload_definition_py3.py deleted file mode 100644 index cff615964e11..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_upload_definition_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/status.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/status.py deleted file mode 100644 index 76444c500634..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/status.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/status_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/status_py3.py deleted file mode 100644 index 1f4611c49912..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/status_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/storage_account_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/storage_account_properties.py deleted file mode 100644 index 0541b7651cbd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/storage_account_properties.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/storage_account_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/storage_account_properties_py3.py deleted file mode 100644 index 5714fde0fcd2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/storage_account_properties_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/target.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/target.py deleted file mode 100644 index 228df1d19f00..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/target.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', '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) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/target_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/target_py3.py deleted file mode 100644 index 3b312ee2c0da..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/target_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', '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, name: str=None, version: 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 - self.name = name - self.version = version diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task.py deleted file mode 100644 index cfbd84ee1396..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task.py +++ /dev/null @@ -1,111 +0,0 @@ -# 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 Task(Resource): - """The task that has the ARM resource and task properties. - The task will have all information to schedule a run 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] - :param identity: Identity for the resource. - :type identity: - ~azure.mgmt.containerregistry.v2019_04_01.models.IdentityProperties - :ivar provisioning_state: The provisioning state of the task. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :vartype provisioning_state: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.ProvisioningState - :ivar creation_date: The creation date of task. - :vartype creation_date: datetime - :param status: The current status of task. Possible values include: - 'Disabled', 'Enabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStatus - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param step: Required. The properties of a task step. - :type step: - ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStepProperties - :param trigger: The properties that describe all triggers for the task. - :type trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerProperties - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'platform': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'step': {'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}'}, - 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, - 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, - 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, - } - - def __init__(self, **kwargs): - super(Task, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.creation_date = None - self.status = kwargs.get('status', None) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.timeout = kwargs.get('timeout', 3600) - self.step = kwargs.get('step', None) - self.trigger = kwargs.get('trigger', None) - self.credentials = kwargs.get('credentials', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_paged.py deleted file mode 100644 index 44e2ec6cdf4d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 TaskPaged(Paged): - """ - A paging container for iterating over a list of :class:`Task ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Task]'} - } - - def __init__(self, *args, **kwargs): - - super(TaskPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_py3.py deleted file mode 100644 index 0560597010e5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_py3.py +++ /dev/null @@ -1,111 +0,0 @@ -# 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_py3 import Resource - - -class Task(Resource): - """The task that has the ARM resource and task properties. - The task will have all information to schedule a run 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] - :param identity: Identity for the resource. - :type identity: - ~azure.mgmt.containerregistry.v2019_04_01.models.IdentityProperties - :ivar provisioning_state: The provisioning state of the task. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :vartype provisioning_state: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.ProvisioningState - :ivar creation_date: The creation date of task. - :vartype creation_date: datetime - :param status: The current status of task. Possible values include: - 'Disabled', 'Enabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStatus - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param step: Required. The properties of a task step. - :type step: - ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStepProperties - :param trigger: The properties that describe all triggers for the task. - :type trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerProperties - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'platform': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'step': {'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}'}, - 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, - 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, - 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, - } - - def __init__(self, *, location: str, platform, step, tags=None, identity=None, status=None, agent_configuration=None, timeout: int=3600, trigger=None, credentials=None, **kwargs) -> None: - super(Task, self).__init__(location=location, tags=tags, **kwargs) - self.identity = identity - self.provisioning_state = None - self.creation_date = None - self.status = status - self.platform = platform - self.agent_configuration = agent_configuration - self.timeout = timeout - self.step = step - self.trigger = trigger - self.credentials = credentials diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_run_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_run_request.py deleted file mode 100644 index ffbb65f96eb4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_run_request.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 .run_request import RunRequest - - -class TaskRunRequest(RunRequest): - """The parameters for a task run request. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param task_name: Required. The name of task against which run has to be - queued. - :type task_name: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - 'task_name': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_name': {'key': 'taskName', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(TaskRunRequest, self).__init__(**kwargs) - self.task_name = kwargs.get('task_name', None) - self.values = kwargs.get('values', None) - self.type = 'TaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_run_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_run_request_py3.py deleted file mode 100644 index 180ca3e71510..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_run_request_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 .run_request_py3 import RunRequest - - -class TaskRunRequest(RunRequest): - """The parameters for a task run request. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param task_name: Required. The name of task against which run has to be - queued. - :type task_name: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - 'task_name': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_name': {'key': 'taskName', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, task_name: str, is_archive_enabled: bool=False, values=None, **kwargs) -> None: - super(TaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) - self.task_name = task_name - self.values = values - self.type = 'TaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_properties.py deleted file mode 100644 index c891001439f6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_properties.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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 TaskStepProperties(Model): - """Base properties for any task step. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildStep, FileTaskStep, EncodedTaskStep - - 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Docker': 'DockerBuildStep', 'FileTask': 'FileTaskStep', 'EncodedTask': 'EncodedTaskStep'} - } - - def __init__(self, **kwargs): - super(TaskStepProperties, self).__init__(**kwargs) - self.base_image_dependencies = None - self.context_path = kwargs.get('context_path', None) - self.context_access_token = kwargs.get('context_access_token', None) - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_properties_py3.py deleted file mode 100644 index 6ff4aa05523f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_properties_py3.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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 TaskStepProperties(Model): - """Base properties for any task step. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildStep, FileTaskStep, EncodedTaskStep - - 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Docker': 'DockerBuildStep', 'FileTask': 'FileTaskStep', 'EncodedTask': 'EncodedTaskStep'} - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, **kwargs) -> None: - super(TaskStepProperties, self).__init__(**kwargs) - self.base_image_dependencies = None - self.context_path = context_path - self.context_access_token = context_access_token - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_update_parameters.py deleted file mode 100644 index a9047fd426b9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_update_parameters.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 TaskStepUpdateParameters(Model): - """Base properties for updating any task step. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildStepUpdateParameters, - FileTaskStepUpdateParameters, EncodedTaskStepUpdateParameters - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Docker': 'DockerBuildStepUpdateParameters', 'FileTask': 'FileTaskStepUpdateParameters', 'EncodedTask': 'EncodedTaskStepUpdateParameters'} - } - - def __init__(self, **kwargs): - super(TaskStepUpdateParameters, self).__init__(**kwargs) - self.context_path = kwargs.get('context_path', None) - self.context_access_token = kwargs.get('context_access_token', None) - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_update_parameters_py3.py deleted file mode 100644 index 70f77214e15b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_update_parameters_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 TaskStepUpdateParameters(Model): - """Base properties for updating any task step. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildStepUpdateParameters, - FileTaskStepUpdateParameters, EncodedTaskStepUpdateParameters - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Docker': 'DockerBuildStepUpdateParameters', 'FileTask': 'FileTaskStepUpdateParameters', 'EncodedTask': 'EncodedTaskStepUpdateParameters'} - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, **kwargs) -> None: - super(TaskStepUpdateParameters, self).__init__(**kwargs) - self.context_path = context_path - self.context_access_token = context_access_token - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_update_parameters.py deleted file mode 100644 index 3d51771df0b2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_update_parameters.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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 TaskUpdateParameters(Model): - """The parameters for updating a task. - - :param identity: Identity for the resource. - :type identity: - ~azure.mgmt.containerregistry.v2019_04_01.models.IdentityProperties - :param status: The current status of task. Possible values include: - 'Disabled', 'Enabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStatus - :param platform: The platform properties against which the run has to - happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformUpdateParameters - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties - :param timeout: Run timeout in seconds. - :type timeout: int - :param step: The properties for updating a task step. - :type step: - ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStepUpdateParameters - :param trigger: The properties for updating trigger properties. - :type trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerUpdateParameters - :param credentials: The parameters that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials - :param tags: The ARM resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, - 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, - 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(TaskUpdateParameters, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.status = kwargs.get('status', None) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.timeout = kwargs.get('timeout', None) - self.step = kwargs.get('step', None) - self.trigger = kwargs.get('trigger', None) - self.credentials = kwargs.get('credentials', None) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_update_parameters_py3.py deleted file mode 100644 index 65fd22c85b26..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_update_parameters_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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 TaskUpdateParameters(Model): - """The parameters for updating a task. - - :param identity: Identity for the resource. - :type identity: - ~azure.mgmt.containerregistry.v2019_04_01.models.IdentityProperties - :param status: The current status of task. Possible values include: - 'Disabled', 'Enabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStatus - :param platform: The platform properties against which the run has to - happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformUpdateParameters - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties - :param timeout: Run timeout in seconds. - :type timeout: int - :param step: The properties for updating a task step. - :type step: - ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStepUpdateParameters - :param trigger: The properties for updating trigger properties. - :type trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerUpdateParameters - :param credentials: The parameters that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials - :param tags: The ARM resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, - 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, - 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, identity=None, status=None, platform=None, agent_configuration=None, timeout: int=None, step=None, trigger=None, credentials=None, tags=None, **kwargs) -> None: - super(TaskUpdateParameters, self).__init__(**kwargs) - self.identity = identity - self.status = status - self.platform = platform - self.agent_configuration = agent_configuration - self.timeout = timeout - self.step = step - self.trigger = trigger - self.credentials = credentials - self.tags = tags diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger.py deleted file mode 100644 index 2366b5652b0d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 TimerTrigger(Model): - """The properties of a timer trigger. - - All required parameters must be populated in order to send to Azure. - - :param schedule: Required. The CRON expression for the task schedule - :type schedule: str - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'schedule': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'schedule': {'key': 'schedule', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TimerTrigger, self).__init__(**kwargs) - self.schedule = kwargs.get('schedule', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_descriptor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_descriptor.py deleted file mode 100644 index 8993d44e2775..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_descriptor.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 TimerTriggerDescriptor(Model): - """TimerTriggerDescriptor. - - :param timer_trigger_name: The timer trigger name that caused the run. - :type timer_trigger_name: str - :param schedule_occurrence: The occurrence that triggered the run. - :type schedule_occurrence: str - """ - - _attribute_map = { - 'timer_trigger_name': {'key': 'timerTriggerName', 'type': 'str'}, - 'schedule_occurrence': {'key': 'scheduleOccurrence', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TimerTriggerDescriptor, self).__init__(**kwargs) - self.timer_trigger_name = kwargs.get('timer_trigger_name', None) - self.schedule_occurrence = kwargs.get('schedule_occurrence', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_descriptor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_descriptor_py3.py deleted file mode 100644 index d2768782fb37..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_descriptor_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 TimerTriggerDescriptor(Model): - """TimerTriggerDescriptor. - - :param timer_trigger_name: The timer trigger name that caused the run. - :type timer_trigger_name: str - :param schedule_occurrence: The occurrence that triggered the run. - :type schedule_occurrence: str - """ - - _attribute_map = { - 'timer_trigger_name': {'key': 'timerTriggerName', 'type': 'str'}, - 'schedule_occurrence': {'key': 'scheduleOccurrence', 'type': 'str'}, - } - - def __init__(self, *, timer_trigger_name: str=None, schedule_occurrence: str=None, **kwargs) -> None: - super(TimerTriggerDescriptor, self).__init__(**kwargs) - self.timer_trigger_name = timer_trigger_name - self.schedule_occurrence = schedule_occurrence diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_py3.py deleted file mode 100644 index 8fd0d359b172..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 TimerTrigger(Model): - """The properties of a timer trigger. - - All required parameters must be populated in order to send to Azure. - - :param schedule: Required. The CRON expression for the task schedule - :type schedule: str - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'schedule': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'schedule': {'key': 'schedule', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, schedule: str, name: str, status="Enabled", **kwargs) -> None: - super(TimerTrigger, self).__init__(**kwargs) - self.schedule = schedule - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_update_parameters.py deleted file mode 100644 index 946c9ad86594..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_update_parameters.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 TimerTriggerUpdateParameters(Model): - """The properties for updating a timer trigger. - - All required parameters must be populated in order to send to Azure. - - :param schedule: The CRON expression for the task schedule - :type schedule: str - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'schedule': {'key': 'schedule', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TimerTriggerUpdateParameters, self).__init__(**kwargs) - self.schedule = kwargs.get('schedule', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_update_parameters_py3.py deleted file mode 100644 index c4b33c617d9c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/timer_trigger_update_parameters_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 TimerTriggerUpdateParameters(Model): - """The properties for updating a timer trigger. - - All required parameters must be populated in order to send to Azure. - - :param schedule: The CRON expression for the task schedule - :type schedule: str - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'schedule': {'key': 'schedule', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str, schedule: str=None, status="Enabled", **kwargs) -> None: - super(TimerTriggerUpdateParameters, self).__init__(**kwargs) - self.schedule = schedule - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trigger_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trigger_properties.py deleted file mode 100644 index 47be81e8064c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trigger_properties.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 TriggerProperties(Model): - """The properties of a trigger. - - :param timer_triggers: The collection of timer triggers. - :type timer_triggers: - list[~azure.mgmt.containerregistry.v2019_04_01.models.TimerTrigger] - :param source_triggers: The collection of triggers based on source code - repository. - :type source_triggers: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SourceTrigger] - :param base_image_trigger: The trigger based on base image dependencies. - :type base_image_trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTrigger - """ - - _attribute_map = { - 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTrigger]'}, - 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTrigger]'}, - 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTrigger'}, - } - - def __init__(self, **kwargs): - super(TriggerProperties, self).__init__(**kwargs) - self.timer_triggers = kwargs.get('timer_triggers', None) - self.source_triggers = kwargs.get('source_triggers', None) - self.base_image_trigger = kwargs.get('base_image_trigger', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trigger_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trigger_properties_py3.py deleted file mode 100644 index 114d84e44833..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trigger_properties_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 TriggerProperties(Model): - """The properties of a trigger. - - :param timer_triggers: The collection of timer triggers. - :type timer_triggers: - list[~azure.mgmt.containerregistry.v2019_04_01.models.TimerTrigger] - :param source_triggers: The collection of triggers based on source code - repository. - :type source_triggers: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SourceTrigger] - :param base_image_trigger: The trigger based on base image dependencies. - :type base_image_trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTrigger - """ - - _attribute_map = { - 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTrigger]'}, - 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTrigger]'}, - 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTrigger'}, - } - - def __init__(self, *, timer_triggers=None, source_triggers=None, base_image_trigger=None, **kwargs) -> None: - super(TriggerProperties, self).__init__(**kwargs) - self.timer_triggers = timer_triggers - self.source_triggers = source_triggers - self.base_image_trigger = base_image_trigger diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trigger_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trigger_update_parameters.py deleted file mode 100644 index bd95ca2b7b35..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trigger_update_parameters.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 TriggerUpdateParameters(Model): - """The properties for updating triggers. - - :param timer_triggers: The collection of timer triggers. - :type timer_triggers: - list[~azure.mgmt.containerregistry.v2019_04_01.models.TimerTriggerUpdateParameters] - :param source_triggers: The collection of triggers based on source code - repository. - :type source_triggers: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerUpdateParameters] - :param base_image_trigger: The trigger based on base image dependencies. - :type base_image_trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerUpdateParameters - """ - - _attribute_map = { - 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTriggerUpdateParameters]'}, - 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTriggerUpdateParameters]'}, - 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTriggerUpdateParameters'}, - } - - def __init__(self, **kwargs): - super(TriggerUpdateParameters, self).__init__(**kwargs) - self.timer_triggers = kwargs.get('timer_triggers', None) - self.source_triggers = kwargs.get('source_triggers', None) - self.base_image_trigger = kwargs.get('base_image_trigger', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trigger_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trigger_update_parameters_py3.py deleted file mode 100644 index a82a692db9cd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trigger_update_parameters_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 TriggerUpdateParameters(Model): - """The properties for updating triggers. - - :param timer_triggers: The collection of timer triggers. - :type timer_triggers: - list[~azure.mgmt.containerregistry.v2019_04_01.models.TimerTriggerUpdateParameters] - :param source_triggers: The collection of triggers based on source code - repository. - :type source_triggers: - list[~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerUpdateParameters] - :param base_image_trigger: The trigger based on base image dependencies. - :type base_image_trigger: - ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerUpdateParameters - """ - - _attribute_map = { - 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTriggerUpdateParameters]'}, - 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTriggerUpdateParameters]'}, - 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTriggerUpdateParameters'}, - } - - def __init__(self, *, timer_triggers=None, source_triggers=None, base_image_trigger=None, **kwargs) -> None: - super(TriggerUpdateParameters, self).__init__(**kwargs) - self.timer_triggers = timer_triggers - self.source_triggers = source_triggers - self.base_image_trigger = base_image_trigger diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trust_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trust_policy.py deleted file mode 100644 index 7b7e0af24b1a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trust_policy.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TrustPolicy(Model): - """An object that represents content trust policy for a container registry. - - :param type: The type of trust policy. Possible values include: 'Notary' - :type type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TrustPolicyType - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.PolicyStatus - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrustPolicy, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trust_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trust_policy_py3.py deleted file mode 100644 index fb78b968e93f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/trust_policy_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TrustPolicy(Model): - """An object that represents content trust policy for a container registry. - - :param type: The type of trust policy. Possible values include: 'Notary' - :type type: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.TrustPolicyType - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.PolicyStatus - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, type=None, status=None, **kwargs) -> None: - super(TrustPolicy, self).__init__(**kwargs) - self.type = type - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/user_identity_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/user_identity_properties.py deleted file mode 100644 index 1f93d39ec2b7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/user_identity_properties.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 UserIdentityProperties(Model): - """UserIdentityProperties. - - :param principal_id: The principal id of user assigned identity. - :type principal_id: str - :param client_id: The client id of user assigned identity. - :type client_id: str - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UserIdentityProperties, self).__init__(**kwargs) - self.principal_id = kwargs.get('principal_id', None) - self.client_id = kwargs.get('client_id', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/user_identity_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/user_identity_properties_py3.py deleted file mode 100644 index 7897fcec7758..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/user_identity_properties_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 UserIdentityProperties(Model): - """UserIdentityProperties. - - :param principal_id: The principal id of user assigned identity. - :type principal_id: str - :param client_id: The client id of user assigned identity. - :type client_id: str - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__(self, *, principal_id: str=None, client_id: str=None, **kwargs) -> None: - super(UserIdentityProperties, self).__init__(**kwargs) - self.principal_id = principal_id - self.client_id = client_id diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/virtual_network_rule.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/virtual_network_rule.py deleted file mode 100644 index 96a56a32f589..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/virtual_network_rule.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual network rule. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.Action - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.action = kwargs.get('action', "Allow") - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/virtual_network_rule_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/virtual_network_rule_py3.py deleted file mode 100644 index 28f4aedf920c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual network rule. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2019_04_01.models.Action - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.action = action - self.virtual_network_resource_id = virtual_network_resource_id diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook.py deleted file mode 100644 index 5afc59a87fbd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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.v2019_04_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.v2019_04_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.v2019_04_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_create_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_create_parameters.py deleted file mode 100644 index a61a916cf131..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_create_parameters.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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.v2019_04_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.v2019_04_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_create_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_create_parameters_py3.py deleted file mode 100644 index c51de6fcec36..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_create_parameters_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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.v2019_04_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.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_paged.py deleted file mode 100644 index 1ca327ae3e42..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_py3.py deleted file mode 100644 index 4d58afb6be06..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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_py3 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.v2019_04_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.v2019_04_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.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_update_parameters.py deleted file mode 100644 index 242fd91ac5df..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_update_parameters.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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.v2019_04_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.v2019_04_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_update_parameters_py3.py deleted file mode 100644 index e60e773d9588..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/webhook_update_parameters_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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.v2019_04_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.v2019_04_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/__init__.py index d9dadb00c503..b05c49580519 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/__init__.py @@ -9,12 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from .registries_operations import RegistriesOperations -from .operations import Operations -from .replications_operations import ReplicationsOperations -from .webhooks_operations import WebhooksOperations -from .runs_operations import RunsOperations -from .tasks_operations import TasksOperations +from ._registries_operations import RegistriesOperations +from ._operations import Operations +from ._replications_operations import ReplicationsOperations +from ._webhooks_operations import WebhooksOperations +from ._runs_operations import RunsOperations +from ._tasks_operations import TasksOperations __all__ = [ 'RegistriesOperations', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_operations.py new file mode 100644 index 000000000000..8eb866e7deda --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_operations.py @@ -0,0 +1,103 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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.v2019_04_01.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2019_04_01.models.OperationDefinition] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.ContainerRegistry/operations'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_registries_operations.py new file mode 100644 index 000000000000..6a8f5a1b2d02 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_registries_operations.py @@ -0,0 +1,1255 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 _import_image_initial( + self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2017-10-01" + + # Construct URL + url = self.import_image.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', min_length=1), + '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(parameters, 'ImportImageParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 import_image( + self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Copies an image to this container registry from 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 parameters: The parameters specifying the image to copy and the + source container registry. + :type parameters: + ~azure.mgmt.containerregistry.v2019_04_01.models.ImportImageParameters + :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._import_image_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + parameters=parameters, + 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) + import_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage'} + + 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.v2019_04_01.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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_04_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_04_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.v2019_04_01.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_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) + 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_04_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.v2019_04_01.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_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 + ) + + 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.v2019_04_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2019_04_01.models.Registry] + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + def prepare_request(next_link=None): + 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', min_length=1) + } + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2019_04_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2019_04_01.models.Registry] + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2019_04_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2019_04_01.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.v2019_04_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_04_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 list_policies( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists the policies 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: RegistryPolicies or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2019_04_01.models.RegistryPolicies or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + # Construct URL + url = self.list_policies.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'} + + + def _update_policies_initial( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, **operation_config): + registry_policies_update_parameters = models.RegistryPolicies(quarantine_policy=quarantine_policy, trust_policy=trust_policy) + + api_version = "2017-10-01" + + # Construct URL + url = self.update_policies.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', min_length=1), + '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['Accept'] = 'application/json' + 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_policies_update_parameters, 'RegistryPolicies') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_policies( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the policies 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 quarantine_policy: An object that represents quarantine policy + for a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2019_04_01.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy + for a container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2019_04_01.models.TrustPolicy + :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 RegistryPolicies or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_04_01.models.RegistryPolicies] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_01.models.RegistryPolicies]] + :raises: :class:`CloudError` + """ + raw_result = self._update_policies_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + quarantine_policy=quarantine_policy, + trust_policy=trust_policy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RegistryPolicies', 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_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'} + + + def _schedule_run_initial( + self, resource_group_name, registry_name, run_request, custom_headers=None, raw=False, **operation_config): + api_version = "2019-04-01" + + # Construct URL + url = self.schedule_run.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', min_length=1), + '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['Accept'] = 'application/json' + 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(run_request, 'RunRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Run', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def schedule_run( + self, resource_group_name, registry_name, run_request, custom_headers=None, raw=False, polling=True, **operation_config): + """Schedules a new run based on the request parameters and add it to the + run 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 run_request: The parameters of a run that needs to scheduled. + :type run_request: + ~azure.mgmt.containerregistry.v2019_04_01.models.RunRequest + :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 Run or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_04_01.models.Run] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_01.models.Run]] + :raises: :class:`CloudError` + """ + raw_result = self._schedule_run_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + run_request=run_request, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Run', 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) + schedule_run.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun'} + + 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.v2019_04_01.models.SourceUploadDefinition + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2019-04-01" + + # 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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}/listBuildSourceUploadUrl'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_replications_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_replications_operations.py new file mode 100644 index 000000000000..f4d0a0027f7c --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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.v2019_04_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_04_01.models.Replication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_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 = 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_04_01.models.Replication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_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 + ) + + 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.v2019_04_01.models.ReplicationPaged[~azure.mgmt.containerregistry.v2019_04_01.models.Replication] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.ReplicationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_runs_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_runs_operations.py new file mode 100644 index 000000000000..ab5d7ed09347 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_runs_operations.py @@ -0,0 +1,452 @@ +# 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 RunsOperations(object): + """RunsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, resource_group_name, registry_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all the runs 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 runs filter to apply on the operation. Arithmetic + operators are not supported. The allowed string function is + 'contains'. All logical operators except 'Not', 'Has', 'All' are + allowed. + :type filter: str + :param top: $top is supported for get list of runs, which limits the + maximum number of runs to return. + :type top: int + :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 Run + :rtype: + ~azure.mgmt.containerregistry.v2019_04_01.models.RunPaged[~azure.mgmt.containerregistry.v2019_04_01.models.Run] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RunPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs'} + + def get( + self, resource_group_name, registry_name, run_id, custom_headers=None, raw=False, **operation_config): + """Gets the detailed information for a given run. + + :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 run_id: The run ID. + :type run_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: Run or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerregistry.v2019_04_01.models.Run 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Run', 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}/runs/{runId}'} + + + def _update_initial( + self, resource_group_name, registry_name, run_id, is_archive_enabled=None, custom_headers=None, raw=False, **operation_config): + run_update_parameters = models.RunUpdateParameters(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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' + 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(run_update_parameters, 'RunUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Run', response) + if response.status_code == 201: + deserialized = self._deserialize('Run', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, run_id, is_archive_enabled=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Patch the run 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 run_id: The run ID. + :type run_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 Run or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_04_01.models.Run] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_01.models.Run]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + run_id=run_id, + is_archive_enabled=is_archive_enabled, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Run', 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}/runs/{runId}'} + + def get_log_sas_url( + self, resource_group_name, registry_name, run_id, custom_headers=None, raw=False, **operation_config): + """Gets a link to download the run 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 run_id: The run ID. + :type run_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: RunGetLogResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2019_04_01.models.RunGetLogResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_log_sas_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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('RunGetLogResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_log_sas_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl'} + + + def _cancel_initial( + self, resource_group_name, registry_name, run_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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'runId': self._serialize.url("run_id", run_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 = {} + 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, header_parameters) + response = self._client.send(request, 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, run_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Cancel an existing run. + + :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 run_id: The run ID. + :type run_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, + run_id=run_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}/runs/{runId}/cancel'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_tasks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_tasks_operations.py new file mode 100644 index 000000000000..30823ba160b9 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_tasks_operations.py @@ -0,0 +1,545 @@ +# 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 TasksOperations(object): + """TasksOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists all the 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 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 Task + :rtype: + ~azure.mgmt.containerregistry.v2019_04_01.models.TaskPaged[~azure.mgmt.containerregistry.v2019_04_01.models.Task] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.TaskPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks'} + + def get( + self, resource_group_name, registry_name, task_name, custom_headers=None, raw=False, **operation_config): + """Get the properties of a specified 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 task_name: The name of the container registry task. + :type 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: Task or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerregistry.v2019_04_01.models.Task 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Task', 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}/tasks/{taskName}'} + + + def _create_initial( + self, resource_group_name, registry_name, task_name, 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' + 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(task_create_parameters, 'Task') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Task', response) + if response.status_code == 201: + deserialized = self._deserialize('Task', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, task_name, task_create_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a 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 task_name: The name of the container registry task. + :type task_name: str + :param task_create_parameters: The parameters for creating a task. + :type task_create_parameters: + ~azure.mgmt.containerregistry.v2019_04_01.models.Task + :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 Task or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_04_01.models.Task] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_01.models.Task]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + task_name=task_name, + task_create_parameters=task_create_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Task', 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}/tasks/{taskName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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 = {} + 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, header_parameters) + response = self._client.send(request, 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, task_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a specified 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 task_name: The name of the container registry task. + :type 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, + task_name=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}/tasks/{taskName}'} + + + def _update_initial( + self, resource_group_name, registry_name, task_name, 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' + 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(task_update_parameters, 'TaskUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Task', response) + if response.status_code == 201: + deserialized = self._deserialize('Task', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, task_name, task_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a 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 task_name: The name of the container registry task. + :type task_name: str + :param task_update_parameters: The parameters for updating a task. + :type task_update_parameters: + ~azure.mgmt.containerregistry.v2019_04_01.models.TaskUpdateParameters + :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 Task or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_04_01.models.Task] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_01.models.Task]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + task_name=task_name, + task_update_parameters=task_update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Task', 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}/tasks/{taskName}'} + + def get_details( + self, resource_group_name, registry_name, task_name, custom_headers=None, raw=False, **operation_config): + """Returns a task with extended information that includes all secrets. + + :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 task_name: The name of the container registry task. + :type 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: Task or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerregistry.v2019_04_01.models.Task or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_details.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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Task', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_webhooks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_webhooks_operations.py new file mode 100644 index 000000000000..4ae54819faf2 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/_webhooks_operations.py @@ -0,0 +1,691 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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.v2019_04_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_04_01.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.v2019_04_01.models.Webhook] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_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 = 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_04_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.v2019_04_01.models.Webhook] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_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 + ) + + 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.v2019_04_01.models.WebhookPaged[~azure.mgmt.containerregistry.v2019_04_01.models.Webhook] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.WebhookPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2019_04_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2019_04_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2019_04_01.models.EventPaged[~azure.mgmt.containerregistry.v2019_04_01.models.Event] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.EventPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_events.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/operations.py deleted file mode 100644 index d936176408f3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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.v2019_04_01.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2019_04_01.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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/registries_operations.py deleted file mode 100644 index 82e0c9b98081..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/registries_operations.py +++ /dev/null @@ -1,1256 +0,0 @@ -# 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 _import_image_initial( - self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2017-10-01" - - # Construct URL - url = self.import_image.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', min_length=1), - '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(parameters, 'ImportImageParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 import_image( - self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Copies an image to this container registry from 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 parameters: The parameters specifying the image to copy and the - source container registry. - :type parameters: - ~azure.mgmt.containerregistry.v2019_04_01.models.ImportImageParameters - :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._import_image_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - parameters=parameters, - 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) - import_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage'} - - 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.v2019_04_01.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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_04_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_04_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.v2019_04_01.models.Registry] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_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) - 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_04_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.v2019_04_01.models.Registry] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_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 - ) - - 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.v2019_04_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2019_04_01.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', min_length=1) - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_04_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2019_04_01.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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_04_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_04_01.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.v2019_04_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_04_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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 list_policies( - self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): - """Lists the policies 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: RegistryPolicies or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerregistry.v2019_04_01.models.RegistryPolicies or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2017-10-01" - - # Construct URL - url = self.list_policies.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('RegistryPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'} - - - def _update_policies_initial( - self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, **operation_config): - registry_policies_update_parameters = models.RegistryPolicies(quarantine_policy=quarantine_policy, trust_policy=trust_policy) - - api_version = "2017-10-01" - - # Construct URL - url = self.update_policies.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', min_length=1), - '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['Accept'] = 'application/json' - 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_policies_update_parameters, 'RegistryPolicies') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('RegistryPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update_policies( - self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates the policies 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 quarantine_policy: An object that represents quarantine policy - for a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2019_04_01.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy - for a container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2019_04_01.models.TrustPolicy - :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 RegistryPolicies or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_04_01.models.RegistryPolicies] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_01.models.RegistryPolicies]] - :raises: :class:`CloudError` - """ - raw_result = self._update_policies_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - quarantine_policy=quarantine_policy, - trust_policy=trust_policy, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('RegistryPolicies', 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_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'} - - - def _schedule_run_initial( - self, resource_group_name, registry_name, run_request, custom_headers=None, raw=False, **operation_config): - api_version = "2019-04-01" - - # Construct URL - url = self.schedule_run.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', min_length=1), - '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['Accept'] = 'application/json' - 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(run_request, 'RunRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Run', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def schedule_run( - self, resource_group_name, registry_name, run_request, custom_headers=None, raw=False, polling=True, **operation_config): - """Schedules a new run based on the request parameters and add it to the - run 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 run_request: The parameters of a run that needs to scheduled. - :type run_request: - ~azure.mgmt.containerregistry.v2019_04_01.models.RunRequest - :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 Run or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_04_01.models.Run] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_01.models.Run]] - :raises: :class:`CloudError` - """ - raw_result = self._schedule_run_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - run_request=run_request, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Run', 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) - schedule_run.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun'} - - 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.v2019_04_01.models.SourceUploadDefinition - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-04-01" - - # 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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}/listBuildSourceUploadUrl'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/replications_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/replications_operations.py deleted file mode 100644 index 6910db863d69..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/replications_operations.py +++ /dev/null @@ -1,485 +0,0 @@ -# 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.v2019_04_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_04_01.models.Replication] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_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 = 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_04_01.models.Replication] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_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 - ) - - 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.v2019_04_01.models.ReplicationPaged[~azure.mgmt.containerregistry.v2019_04_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/runs_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/runs_operations.py deleted file mode 100644 index 2de55f2715ae..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/runs_operations.py +++ /dev/null @@ -1,450 +0,0 @@ -# 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 RunsOperations(object): - """RunsOperations 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: "2019-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01" - - self.config = config - - def list( - self, resource_group_name, registry_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """Gets all the runs 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 runs filter to apply on the operation. Arithmetic - operators are not supported. The allowed string function is - 'contains'. All logical operators except 'Not', 'Has', 'All' are - allowed. - :type filter: str - :param top: $top is supported for get list of runs, which limits the - maximum number of runs to return. - :type top: int - :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 Run - :rtype: - ~azure.mgmt.containerregistry.v2019_04_01.models.RunPaged[~azure.mgmt.containerregistry.v2019_04_01.models.Run] - :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', min_length=1), - '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') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.RunPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.RunPaged(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}/runs'} - - def get( - self, resource_group_name, registry_name, run_id, custom_headers=None, raw=False, **operation_config): - """Gets the detailed information for a given run. - - :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 run_id: The run ID. - :type run_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: Run or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerregistry.v2019_04_01.models.Run 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('Run', 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}/runs/{runId}'} - - - def _update_initial( - self, resource_group_name, registry_name, run_id, is_archive_enabled=None, custom_headers=None, raw=False, **operation_config): - run_update_parameters = models.RunUpdateParameters(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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' - 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(run_update_parameters, 'RunUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Run', response) - if response.status_code == 201: - deserialized = self._deserialize('Run', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, registry_name, run_id, is_archive_enabled=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Patch the run 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 run_id: The run ID. - :type run_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 Run or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_04_01.models.Run] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_01.models.Run]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - run_id=run_id, - is_archive_enabled=is_archive_enabled, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Run', 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}/runs/{runId}'} - - def get_log_sas_url( - self, resource_group_name, registry_name, run_id, custom_headers=None, raw=False, **operation_config): - """Gets a link to download the run 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 run_id: The run ID. - :type run_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: RunGetLogResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerregistry.v2019_04_01.models.RunGetLogResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_log_sas_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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('RunGetLogResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_log_sas_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl'} - - - def _cancel_initial( - self, resource_group_name, registry_name, run_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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'runId': self._serialize.url("run_id", run_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 = {} - 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, header_parameters) - response = self._client.send(request, 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, run_id, custom_headers=None, raw=False, polling=True, **operation_config): - """Cancel an existing run. - - :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 run_id: The run ID. - :type run_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, - run_id=run_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}/runs/{runId}/cancel'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/tasks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/tasks_operations.py deleted file mode 100644 index 2ee3a6136ac8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/tasks_operations.py +++ /dev/null @@ -1,543 +0,0 @@ -# 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 TasksOperations(object): - """TasksOperations 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: "2019-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01" - - self.config = config - - def list( - self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): - """Lists all the 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 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 Task - :rtype: - ~azure.mgmt.containerregistry.v2019_04_01.models.TaskPaged[~azure.mgmt.containerregistry.v2019_04_01.models.Task] - :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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.TaskPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.TaskPaged(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}/tasks'} - - def get( - self, resource_group_name, registry_name, task_name, custom_headers=None, raw=False, **operation_config): - """Get the properties of a specified 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 task_name: The name of the container registry task. - :type 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: Task or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerregistry.v2019_04_01.models.Task 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('Task', 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}/tasks/{taskName}'} - - - def _create_initial( - self, resource_group_name, registry_name, task_name, 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' - 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(task_create_parameters, 'Task') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Task', response) - if response.status_code == 201: - deserialized = self._deserialize('Task', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, registry_name, task_name, task_create_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates a 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 task_name: The name of the container registry task. - :type task_name: str - :param task_create_parameters: The parameters for creating a task. - :type task_create_parameters: - ~azure.mgmt.containerregistry.v2019_04_01.models.Task - :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 Task or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_04_01.models.Task] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_01.models.Task]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - task_name=task_name, - task_create_parameters=task_create_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Task', 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}/tasks/{taskName}'} - - - def _delete_initial( - self, resource_group_name, registry_name, 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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 = {} - 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, header_parameters) - response = self._client.send(request, 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, task_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes a specified 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 task_name: The name of the container registry task. - :type 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, - task_name=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}/tasks/{taskName}'} - - - def _update_initial( - self, resource_group_name, registry_name, task_name, 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' - 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(task_update_parameters, 'TaskUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Task', response) - if response.status_code == 201: - deserialized = self._deserialize('Task', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, registry_name, task_name, task_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates a 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 task_name: The name of the container registry task. - :type task_name: str - :param task_update_parameters: The parameters for updating a task. - :type task_update_parameters: - ~azure.mgmt.containerregistry.v2019_04_01.models.TaskUpdateParameters - :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 Task or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_04_01.models.Task] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_01.models.Task]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - task_name=task_name, - task_update_parameters=task_update_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Task', 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}/tasks/{taskName}'} - - def get_details( - self, resource_group_name, registry_name, task_name, custom_headers=None, raw=False, **operation_config): - """Returns a task with extended information that includes all secrets. - - :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 task_name: The name of the container registry task. - :type 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: Task or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerregistry.v2019_04_01.models.Task or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_details.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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('Task', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/webhooks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/webhooks_operations.py deleted file mode 100644 index 2389c0ba6fc6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/operations/webhooks_operations.py +++ /dev/null @@ -1,688 +0,0 @@ -# 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.v2019_04_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_04_01.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.v2019_04_01.models.Webhook] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_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 = 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_04_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.v2019_04_01.models.Webhook] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_04_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 - ) - - 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.v2019_04_01.models.WebhookPaged[~azure.mgmt.containerregistry.v2019_04_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_04_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_04_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_04_01.models.EventPaged[~azure.mgmt.containerregistry.v2019_04_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/__init__.py index 511d3d37a4aa..81ad2ac1ed64 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .container_registry_management_client import ContainerRegistryManagementClient -from .version import VERSION +from ._configuration import ContainerRegistryManagementClientConfiguration +from ._container_registry_management_client import ContainerRegistryManagementClient +__all__ = ['ContainerRegistryManagementClient', 'ContainerRegistryManagementClientConfiguration'] -__all__ = ['ContainerRegistryManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/_configuration.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/_configuration.py new file mode 100644 index 000000000000..4e021787210f --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +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) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + 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 diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/_container_registry_management_client.py new file mode 100644 index 000000000000..d0026f4377f2 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/_container_registry_management_client.py @@ -0,0 +1,73 @@ +# 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 ._configuration import ContainerRegistryManagementClientConfiguration +from .operations import RegistriesOperations +from .operations import Operations +from .operations import ReplicationsOperations +from .operations import WebhooksOperations +from .operations import RunsOperations +from .operations import TasksOperations +from . import models + + +class ContainerRegistryManagementClient(SDKClient): + """ContainerRegistryManagementClient + + :ivar config: Configuration for client. + :vartype config: ContainerRegistryManagementClientConfiguration + + :ivar registries: Registries operations + :vartype registries: azure.mgmt.containerregistry.v2019_05_01.operations.RegistriesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerregistry.v2019_05_01.operations.Operations + :ivar replications: Replications operations + :vartype replications: azure.mgmt.containerregistry.v2019_05_01.operations.ReplicationsOperations + :ivar webhooks: Webhooks operations + :vartype webhooks: azure.mgmt.containerregistry.v2019_05_01.operations.WebhooksOperations + :ivar runs: Runs operations + :vartype runs: azure.mgmt.containerregistry.v2019_05_01.operations.RunsOperations + :ivar tasks: Tasks operations + :vartype tasks: azure.mgmt.containerregistry.v2019_05_01.operations.TasksOperations + + :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.runs = RunsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tasks = TasksOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/container_registry_management_client.py deleted file mode 100644 index d5085b848dfb..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/container_registry_management_client.py +++ /dev/null @@ -1,105 +0,0 @@ -# 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.runs_operations import RunsOperations -from .operations.tasks_operations import TasksOperations -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.v2019_05_01.operations.RegistriesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.containerregistry.v2019_05_01.operations.Operations - :ivar replications: Replications operations - :vartype replications: azure.mgmt.containerregistry.v2019_05_01.operations.ReplicationsOperations - :ivar webhooks: Webhooks operations - :vartype webhooks: azure.mgmt.containerregistry.v2019_05_01.operations.WebhooksOperations - :ivar runs: Runs operations - :vartype runs: azure.mgmt.containerregistry.v2019_05_01.operations.RunsOperations - :ivar tasks: Tasks operations - :vartype tasks: azure.mgmt.containerregistry.v2019_05_01.operations.TasksOperations - - :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.runs = RunsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.tasks = TasksOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/__init__.py index 9b9059da1d5a..b3ce3720c295 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/__init__.py @@ -10,197 +10,197 @@ # -------------------------------------------------------------------------- try: - from .import_source_credentials_py3 import ImportSourceCredentials - from .import_source_py3 import ImportSource - from .import_image_parameters_py3 import ImportImageParameters - from .registry_name_check_request_py3 import RegistryNameCheckRequest - from .registry_name_status_py3 import RegistryNameStatus - from .operation_display_definition_py3 import OperationDisplayDefinition - from .operation_metric_specification_definition_py3 import OperationMetricSpecificationDefinition - from .operation_service_specification_definition_py3 import OperationServiceSpecificationDefinition - from .operation_definition_py3 import OperationDefinition - from .sku_py3 import Sku - from .status_py3 import Status - from .storage_account_properties_py3 import StorageAccountProperties - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - from .quarantine_policy_py3 import QuarantinePolicy - from .trust_policy_py3 import TrustPolicy - from .retention_policy_py3 import RetentionPolicy - from .policies_py3 import Policies - 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 .run_request_py3 import RunRequest - from .image_descriptor_py3 import ImageDescriptor - from .image_update_trigger_py3 import ImageUpdateTrigger - from .source_trigger_descriptor_py3 import SourceTriggerDescriptor - from .platform_properties_py3 import PlatformProperties - from .agent_properties_py3 import AgentProperties - from .timer_trigger_descriptor_py3 import TimerTriggerDescriptor - from .run_py3 import Run - from .source_upload_definition_py3 import SourceUploadDefinition - from .run_filter_py3 import RunFilter - from .run_update_parameters_py3 import RunUpdateParameters - from .run_get_log_result_py3 import RunGetLogResult - from .user_identity_properties_py3 import UserIdentityProperties - from .identity_properties_py3 import IdentityProperties - from .base_image_dependency_py3 import BaseImageDependency - from .task_step_properties_py3 import TaskStepProperties - from .timer_trigger_py3 import TimerTrigger - from .auth_info_py3 import AuthInfo - from .source_properties_py3 import SourceProperties - from .source_trigger_py3 import SourceTrigger - from .base_image_trigger_py3 import BaseImageTrigger - from .trigger_properties_py3 import TriggerProperties - from .source_registry_credentials_py3 import SourceRegistryCredentials - from .secret_object_py3 import SecretObject - from .custom_registry_credentials_py3 import CustomRegistryCredentials - from .credentials_py3 import Credentials - from .task_py3 import Task - from .platform_update_parameters_py3 import PlatformUpdateParameters - from .task_step_update_parameters_py3 import TaskStepUpdateParameters - from .timer_trigger_update_parameters_py3 import TimerTriggerUpdateParameters - from .auth_info_update_parameters_py3 import AuthInfoUpdateParameters - from .source_update_parameters_py3 import SourceUpdateParameters - from .source_trigger_update_parameters_py3 import SourceTriggerUpdateParameters - from .base_image_trigger_update_parameters_py3 import BaseImageTriggerUpdateParameters - from .trigger_update_parameters_py3 import TriggerUpdateParameters - from .task_update_parameters_py3 import TaskUpdateParameters - from .proxy_resource_py3 import ProxyResource - from .argument_py3 import Argument - from .docker_build_request_py3 import DockerBuildRequest - from .set_value_py3 import SetValue - from .file_task_run_request_py3 import FileTaskRunRequest - from .task_run_request_py3 import TaskRunRequest - from .encoded_task_run_request_py3 import EncodedTaskRunRequest - from .docker_build_step_py3 import DockerBuildStep - from .file_task_step_py3 import FileTaskStep - from .encoded_task_step_py3 import EncodedTaskStep - from .docker_build_step_update_parameters_py3 import DockerBuildStepUpdateParameters - from .file_task_step_update_parameters_py3 import FileTaskStepUpdateParameters - from .encoded_task_step_update_parameters_py3 import EncodedTaskStepUpdateParameters + from ._models_py3 import Actor + from ._models_py3 import AgentProperties + from ._models_py3 import Argument + from ._models_py3 import AuthInfo + from ._models_py3 import AuthInfoUpdateParameters + from ._models_py3 import BaseImageDependency + from ._models_py3 import BaseImageTrigger + from ._models_py3 import BaseImageTriggerUpdateParameters + from ._models_py3 import CallbackConfig + from ._models_py3 import Credentials + from ._models_py3 import CustomRegistryCredentials + from ._models_py3 import DockerBuildRequest + from ._models_py3 import DockerBuildStep + from ._models_py3 import DockerBuildStepUpdateParameters + from ._models_py3 import EncodedTaskRunRequest + from ._models_py3 import EncodedTaskStep + from ._models_py3 import EncodedTaskStepUpdateParameters + from ._models_py3 import Event + from ._models_py3 import EventContent + from ._models_py3 import EventInfo + from ._models_py3 import EventRequestMessage + from ._models_py3 import EventResponseMessage + from ._models_py3 import FileTaskRunRequest + from ._models_py3 import FileTaskStep + from ._models_py3 import FileTaskStepUpdateParameters + from ._models_py3 import IdentityProperties + from ._models_py3 import ImageDescriptor + from ._models_py3 import ImageUpdateTrigger + from ._models_py3 import ImportImageParameters + from ._models_py3 import ImportSource + from ._models_py3 import ImportSourceCredentials + from ._models_py3 import IPRule + from ._models_py3 import NetworkRuleSet + from ._models_py3 import OperationDefinition + from ._models_py3 import OperationDisplayDefinition + from ._models_py3 import OperationMetricSpecificationDefinition + from ._models_py3 import OperationServiceSpecificationDefinition + from ._models_py3 import PlatformProperties + from ._models_py3 import PlatformUpdateParameters + from ._models_py3 import Policies + from ._models_py3 import ProxyResource + from ._models_py3 import QuarantinePolicy + from ._models_py3 import RegenerateCredentialParameters + from ._models_py3 import Registry + from ._models_py3 import RegistryListCredentialsResult + from ._models_py3 import RegistryNameCheckRequest + from ._models_py3 import RegistryNameStatus + from ._models_py3 import RegistryPassword + from ._models_py3 import RegistryUpdateParameters + from ._models_py3 import RegistryUsage + from ._models_py3 import RegistryUsageListResult + from ._models_py3 import Replication + from ._models_py3 import ReplicationUpdateParameters + from ._models_py3 import Request + from ._models_py3 import Resource + from ._models_py3 import RetentionPolicy + from ._models_py3 import Run + from ._models_py3 import RunFilter + from ._models_py3 import RunGetLogResult + from ._models_py3 import RunRequest + from ._models_py3 import RunUpdateParameters + from ._models_py3 import SecretObject + from ._models_py3 import SetValue + from ._models_py3 import Sku + from ._models_py3 import Source + from ._models_py3 import SourceProperties + from ._models_py3 import SourceRegistryCredentials + from ._models_py3 import SourceTrigger + from ._models_py3 import SourceTriggerDescriptor + from ._models_py3 import SourceTriggerUpdateParameters + from ._models_py3 import SourceUpdateParameters + from ._models_py3 import SourceUploadDefinition + from ._models_py3 import Status + from ._models_py3 import StorageAccountProperties + from ._models_py3 import Target + from ._models_py3 import Task + from ._models_py3 import TaskRunRequest + from ._models_py3 import TaskStepProperties + from ._models_py3 import TaskStepUpdateParameters + from ._models_py3 import TaskUpdateParameters + from ._models_py3 import TimerTrigger + from ._models_py3 import TimerTriggerDescriptor + from ._models_py3 import TimerTriggerUpdateParameters + from ._models_py3 import TriggerProperties + from ._models_py3 import TriggerUpdateParameters + from ._models_py3 import TrustPolicy + from ._models_py3 import UserIdentityProperties + from ._models_py3 import VirtualNetworkRule + from ._models_py3 import Webhook + from ._models_py3 import WebhookCreateParameters + from ._models_py3 import WebhookUpdateParameters except (SyntaxError, ImportError): - from .import_source_credentials import ImportSourceCredentials - from .import_source import ImportSource - from .import_image_parameters import ImportImageParameters - from .registry_name_check_request import RegistryNameCheckRequest - from .registry_name_status import RegistryNameStatus - from .operation_display_definition import OperationDisplayDefinition - from .operation_metric_specification_definition import OperationMetricSpecificationDefinition - from .operation_service_specification_definition import OperationServiceSpecificationDefinition - from .operation_definition import OperationDefinition - from .sku import Sku - from .status import Status - from .storage_account_properties import StorageAccountProperties - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - from .quarantine_policy import QuarantinePolicy - from .trust_policy import TrustPolicy - from .retention_policy import RetentionPolicy - from .policies import Policies - 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 .run_request import RunRequest - from .image_descriptor import ImageDescriptor - from .image_update_trigger import ImageUpdateTrigger - from .source_trigger_descriptor import SourceTriggerDescriptor - from .platform_properties import PlatformProperties - from .agent_properties import AgentProperties - from .timer_trigger_descriptor import TimerTriggerDescriptor - from .run import Run - from .source_upload_definition import SourceUploadDefinition - from .run_filter import RunFilter - from .run_update_parameters import RunUpdateParameters - from .run_get_log_result import RunGetLogResult - from .user_identity_properties import UserIdentityProperties - from .identity_properties import IdentityProperties - from .base_image_dependency import BaseImageDependency - from .task_step_properties import TaskStepProperties - from .timer_trigger import TimerTrigger - from .auth_info import AuthInfo - from .source_properties import SourceProperties - from .source_trigger import SourceTrigger - from .base_image_trigger import BaseImageTrigger - from .trigger_properties import TriggerProperties - from .source_registry_credentials import SourceRegistryCredentials - from .secret_object import SecretObject - from .custom_registry_credentials import CustomRegistryCredentials - from .credentials import Credentials - from .task import Task - from .platform_update_parameters import PlatformUpdateParameters - from .task_step_update_parameters import TaskStepUpdateParameters - from .timer_trigger_update_parameters import TimerTriggerUpdateParameters - from .auth_info_update_parameters import AuthInfoUpdateParameters - from .source_update_parameters import SourceUpdateParameters - from .source_trigger_update_parameters import SourceTriggerUpdateParameters - from .base_image_trigger_update_parameters import BaseImageTriggerUpdateParameters - from .trigger_update_parameters import TriggerUpdateParameters - from .task_update_parameters import TaskUpdateParameters - from .proxy_resource import ProxyResource - from .argument import Argument - from .docker_build_request import DockerBuildRequest - from .set_value import SetValue - from .file_task_run_request import FileTaskRunRequest - from .task_run_request import TaskRunRequest - from .encoded_task_run_request import EncodedTaskRunRequest - from .docker_build_step import DockerBuildStep - from .file_task_step import FileTaskStep - from .encoded_task_step import EncodedTaskStep - from .docker_build_step_update_parameters import DockerBuildStepUpdateParameters - from .file_task_step_update_parameters import FileTaskStepUpdateParameters - from .encoded_task_step_update_parameters import EncodedTaskStepUpdateParameters -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 .run_paged import RunPaged -from .task_paged import TaskPaged -from .container_registry_management_client_enums import ( + from ._models import Actor + from ._models import AgentProperties + from ._models import Argument + from ._models import AuthInfo + from ._models import AuthInfoUpdateParameters + from ._models import BaseImageDependency + from ._models import BaseImageTrigger + from ._models import BaseImageTriggerUpdateParameters + from ._models import CallbackConfig + from ._models import Credentials + from ._models import CustomRegistryCredentials + from ._models import DockerBuildRequest + from ._models import DockerBuildStep + from ._models import DockerBuildStepUpdateParameters + from ._models import EncodedTaskRunRequest + from ._models import EncodedTaskStep + from ._models import EncodedTaskStepUpdateParameters + from ._models import Event + from ._models import EventContent + from ._models import EventInfo + from ._models import EventRequestMessage + from ._models import EventResponseMessage + from ._models import FileTaskRunRequest + from ._models import FileTaskStep + from ._models import FileTaskStepUpdateParameters + from ._models import IdentityProperties + from ._models import ImageDescriptor + from ._models import ImageUpdateTrigger + from ._models import ImportImageParameters + from ._models import ImportSource + from ._models import ImportSourceCredentials + from ._models import IPRule + from ._models import NetworkRuleSet + from ._models import OperationDefinition + from ._models import OperationDisplayDefinition + from ._models import OperationMetricSpecificationDefinition + from ._models import OperationServiceSpecificationDefinition + from ._models import PlatformProperties + from ._models import PlatformUpdateParameters + from ._models import Policies + from ._models import ProxyResource + from ._models import QuarantinePolicy + from ._models import RegenerateCredentialParameters + from ._models import Registry + from ._models import RegistryListCredentialsResult + from ._models import RegistryNameCheckRequest + from ._models import RegistryNameStatus + from ._models import RegistryPassword + from ._models import RegistryUpdateParameters + from ._models import RegistryUsage + from ._models import RegistryUsageListResult + from ._models import Replication + from ._models import ReplicationUpdateParameters + from ._models import Request + from ._models import Resource + from ._models import RetentionPolicy + from ._models import Run + from ._models import RunFilter + from ._models import RunGetLogResult + from ._models import RunRequest + from ._models import RunUpdateParameters + from ._models import SecretObject + from ._models import SetValue + from ._models import Sku + from ._models import Source + from ._models import SourceProperties + from ._models import SourceRegistryCredentials + from ._models import SourceTrigger + from ._models import SourceTriggerDescriptor + from ._models import SourceTriggerUpdateParameters + from ._models import SourceUpdateParameters + from ._models import SourceUploadDefinition + from ._models import Status + from ._models import StorageAccountProperties + from ._models import Target + from ._models import Task + from ._models import TaskRunRequest + from ._models import TaskStepProperties + from ._models import TaskStepUpdateParameters + from ._models import TaskUpdateParameters + from ._models import TimerTrigger + from ._models import TimerTriggerDescriptor + from ._models import TimerTriggerUpdateParameters + from ._models import TriggerProperties + from ._models import TriggerUpdateParameters + from ._models import TrustPolicy + from ._models import UserIdentityProperties + from ._models import VirtualNetworkRule + from ._models import Webhook + from ._models import WebhookCreateParameters + from ._models import WebhookUpdateParameters +from ._paged_models import EventPaged +from ._paged_models import OperationDefinitionPaged +from ._paged_models import RegistryPaged +from ._paged_models import ReplicationPaged +from ._paged_models import RunPaged +from ._paged_models import TaskPaged +from ._paged_models import WebhookPaged +from ._container_registry_management_client_enums import ( ImportMode, SkuName, SkuTier, @@ -231,97 +231,97 @@ ) __all__ = [ - 'ImportSourceCredentials', - 'ImportSource', + 'Actor', + 'AgentProperties', + 'Argument', + 'AuthInfo', + 'AuthInfoUpdateParameters', + 'BaseImageDependency', + 'BaseImageTrigger', + 'BaseImageTriggerUpdateParameters', + 'CallbackConfig', + 'Credentials', + 'CustomRegistryCredentials', + 'DockerBuildRequest', + 'DockerBuildStep', + 'DockerBuildStepUpdateParameters', + 'EncodedTaskRunRequest', + 'EncodedTaskStep', + 'EncodedTaskStepUpdateParameters', + 'Event', + 'EventContent', + 'EventInfo', + 'EventRequestMessage', + 'EventResponseMessage', + 'FileTaskRunRequest', + 'FileTaskStep', + 'FileTaskStepUpdateParameters', + 'IdentityProperties', + 'ImageDescriptor', + 'ImageUpdateTrigger', 'ImportImageParameters', - 'RegistryNameCheckRequest', - 'RegistryNameStatus', + 'ImportSource', + 'ImportSourceCredentials', + 'IPRule', + 'NetworkRuleSet', + 'OperationDefinition', 'OperationDisplayDefinition', 'OperationMetricSpecificationDefinition', 'OperationServiceSpecificationDefinition', - 'OperationDefinition', - 'Sku', - 'Status', - 'StorageAccountProperties', - 'VirtualNetworkRule', - 'IPRule', - 'NetworkRuleSet', - 'QuarantinePolicy', - 'TrustPolicy', - 'RetentionPolicy', + 'PlatformProperties', + 'PlatformUpdateParameters', 'Policies', + 'ProxyResource', + 'QuarantinePolicy', + 'RegenerateCredentialParameters', 'Registry', - 'RegistryUpdateParameters', - 'RegistryPassword', 'RegistryListCredentialsResult', - 'RegenerateCredentialParameters', + 'RegistryNameCheckRequest', + 'RegistryNameStatus', + 'RegistryPassword', + 'RegistryUpdateParameters', 'RegistryUsage', 'RegistryUsageListResult', 'Replication', 'ReplicationUpdateParameters', - 'Webhook', - 'WebhookCreateParameters', - 'WebhookUpdateParameters', - 'EventInfo', - 'CallbackConfig', - 'Target', 'Request', - 'Actor', - 'Source', - 'EventContent', - 'EventRequestMessage', - 'EventResponseMessage', - 'Event', 'Resource', - 'RunRequest', - 'ImageDescriptor', - 'ImageUpdateTrigger', - 'SourceTriggerDescriptor', - 'PlatformProperties', - 'AgentProperties', - 'TimerTriggerDescriptor', + 'RetentionPolicy', 'Run', - 'SourceUploadDefinition', 'RunFilter', - 'RunUpdateParameters', 'RunGetLogResult', - 'UserIdentityProperties', - 'IdentityProperties', - 'BaseImageDependency', - 'TaskStepProperties', - 'TimerTrigger', - 'AuthInfo', + 'RunRequest', + 'RunUpdateParameters', + 'SecretObject', + 'SetValue', + 'Sku', + 'Source', 'SourceProperties', - 'SourceTrigger', - 'BaseImageTrigger', - 'TriggerProperties', 'SourceRegistryCredentials', - 'SecretObject', - 'CustomRegistryCredentials', - 'Credentials', + 'SourceTrigger', + 'SourceTriggerDescriptor', + 'SourceTriggerUpdateParameters', + 'SourceUpdateParameters', + 'SourceUploadDefinition', + 'Status', + 'StorageAccountProperties', + 'Target', 'Task', - 'PlatformUpdateParameters', + 'TaskRunRequest', + 'TaskStepProperties', 'TaskStepUpdateParameters', + 'TaskUpdateParameters', + 'TimerTrigger', + 'TimerTriggerDescriptor', 'TimerTriggerUpdateParameters', - 'AuthInfoUpdateParameters', - 'SourceUpdateParameters', - 'SourceTriggerUpdateParameters', - 'BaseImageTriggerUpdateParameters', + 'TriggerProperties', 'TriggerUpdateParameters', - 'TaskUpdateParameters', - 'ProxyResource', - 'Argument', - 'DockerBuildRequest', - 'SetValue', - 'FileTaskRunRequest', - 'TaskRunRequest', - 'EncodedTaskRunRequest', - 'DockerBuildStep', - 'FileTaskStep', - 'EncodedTaskStep', - 'DockerBuildStepUpdateParameters', - 'FileTaskStepUpdateParameters', - 'EncodedTaskStepUpdateParameters', + 'TrustPolicy', + 'UserIdentityProperties', + 'VirtualNetworkRule', + 'Webhook', + 'WebhookCreateParameters', + 'WebhookUpdateParameters', 'RegistryPaged', 'OperationDefinitionPaged', 'ReplicationPaged', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/container_registry_management_client_enums.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/_container_registry_management_client_enums.py similarity index 100% rename from sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/container_registry_management_client_enums.py rename to sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/_container_registry_management_client_enums.py diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/_models.py new file mode 100644 index 000000000000..49d16f270b3c --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/_models.py @@ -0,0 +1,3456 @@ +# 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) + + +class AgentProperties(Model): + """The properties that determine the run agent configuration. + + :param cpu: The CPU configuration in terms of number of cores required for + the run. + :type cpu: int + """ + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AgentProperties, self).__init__(**kwargs) + self.cpu = kwargs.get('cpu', None) + + +class Argument(Model): + """The properties of a run argument. + + All required parameters must be populated in order to send to Azure. + + :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 = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Argument, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.is_secret = kwargs.get('is_secret', False) + + +class AuthInfo(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: Required. The type of Auth token. Possible values + include: 'PAT', 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.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_type': {'required': True}, + '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(AuthInfo, 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) + + +class AuthInfoUpdateParameters(Model): + """The authorization properties for accessing the source code repository. + + :param token_type: The type of Auth token. Possible values include: 'PAT', + 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TokenType + :param token: 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 + """ + + _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(AuthInfoUpdateParameters, 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) + + +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.v2019_05_01.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) + + +class BaseImageTrigger(Model): + """The trigger based on base image dependency. + + All required parameters must be populated in order to send to Azure. + + :param base_image_trigger_type: Required. The type of the auto trigger for + base image dependency updates. Possible values include: 'All', 'Runtime' + :type base_image_trigger_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTriggerType + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'base_image_trigger_type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BaseImageTrigger, self).__init__(**kwargs) + self.base_image_trigger_type = kwargs.get('base_image_trigger_type', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class BaseImageTriggerUpdateParameters(Model): + """The properties for updating base image dependency trigger. + + All required parameters must be populated in order to send to Azure. + + :param base_image_trigger_type: The type of the auto trigger for base + image dependency updates. Possible values include: 'All', 'Runtime' + :type base_image_trigger_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTriggerType + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BaseImageTriggerUpdateParameters, self).__init__(**kwargs) + self.base_image_trigger_type = kwargs.get('base_image_trigger_type', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +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) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class Credentials(Model): + """The parameters that describes a set of credentials that will be used when a + run is invoked. + + :param source_registry: Describes the credential parameters for accessing + the source registry. + :type source_registry: + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceRegistryCredentials + :param custom_registries: Describes the credential parameters for + accessing other custom registries. The key + for the dictionary item will be the registry login server + (myregistry.azurecr.io) and + the value of the item will be the registry credentials for accessing the + registry. + :type custom_registries: dict[str, + ~azure.mgmt.containerregistry.v2019_05_01.models.CustomRegistryCredentials] + """ + + _attribute_map = { + 'source_registry': {'key': 'sourceRegistry', 'type': 'SourceRegistryCredentials'}, + 'custom_registries': {'key': 'customRegistries', 'type': '{CustomRegistryCredentials}'}, + } + + def __init__(self, **kwargs): + super(Credentials, self).__init__(**kwargs) + self.source_registry = kwargs.get('source_registry', None) + self.custom_registries = kwargs.get('custom_registries', None) + + +class CustomRegistryCredentials(Model): + """Describes the credentials that will be used to access a custom registry + during a run. + + :param user_name: The username for logging into the custom registry. + :type user_name: + ~azure.mgmt.containerregistry.v2019_05_01.models.SecretObject + :param password: The password for logging into the custom registry. The + password is a secret + object that allows multiple ways of providing the value for it. + :type password: + ~azure.mgmt.containerregistry.v2019_05_01.models.SecretObject + :param identity: Indicates the managed identity assigned to the custom + credential. If a user-assigned identity + this value is the Client ID. If a system-assigned identity, the value will + be `system`. In + the case of a system-assigned identity, the Client ID will be determined + by the runner. This + identity may be used to authenticate to key vault to retrieve credentials + or it may be the only + source of authentication used for accessing the registry. + :type identity: str + """ + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'SecretObject'}, + 'password': {'key': 'password', 'type': 'SecretObject'}, + 'identity': {'key': 'identity', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomRegistryCredentials, self).__init__(**kwargs) + self.user_name = kwargs.get('user_name', None) + self.password = kwargs.get('password', None) + self.identity = kwargs.get('identity', None) + + +class RunRequest(Model): + """The request parameters for scheduling a run. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildRequest, FileTaskRunRequest, TaskRunRequest, + EncodedTaskRunRequest + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} + } + + def __init__(self, **kwargs): + super(RunRequest, self).__init__(**kwargs) + self.is_archive_enabled = kwargs.get('is_archive_enabled', False) + self.type = None + + +class DockerBuildRequest(RunRequest): + """The parameters for a docker quick build. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :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 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: Required. The Docker file path relative to the + source location. + :type docker_file_path: str + :param target: The name of the target build stage for the docker build. + :type target: str + :param arguments: The collection of override arguments to be used when + executing the run. + :type arguments: + list[~azure.mgmt.containerregistry.v2019_05_01.models.Argument] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'docker_file_path': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', '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'}, + 'target': {'key': 'target', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, **kwargs): + super(DockerBuildRequest, self).__init__(**kwargs) + 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.target = kwargs.get('target', None) + self.arguments = kwargs.get('arguments', None) + self.timeout = kwargs.get('timeout', 3600) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.source_location = kwargs.get('source_location', None) + self.credentials = kwargs.get('credentials', None) + self.type = 'DockerBuildRequest' + + +class TaskStepProperties(Model): + """Base properties for any task step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStep, FileTaskStep, EncodedTaskStep + + 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStep', 'FileTask': 'FileTaskStep', 'EncodedTask': 'EncodedTaskStep'} + } + + def __init__(self, **kwargs): + super(TaskStepProperties, self).__init__(**kwargs) + self.base_image_dependencies = None + self.context_path = kwargs.get('context_path', None) + self.context_access_token = kwargs.get('context_access_token', None) + self.type = None + + +class DockerBuildStep(TaskStepProperties): + """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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :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 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: Required. The Docker file path relative to the + source context. + :type docker_file_path: str + :param target: The name of the target build stage for the docker build. + :type target: str + :param arguments: The collection of override arguments to be used when + executing this build step. + :type arguments: + list[~azure.mgmt.containerregistry.v2019_05_01.models.Argument] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'docker_file_path': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + 'target': {'key': 'target', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + } + + def __init__(self, **kwargs): + super(DockerBuildStep, self).__init__(**kwargs) + 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.target = kwargs.get('target', None) + self.arguments = kwargs.get('arguments', None) + self.type = 'Docker' + + +class TaskStepUpdateParameters(Model): + """Base properties for updating any task step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStepUpdateParameters, + FileTaskStepUpdateParameters, EncodedTaskStepUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStepUpdateParameters', 'FileTask': 'FileTaskStepUpdateParameters', 'EncodedTask': 'EncodedTaskStepUpdateParameters'} + } + + def __init__(self, **kwargs): + super(TaskStepUpdateParameters, self).__init__(**kwargs) + self.context_path = kwargs.get('context_path', None) + self.context_access_token = kwargs.get('context_access_token', None) + self.type = None + + +class DockerBuildStepUpdateParameters(TaskStepUpdateParameters): + """The properties for updating a docker build step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :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 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 + context. + :type docker_file_path: str + :param arguments: The collection of override arguments to be used when + executing this build step. + :type arguments: + list[~azure.mgmt.containerregistry.v2019_05_01.models.Argument] + :param target: The name of the target build stage for the docker build. + :type target: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DockerBuildStepUpdateParameters, self).__init__(**kwargs) + 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.arguments = kwargs.get('arguments', None) + self.target = kwargs.get('target', None) + self.type = 'Docker' + + +class EncodedTaskRunRequest(RunRequest): + """The parameters for a quick task run request. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Required. Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'encoded_task_content': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, **kwargs): + super(EncodedTaskRunRequest, self).__init__(**kwargs) + self.encoded_task_content = kwargs.get('encoded_task_content', None) + self.encoded_values_content = kwargs.get('encoded_values_content', None) + self.values = kwargs.get('values', None) + self.timeout = kwargs.get('timeout', 3600) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.source_location = kwargs.get('source_location', None) + self.credentials = kwargs.get('credentials', None) + self.type = 'EncodedTaskRunRequest' + + +class EncodedTaskStep(TaskStepProperties): + """The properties of a encoded task 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Required. Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'encoded_task_content': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(EncodedTaskStep, self).__init__(**kwargs) + self.encoded_task_content = kwargs.get('encoded_task_content', None) + self.encoded_values_content = kwargs.get('encoded_values_content', None) + self.values = kwargs.get('values', None) + self.type = 'EncodedTask' + + +class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters): + """The properties for updating encoded task step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(EncodedTaskStepUpdateParameters, self).__init__(**kwargs) + self.encoded_task_content = kwargs.get('encoded_task_content', None) + self.encoded_values_content = kwargs.get('encoded_values_content', None) + self.values = kwargs.get('values', None) + self.type = 'EncodedTask' + + +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) + + +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.v2019_05_01.models.EventRequestMessage + :param event_response_message: The event response message received from + the service URI. + :type event_response_message: + ~azure.mgmt.containerregistry.v2019_05_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, **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) + + +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.v2019_05_01.models.Target + :param request: The request that generated the event. + :type request: ~azure.mgmt.containerregistry.v2019_05_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.v2019_05_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.v2019_05_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, **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) + + +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.v2019_05_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, **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) + + +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) + + +class FileTaskRunRequest(RunRequest): + """The request parameters for a scheduling run against a task file. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: Required. The template/definition file path + relative to the source. + :type task_file_path: str + :param values_file_path: The values/parameters file path relative to the + source. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'task_file_path': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, **kwargs): + super(FileTaskRunRequest, self).__init__(**kwargs) + self.task_file_path = kwargs.get('task_file_path', None) + self.values_file_path = kwargs.get('values_file_path', None) + self.values = kwargs.get('values', None) + self.timeout = kwargs.get('timeout', 3600) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.source_location = kwargs.get('source_location', None) + self.credentials = kwargs.get('credentials', None) + self.type = 'FileTaskRunRequest' + + +class FileTaskStep(TaskStepProperties): + """The properties of a task 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: Required. The task template/definition file path + relative to the source context. + :type task_file_path: str + :param values_file_path: The task values/parameters file path relative to + the source context. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'task_file_path': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(FileTaskStep, self).__init__(**kwargs) + self.task_file_path = kwargs.get('task_file_path', None) + self.values_file_path = kwargs.get('values_file_path', None) + self.values = kwargs.get('values', None) + self.type = 'FileTask' + + +class FileTaskStepUpdateParameters(TaskStepUpdateParameters): + """The properties of updating a task step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: The task template/definition file path relative to + the source context. + :type task_file_path: str + :param values_file_path: The values/parameters file path relative to the + source context. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(FileTaskStepUpdateParameters, self).__init__(**kwargs) + self.task_file_path = kwargs.get('task_file_path', None) + self.values_file_path = kwargs.get('values_file_path', None) + self.values = kwargs.get('values', None) + self.type = 'FileTask' + + +class IdentityProperties(Model): + """Managed identity for the resource. + + :param principal_id: The principal ID of resource identity. + :type principal_id: str + :param tenant_id: The tenant ID of resource. + :type tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned', + 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated + with the resource. The user identity + dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.containerregistry.v2019_05_01.models.UserIdentityProperties] + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentityProperties}'}, + } + + def __init__(self, **kwargs): + super(IdentityProperties, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +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) + + +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.v2019_05_01.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) + + +class ImportImageParameters(Model): + """ImportImageParameters. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the image. + :type source: + ~azure.mgmt.containerregistry.v2019_05_01.models.ImportSource + :param target_tags: List of strings of the form repo[:tag]. When tag is + omitted the source will be used (or 'latest' if source tag is also + omitted). + :type target_tags: list[str] + :param untagged_target_repositories: List of strings of repository names + to do a manifest only copy. No tag will be created. + :type untagged_target_repositories: list[str] + :param mode: When Force, any existing target tags will be overwritten. + When NoForce, any existing target tags will fail the operation before any + copying begins. Possible values include: 'NoForce', 'Force'. Default + value: "NoForce" . + :type mode: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.ImportMode + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ImportSource'}, + 'target_tags': {'key': 'targetTags', 'type': '[str]'}, + 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportImageParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.target_tags = kwargs.get('target_tags', None) + self.untagged_target_repositories = kwargs.get('untagged_target_repositories', None) + self.mode = kwargs.get('mode', "NoForce") + + +class ImportSource(Model): + """ImportSource. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: The resource identifier of the source Azure Container + Registry. + :type resource_id: str + :param registry_uri: The address of the source registry (e.g. + 'mcr.microsoft.com'). + :type registry_uri: str + :param credentials: Credentials used when importing from a registry uri. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01.models.ImportSourceCredentials + :param source_image: Required. Repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' + tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest + ('hello-world@sha256:abc123'). + :type source_image: str + """ + + _validation = { + 'source_image': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'registry_uri': {'key': 'registryUri', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, + 'source_image': {'key': 'sourceImage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportSource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.registry_uri = kwargs.get('registry_uri', None) + self.credentials = kwargs.get('credentials', None) + self.source_image = kwargs.get('source_image', None) + + +class ImportSourceCredentials(Model): + """ImportSourceCredentials. + + All required parameters must be populated in order to send to Azure. + + :param username: The username to authenticate with the source registry. + :type username: str + :param password: Required. The password used to authenticate with the + source registry. + :type password: str + """ + + _validation = { + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportSourceCredentials, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.Action + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.action = kwargs.get('action', "Allow") + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + + +class NetworkRuleSet(Model): + """The network rule set for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Required. The default action of allow or deny when + no other rules match. Possible values include: 'Allow', 'Deny'. Default + value: "Allow" . + :type default_action: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.DefaultAction + :param virtual_network_rules: The virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.containerregistry.v2019_05_01.models.VirtualNetworkRule] + :param ip_rules: The IP ACL rules. + :type ip_rules: + list[~azure.mgmt.containerregistry.v2019_05_01.models.IPRule] + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = kwargs.get('default_action', "Allow") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param origin: The origin information of the container registry operation. + :type origin: str + :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.v2019_05_01.models.OperationDisplayDefinition + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2019_05_01.models.OperationServiceSpecificationDefinition + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, + } + + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.origin = kwargs.get('origin', None) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.service_specification = kwargs.get('service_specification', None) + + +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) + + +class OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) + + +class OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2019_05_01.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, **kwargs): + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class PlatformProperties(Model): + """The platform properties against which the run has to happen. + + All required parameters must be populated in order to send to Azure. + + :param os: Required. The operating system type required for the run. + Possible values include: 'Windows', 'Linux' + :type os: str or ~azure.mgmt.containerregistry.v2019_05_01.models.OS + :param architecture: The OS architecture. Possible values include: + 'amd64', 'x86', 'arm' + :type architecture: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.Architecture + :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', + 'v8' + :type variant: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.Variant + """ + + _validation = { + 'os': {'required': True}, + } + + _attribute_map = { + 'os': {'key': 'os', 'type': 'str'}, + 'architecture': {'key': 'architecture', 'type': 'str'}, + 'variant': {'key': 'variant', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PlatformProperties, self).__init__(**kwargs) + self.os = kwargs.get('os', None) + self.architecture = kwargs.get('architecture', None) + self.variant = kwargs.get('variant', None) + + +class PlatformUpdateParameters(Model): + """The properties for updating the platform configuration. + + :param os: The operating system type required for the run. Possible values + include: 'Windows', 'Linux' + :type os: str or ~azure.mgmt.containerregistry.v2019_05_01.models.OS + :param architecture: The OS architecture. Possible values include: + 'amd64', 'x86', 'arm' + :type architecture: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.Architecture + :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', + 'v8' + :type variant: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.Variant + """ + + _attribute_map = { + 'os': {'key': 'os', 'type': 'str'}, + 'architecture': {'key': 'architecture', 'type': 'str'}, + 'variant': {'key': 'variant', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PlatformUpdateParameters, self).__init__(**kwargs) + self.os = kwargs.get('os', None) + self.architecture = kwargs.get('architecture', None) + self.variant = kwargs.get('variant', None) + + +class Policies(Model): + """The policies for a container registry. + + :param quarantine_policy: The quarantine policy for a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2019_05_01.models.QuarantinePolicy + :param trust_policy: The content trust policy for a container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2019_05_01.models.TrustPolicy + :param retention_policy: The retention policy for a container registry. + :type retention_policy: + ~azure.mgmt.containerregistry.v2019_05_01.models.RetentionPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__(self, **kwargs): + super(Policies, self).__init__(**kwargs) + self.quarantine_policy = kwargs.get('quarantine_policy', None) + self.trust_policy = kwargs.get('trust_policy', None) + self.retention_policy = kwargs.get('retention_policy', None) + + +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 + + +class QuarantinePolicy(Model): + """The quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + +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.v2019_05_01.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) + + +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) + + +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.v2019_05_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.v2019_05_01.models.ProvisioningState + :ivar status: The status of the container registry at the time the + operation was called. + :vartype status: ~azure.mgmt.containerregistry.v2019_05_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.v2019_05_01.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2019_05_01.models.NetworkRuleSet + :param policies: The policies for a container registry. + :type policies: ~azure.mgmt.containerregistry.v2019_05_01.models.Policies + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + 'policies': {'key': 'properties.policies', 'type': 'Policies'}, + } + + 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) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.policies = kwargs.get('policies', None) + + +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.v2019_05_01.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) + + +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) + + +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) + + +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.v2019_05_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, **kwargs): + super(RegistryPassword, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +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.v2019_05_01.models.Sku + :param admin_user_enabled: The value that indicates whether the admin user + is enabled. + :type admin_user_enabled: bool + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2019_05_01.models.NetworkRuleSet + :param policies: The policies for a container registry. + :type policies: ~azure.mgmt.containerregistry.v2019_05_01.models.Policies + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + 'policies': {'key': 'properties.policies', 'type': 'Policies'}, + } + + 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.network_rule_set = kwargs.get('network_rule_set', None) + self.policies = kwargs.get('policies', None) + + +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.v2019_05_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, **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) + + +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.v2019_05_01.models.RegistryUsage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RegistryUsage]'}, + } + + def __init__(self, **kwargs): + super(RegistryUsageListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +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.v2019_05_01.models.ProvisioningState + :ivar status: The status of the replication at the time the operation was + called. + :vartype status: ~azure.mgmt.containerregistry.v2019_05_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, **kwargs): + super(Replication, self).__init__(**kwargs) + self.provisioning_state = None + self.status = None + + +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) + + +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) + + +class RetentionPolicy(Model): + """The retention policy for a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param days: The number of days to retain manifest before it expires. + :type days: int + :ivar last_updated_time: The timestamp when the policy was last updated. + :vartype last_updated_time: datetime + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus + """ + + _validation = { + 'last_updated_time': {'readonly': True}, + } + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RetentionPolicy, self).__init__(**kwargs) + self.days = kwargs.get('days', None) + self.last_updated_time = None + self.status = kwargs.get('status', None) + + +class Run(ProxyResource): + """Run 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 run_id: The unique identifier for the run. + :type run_id: str + :param status: The current status of the run. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.RunStatus + :param last_updated_time: The last updated time for the run. + :type last_updated_time: datetime + :param run_type: The type of run. Possible values include: 'QuickBuild', + 'QuickRun', 'AutoBuild', 'AutoRun' + :type run_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.RunType + :param create_time: The time the run was scheduled. + :type create_time: datetime + :param start_time: The time the run started. + :type start_time: datetime + :param finish_time: The time the run finished. + :type finish_time: datetime + :param output_images: The list of all images that were generated from the + run. This is applicable if the run generates base image dependencies. + :type output_images: + list[~azure.mgmt.containerregistry.v2019_05_01.models.ImageDescriptor] + :param task: The task against which run was scheduled. + :type task: str + :param image_update_trigger: The image update trigger that caused the run. + This is applicable if the task has base image trigger configured. + :type image_update_trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.ImageUpdateTrigger + :param source_trigger: The source trigger that caused the run. + :type source_trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerDescriptor + :param platform: The platform properties against which the run will + happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties + :param source_registry_auth: The scope of the credentials that were used + to login to the source registry during this run. + :type source_registry_auth: str + :param custom_registries: The list of custom registries that were logged + in during this run. + :type custom_registries: list[str] + :ivar run_error_message: The error message received from backend systems + after the run is scheduled. + :vartype run_error_message: str + :param provisioning_state: The provisioning state of a run. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :type provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.ProvisioningState + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. Default value: False . + :type is_archive_enabled: bool + :param timer_trigger: The timer trigger that caused the run. + :type timer_trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.TimerTriggerDescriptor + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'run_error_message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'run_id': {'key': 'properties.runId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'run_type': {'key': 'properties.runType', '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]'}, + 'task': {'key': 'properties.task', 'type': 'str'}, + 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, + 'source_trigger': {'key': 'properties.sourceTrigger', 'type': 'SourceTriggerDescriptor'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'source_registry_auth': {'key': 'properties.sourceRegistryAuth', 'type': 'str'}, + 'custom_registries': {'key': 'properties.customRegistries', 'type': '[str]'}, + 'run_error_message': {'key': 'properties.runErrorMessage', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, + 'timer_trigger': {'key': 'properties.timerTrigger', 'type': 'TimerTriggerDescriptor'}, + } + + def __init__(self, **kwargs): + super(Run, self).__init__(**kwargs) + self.run_id = kwargs.get('run_id', None) + self.status = kwargs.get('status', None) + self.last_updated_time = kwargs.get('last_updated_time', None) + self.run_type = kwargs.get('run_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.task = kwargs.get('task', None) + self.image_update_trigger = kwargs.get('image_update_trigger', None) + self.source_trigger = kwargs.get('source_trigger', None) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.source_registry_auth = kwargs.get('source_registry_auth', None) + self.custom_registries = kwargs.get('custom_registries', None) + self.run_error_message = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.is_archive_enabled = kwargs.get('is_archive_enabled', False) + self.timer_trigger = kwargs.get('timer_trigger', None) + + +class RunFilter(Model): + """Properties that are enabled for Odata querying on runs. + + :param run_id: The unique identifier for the run. + :type run_id: str + :param run_type: The type of run. Possible values include: 'QuickBuild', + 'QuickRun', 'AutoBuild', 'AutoRun' + :type run_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.RunType + :param status: The current status of the run. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.RunStatus + :param create_time: The create time for a run. + :type create_time: datetime + :param finish_time: The time the run finished. + :type finish_time: datetime + :param output_image_manifests: The list of comma-separated image manifests + that were generated from the run. This is applicable if the run is of + build type. + :type output_image_manifests: str + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. + :type is_archive_enabled: bool + :param task_name: The name of the task that the run corresponds to. + :type task_name: str + """ + + _attribute_map = { + 'run_id': {'key': 'runId', 'type': 'str'}, + 'run_type': {'key': 'runType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunFilter, self).__init__(**kwargs) + self.run_id = kwargs.get('run_id', None) + self.run_type = kwargs.get('run_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_manifests = kwargs.get('output_image_manifests', None) + self.is_archive_enabled = kwargs.get('is_archive_enabled', None) + self.task_name = kwargs.get('task_name', None) + + +class RunGetLogResult(Model): + """The result of get log link operation. + + :param log_link: The link to logs for a run on a azure container registry. + :type log_link: str + """ + + _attribute_map = { + 'log_link': {'key': 'logLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RunGetLogResult, self).__init__(**kwargs) + self.log_link = kwargs.get('log_link', None) + + +class RunUpdateParameters(Model): + """The set of run 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(RunUpdateParameters, self).__init__(**kwargs) + self.is_archive_enabled = kwargs.get('is_archive_enabled', None) + + +class SecretObject(Model): + """Describes the properties of a secret object value. + + :param value: The value of the secret. The format of this value will be + determined + based on the type of the secret object. If the type is Opaque, the value + will be + used as is without any modification. + :type value: str + :param type: The type of the secret object which determines how the value + of the secret object has to be + interpreted. Possible values include: 'Opaque', 'Vaultsecret' + :type type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.SecretObjectType + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecretObject, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.type = kwargs.get('type', None) + + +class SetValue(Model): + """The properties of a overridable value that can be passed to a task + template. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the overridable value. + :type name: str + :param value: Required. The overridable value. + :type value: str + :param is_secret: Flag to indicate whether the value represents a secret + or not. Default value: False . + :type is_secret: bool + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SetValue, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.is_secret = kwargs.get('is_secret', False) + + +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.v2019_05_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.v2019_05_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, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + + +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) + + +class SourceProperties(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.v2019_05_01.models.SourceControlType + :param repository_url: Required. The full URL to the source code + repository + :type repository_url: str + :param branch: The branch name of the source code. + :type branch: str + :param source_control_auth_properties: The authorization properties for + accessing the source code repository and to set up + webhooks for notifications. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2019_05_01.models.AuthInfo + """ + + _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'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfo'}, + } + + def __init__(self, **kwargs): + super(SourceProperties, self).__init__(**kwargs) + self.source_control_type = kwargs.get('source_control_type', None) + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) + + +class SourceRegistryCredentials(Model): + """Describes the credential parameters for accessing the source registry. + + :param login_mode: The authentication mode which determines the source + registry login scope. The credentials for the source registry + will be generated using the given scope. These credentials will be used to + login to + the source registry during the run. Possible values include: 'None', + 'Default' + :type login_mode: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceRegistryLoginMode + """ + + _attribute_map = { + 'login_mode': {'key': 'loginMode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceRegistryCredentials, self).__init__(**kwargs) + self.login_mode = kwargs.get('login_mode', None) + + +class SourceTrigger(Model): + """The properties of a source based trigger. + + All required parameters must be populated in order to send to Azure. + + :param source_repository: Required. The properties that describes the + source(code) for the task. + :type source_repository: + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceProperties + :param source_trigger_events: Required. The source event corresponding to + the trigger. + :type source_trigger_events: list[str or + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerEvent] + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'source_repository': {'required': True}, + 'source_trigger_events': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'source_repository': {'key': 'sourceRepository', 'type': 'SourceProperties'}, + 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceTrigger, self).__init__(**kwargs) + self.source_repository = kwargs.get('source_repository', None) + self.source_trigger_events = kwargs.get('source_trigger_events', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class SourceTriggerDescriptor(Model): + """The source trigger that caused a run. + + :param id: The unique ID of the trigger. + :type id: str + :param event_type: The event type of the trigger. + :type event_type: str + :param commit_id: The unique ID that identifies a commit. + :type commit_id: str + :param pull_request_id: The unique ID that identifies pull request. + :type pull_request_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'}, + 'event_type': {'key': 'eventType', 'type': 'str'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'pull_request_id': {'key': 'pullRequestId', '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(SourceTriggerDescriptor, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.event_type = kwargs.get('event_type', None) + self.commit_id = kwargs.get('commit_id', None) + self.pull_request_id = kwargs.get('pull_request_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) + + +class SourceTriggerUpdateParameters(Model): + """The properties for updating a source based trigger. + + All required parameters must be populated in order to send to Azure. + + :param source_repository: The properties that describes the source(code) + for the task. + :type source_repository: + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceUpdateParameters + :param source_trigger_events: The source event corresponding to the + trigger. + :type source_trigger_events: list[str or + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerEvent] + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'source_repository': {'key': 'sourceRepository', 'type': 'SourceUpdateParameters'}, + 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceTriggerUpdateParameters, self).__init__(**kwargs) + self.source_repository = kwargs.get('source_repository', None) + self.source_trigger_events = kwargs.get('source_trigger_events', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class SourceUpdateParameters(Model): + """The properties for updating the source code repository. + + :param source_control_type: The type of source control service. Possible + values include: 'Github', 'VisualStudioTeamService' + :type source_control_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceControlType + :param repository_url: The full URL to the source code repository + :type repository_url: str + :param branch: The branch name of the source code. + :type branch: str + :param source_control_auth_properties: The authorization properties for + accessing the source code repository and to set up + webhooks for notifications. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2019_05_01.models.AuthInfoUpdateParameters + """ + + _attribute_map = { + 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, + 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfoUpdateParameters'}, + } + + def __init__(self, **kwargs): + super(SourceUpdateParameters, self).__init__(**kwargs) + self.source_control_type = kwargs.get('source_control_type', None) + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) + + +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) + + +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 + + +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) + + +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 + :param name: The name of the artifact. + :type name: str + :param version: The version of the artifact. + :type version: 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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', '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) + self.name = kwargs.get('name', None) + self.version = kwargs.get('version', None) + + +class Task(Resource): + """The task that has the ARM resource and task properties. + The task will have all information to schedule a run 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] + :param identity: Identity for the resource. + :type identity: + ~azure.mgmt.containerregistry.v2019_05_01.models.IdentityProperties + :ivar provisioning_state: The provisioning state of the task. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.ProvisioningState + :ivar creation_date: The creation date of task. + :vartype creation_date: datetime + :param status: The current status of task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStatus + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param step: Required. The properties of a task step. + :type step: + ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStepProperties + :param trigger: The properties that describe all triggers for the task. + :type trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerProperties + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'platform': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'step': {'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}'}, + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, + 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, + 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, + } + + def __init__(self, **kwargs): + super(Task, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.creation_date = None + self.status = kwargs.get('status', None) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.timeout = kwargs.get('timeout', 3600) + self.step = kwargs.get('step', None) + self.trigger = kwargs.get('trigger', None) + self.credentials = kwargs.get('credentials', None) + + +class TaskRunRequest(RunRequest): + """The parameters for a task run request. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param task_name: Required. The name of task against which run has to be + queued. + :type task_name: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + 'task_name': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, **kwargs): + super(TaskRunRequest, self).__init__(**kwargs) + self.task_name = kwargs.get('task_name', None) + self.values = kwargs.get('values', None) + self.type = 'TaskRunRequest' + + +class TaskUpdateParameters(Model): + """The parameters for updating a task. + + :param identity: Identity for the resource. + :type identity: + ~azure.mgmt.containerregistry.v2019_05_01.models.IdentityProperties + :param status: The current status of task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStatus + :param platform: The platform properties against which the run has to + happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformUpdateParameters + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties + :param timeout: Run timeout in seconds. + :type timeout: int + :param step: The properties for updating a task step. + :type step: + ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStepUpdateParameters + :param trigger: The properties for updating trigger properties. + :type trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerUpdateParameters + :param credentials: The parameters that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, + 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, + 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TaskUpdateParameters, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.status = kwargs.get('status', None) + self.platform = kwargs.get('platform', None) + self.agent_configuration = kwargs.get('agent_configuration', None) + self.timeout = kwargs.get('timeout', None) + self.step = kwargs.get('step', None) + self.trigger = kwargs.get('trigger', None) + self.credentials = kwargs.get('credentials', None) + self.tags = kwargs.get('tags', None) + + +class TimerTrigger(Model): + """The properties of a timer trigger. + + All required parameters must be populated in order to send to Azure. + + :param schedule: Required. The CRON expression for the task schedule + :type schedule: str + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'schedule': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TimerTrigger, self).__init__(**kwargs) + self.schedule = kwargs.get('schedule', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class TimerTriggerDescriptor(Model): + """TimerTriggerDescriptor. + + :param timer_trigger_name: The timer trigger name that caused the run. + :type timer_trigger_name: str + :param schedule_occurrence: The occurrence that triggered the run. + :type schedule_occurrence: str + """ + + _attribute_map = { + 'timer_trigger_name': {'key': 'timerTriggerName', 'type': 'str'}, + 'schedule_occurrence': {'key': 'scheduleOccurrence', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TimerTriggerDescriptor, self).__init__(**kwargs) + self.timer_trigger_name = kwargs.get('timer_trigger_name', None) + self.schedule_occurrence = kwargs.get('schedule_occurrence', None) + + +class TimerTriggerUpdateParameters(Model): + """The properties for updating a timer trigger. + + All required parameters must be populated in order to send to Azure. + + :param schedule: The CRON expression for the task schedule + :type schedule: str + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TimerTriggerUpdateParameters, self).__init__(**kwargs) + self.schedule = kwargs.get('schedule', None) + self.status = kwargs.get('status', "Enabled") + self.name = kwargs.get('name', None) + + +class TriggerProperties(Model): + """The properties of a trigger. + + :param timer_triggers: The collection of timer triggers. + :type timer_triggers: + list[~azure.mgmt.containerregistry.v2019_05_01.models.TimerTrigger] + :param source_triggers: The collection of triggers based on source code + repository. + :type source_triggers: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SourceTrigger] + :param base_image_trigger: The trigger based on base image dependencies. + :type base_image_trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTrigger + """ + + _attribute_map = { + 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTrigger]'}, + 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTrigger]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTrigger'}, + } + + def __init__(self, **kwargs): + super(TriggerProperties, self).__init__(**kwargs) + self.timer_triggers = kwargs.get('timer_triggers', None) + self.source_triggers = kwargs.get('source_triggers', None) + self.base_image_trigger = kwargs.get('base_image_trigger', None) + + +class TriggerUpdateParameters(Model): + """The properties for updating triggers. + + :param timer_triggers: The collection of timer triggers. + :type timer_triggers: + list[~azure.mgmt.containerregistry.v2019_05_01.models.TimerTriggerUpdateParameters] + :param source_triggers: The collection of triggers based on source code + repository. + :type source_triggers: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerUpdateParameters] + :param base_image_trigger: The trigger based on base image dependencies. + :type base_image_trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTriggerUpdateParameters + """ + + _attribute_map = { + 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTriggerUpdateParameters]'}, + 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTriggerUpdateParameters]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTriggerUpdateParameters'}, + } + + def __init__(self, **kwargs): + super(TriggerUpdateParameters, self).__init__(**kwargs) + self.timer_triggers = kwargs.get('timer_triggers', None) + self.source_triggers = kwargs.get('source_triggers', None) + self.base_image_trigger = kwargs.get('base_image_trigger', None) + + +class TrustPolicy(Model): + """The content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrustPolicy, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.status = kwargs.get('status', None) + + +class UserIdentityProperties(Model): + """UserIdentityProperties. + + :param principal_id: The principal id of user assigned identity. + :type principal_id: str + :param client_id: The client id of user assigned identity. + :type client_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserIdentityProperties, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.client_id = kwargs.get('client_id', None) + + +class VirtualNetworkRule(Model): + """Virtual network rule. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.Action + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.action = kwargs.get('action', "Allow") + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + + +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.v2019_05_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.v2019_05_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.v2019_05_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, **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 + + +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.v2019_05_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.v2019_05_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, **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) + + +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.v2019_05_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.v2019_05_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/_models_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/_models_py3.py new file mode 100644 index 000000000000..20a0153ed86c --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/_models_py3.py @@ -0,0 +1,3456 @@ +# 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 + + +class AgentProperties(Model): + """The properties that determine the run agent configuration. + + :param cpu: The CPU configuration in terms of number of cores required for + the run. + :type cpu: int + """ + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'int'}, + } + + def __init__(self, *, cpu: int=None, **kwargs) -> None: + super(AgentProperties, self).__init__(**kwargs) + self.cpu = cpu + + +class Argument(Model): + """The properties of a run argument. + + All required parameters must be populated in order to send to Azure. + + :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 = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: + super(Argument, self).__init__(**kwargs) + self.name = name + self.value = value + self.is_secret = is_secret + + +class AuthInfo(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: Required. The type of Auth token. Possible values + include: 'PAT', 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.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_type': {'required': True}, + '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_type, token: str, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: + super(AuthInfo, self).__init__(**kwargs) + self.token_type = token_type + self.token = token + self.refresh_token = refresh_token + self.scope = scope + self.expires_in = expires_in + + +class AuthInfoUpdateParameters(Model): + """The authorization properties for accessing the source code repository. + + :param token_type: The type of Auth token. Possible values include: 'PAT', + 'OAuth' + :type token_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TokenType + :param token: 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 + """ + + _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_type=None, token: str=None, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: + super(AuthInfoUpdateParameters, self).__init__(**kwargs) + self.token_type = token_type + self.token = token + self.refresh_token = refresh_token + self.scope = scope + self.expires_in = expires_in + + +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.v2019_05_01.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 + + +class BaseImageTrigger(Model): + """The trigger based on base image dependency. + + All required parameters must be populated in order to send to Azure. + + :param base_image_trigger_type: Required. The type of the auto trigger for + base image dependency updates. Possible values include: 'All', 'Runtime' + :type base_image_trigger_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTriggerType + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'base_image_trigger_type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, base_image_trigger_type, name: str, status="Enabled", **kwargs) -> None: + super(BaseImageTrigger, self).__init__(**kwargs) + self.base_image_trigger_type = base_image_trigger_type + self.status = status + self.name = name + + +class BaseImageTriggerUpdateParameters(Model): + """The properties for updating base image dependency trigger. + + All required parameters must be populated in order to send to Azure. + + :param base_image_trigger_type: The type of the auto trigger for base + image dependency updates. Possible values include: 'All', 'Runtime' + :type base_image_trigger_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTriggerType + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, base_image_trigger_type=None, status="Enabled", **kwargs) -> None: + super(BaseImageTriggerUpdateParameters, self).__init__(**kwargs) + self.base_image_trigger_type = base_image_trigger_type + self.status = status + self.name = name + + +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 + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class Credentials(Model): + """The parameters that describes a set of credentials that will be used when a + run is invoked. + + :param source_registry: Describes the credential parameters for accessing + the source registry. + :type source_registry: + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceRegistryCredentials + :param custom_registries: Describes the credential parameters for + accessing other custom registries. The key + for the dictionary item will be the registry login server + (myregistry.azurecr.io) and + the value of the item will be the registry credentials for accessing the + registry. + :type custom_registries: dict[str, + ~azure.mgmt.containerregistry.v2019_05_01.models.CustomRegistryCredentials] + """ + + _attribute_map = { + 'source_registry': {'key': 'sourceRegistry', 'type': 'SourceRegistryCredentials'}, + 'custom_registries': {'key': 'customRegistries', 'type': '{CustomRegistryCredentials}'}, + } + + def __init__(self, *, source_registry=None, custom_registries=None, **kwargs) -> None: + super(Credentials, self).__init__(**kwargs) + self.source_registry = source_registry + self.custom_registries = custom_registries + + +class CustomRegistryCredentials(Model): + """Describes the credentials that will be used to access a custom registry + during a run. + + :param user_name: The username for logging into the custom registry. + :type user_name: + ~azure.mgmt.containerregistry.v2019_05_01.models.SecretObject + :param password: The password for logging into the custom registry. The + password is a secret + object that allows multiple ways of providing the value for it. + :type password: + ~azure.mgmt.containerregistry.v2019_05_01.models.SecretObject + :param identity: Indicates the managed identity assigned to the custom + credential. If a user-assigned identity + this value is the Client ID. If a system-assigned identity, the value will + be `system`. In + the case of a system-assigned identity, the Client ID will be determined + by the runner. This + identity may be used to authenticate to key vault to retrieve credentials + or it may be the only + source of authentication used for accessing the registry. + :type identity: str + """ + + _attribute_map = { + 'user_name': {'key': 'userName', 'type': 'SecretObject'}, + 'password': {'key': 'password', 'type': 'SecretObject'}, + 'identity': {'key': 'identity', 'type': 'str'}, + } + + def __init__(self, *, user_name=None, password=None, identity: str=None, **kwargs) -> None: + super(CustomRegistryCredentials, self).__init__(**kwargs) + self.user_name = user_name + self.password = password + self.identity = identity + + +class RunRequest(Model): + """The request parameters for scheduling a run. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildRequest, FileTaskRunRequest, TaskRunRequest, + EncodedTaskRunRequest + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} + } + + def __init__(self, *, is_archive_enabled: bool=False, **kwargs) -> None: + super(RunRequest, self).__init__(**kwargs) + self.is_archive_enabled = is_archive_enabled + self.type = None + + +class DockerBuildRequest(RunRequest): + """The parameters for a docker quick build. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :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 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: Required. The Docker file path relative to the + source location. + :type docker_file_path: str + :param target: The name of the target build stage for the docker build. + :type target: str + :param arguments: The collection of override arguments to be used when + executing the run. + :type arguments: + list[~azure.mgmt.containerregistry.v2019_05_01.models.Argument] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'docker_file_path': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', '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'}, + 'target': {'key': 'target', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, *, docker_file_path: str, platform, is_archive_enabled: bool=False, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(DockerBuildRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + 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.target = target + self.arguments = arguments + self.timeout = timeout + self.platform = platform + self.agent_configuration = agent_configuration + self.source_location = source_location + self.credentials = credentials + self.type = 'DockerBuildRequest' + + +class TaskStepProperties(Model): + """Base properties for any task step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStep, FileTaskStep, EncodedTaskStep + + 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStep', 'FileTask': 'FileTaskStep', 'EncodedTask': 'EncodedTaskStep'} + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, **kwargs) -> None: + super(TaskStepProperties, self).__init__(**kwargs) + self.base_image_dependencies = None + self.context_path = context_path + self.context_access_token = context_access_token + self.type = None + + +class DockerBuildStep(TaskStepProperties): + """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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :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 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: Required. The Docker file path relative to the + source context. + :type docker_file_path: str + :param target: The name of the target build stage for the docker build. + :type target: str + :param arguments: The collection of override arguments to be used when + executing this build step. + :type arguments: + list[~azure.mgmt.containerregistry.v2019_05_01.models.Argument] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'docker_file_path': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + 'target': {'key': 'target', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + } + + def __init__(self, *, docker_file_path: str, context_path: str=None, context_access_token: str=None, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, **kwargs) -> None: + super(DockerBuildStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + 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.target = target + self.arguments = arguments + self.type = 'Docker' + + +class TaskStepUpdateParameters(Model): + """Base properties for updating any task step. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DockerBuildStepUpdateParameters, + FileTaskStepUpdateParameters, EncodedTaskStepUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'Docker': 'DockerBuildStepUpdateParameters', 'FileTask': 'FileTaskStepUpdateParameters', 'EncodedTask': 'EncodedTaskStepUpdateParameters'} + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, **kwargs) -> None: + super(TaskStepUpdateParameters, self).__init__(**kwargs) + self.context_path = context_path + self.context_access_token = context_access_token + self.type = None + + +class DockerBuildStepUpdateParameters(TaskStepUpdateParameters): + """The properties for updating a docker build step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :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 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 + context. + :type docker_file_path: str + :param arguments: The collection of override arguments to be used when + executing this build step. + :type arguments: + list[~azure.mgmt.containerregistry.v2019_05_01.models.Argument] + :param target: The name of the target build stage for the docker build. + :type target: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', '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'}, + 'arguments': {'key': 'arguments', 'type': '[Argument]'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, image_names=None, is_push_enabled: bool=None, no_cache: bool=None, docker_file_path: str=None, arguments=None, target: str=None, **kwargs) -> None: + super(DockerBuildStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + 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.arguments = arguments + self.target = target + self.type = 'Docker' + + +class EncodedTaskRunRequest(RunRequest): + """The parameters for a quick task run request. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Required. Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'encoded_task_content': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, *, encoded_task_content: str, platform, is_archive_enabled: bool=False, encoded_values_content: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(EncodedTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + self.encoded_task_content = encoded_task_content + self.encoded_values_content = encoded_values_content + self.values = values + self.timeout = timeout + self.platform = platform + self.agent_configuration = agent_configuration + self.source_location = source_location + self.credentials = credentials + self.type = 'EncodedTaskRunRequest' + + +class EncodedTaskStep(TaskStepProperties): + """The properties of a encoded task 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Required. Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'encoded_task_content': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, encoded_task_content: str, context_path: str=None, context_access_token: str=None, encoded_values_content: str=None, values=None, **kwargs) -> None: + super(EncodedTaskStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + self.encoded_task_content = encoded_task_content + self.encoded_values_content = encoded_values_content + self.values = values + self.type = 'EncodedTask' + + +class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters): + """The properties for updating encoded task step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param encoded_task_content: Base64 encoded value of the + template/definition file content. + :type encoded_task_content: str + :param encoded_values_content: Base64 encoded value of the + parameters/values file content. + :type encoded_values_content: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, + 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, encoded_task_content: str=None, encoded_values_content: str=None, values=None, **kwargs) -> None: + super(EncodedTaskStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + self.encoded_task_content = encoded_task_content + self.encoded_values_content = encoded_values_content + self.values = values + self.type = 'EncodedTask' + + +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 + + +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.v2019_05_01.models.EventRequestMessage + :param event_response_message: The event response message received from + the service URI. + :type event_response_message: + ~azure.mgmt.containerregistry.v2019_05_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 + + +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.v2019_05_01.models.Target + :param request: The request that generated the event. + :type request: ~azure.mgmt.containerregistry.v2019_05_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.v2019_05_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.v2019_05_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 + + +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.v2019_05_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 + + +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 + + +class FileTaskRunRequest(RunRequest): + """The request parameters for a scheduling run against a task file. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: Required. The template/definition file path + relative to the source. + :type task_file_path: str + :param values_file_path: The values/parameters file path relative to the + source. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties + :param source_location: The URL(absolute or relative) of the source + context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling + listBuildSourceUploadUrl API. + :type source_location: str + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials + """ + + _validation = { + 'type': {'required': True}, + 'task_file_path': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'platform': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + 'timeout': {'key': 'timeout', 'type': 'int'}, + 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, + 'source_location': {'key': 'sourceLocation', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'Credentials'}, + } + + def __init__(self, *, task_file_path: str, platform, is_archive_enabled: bool=False, values_file_path: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: + super(FileTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + self.task_file_path = task_file_path + self.values_file_path = values_file_path + self.values = values + self.timeout = timeout + self.platform = platform + self.agent_configuration = agent_configuration + self.source_location = source_location + self.credentials = credentials + self.type = 'FileTaskRunRequest' + + +class FileTaskStep(TaskStepProperties): + """The properties of a task 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 base_image_dependencies: List of base image dependencies for a step. + :vartype base_image_dependencies: + list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: Required. The task template/definition file path + relative to the source context. + :type task_file_path: str + :param values_file_path: The task values/parameters file path relative to + the source context. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + """ + + _validation = { + 'base_image_dependencies': {'readonly': True}, + 'type': {'required': True}, + 'task_file_path': {'required': True}, + } + + _attribute_map = { + 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, task_file_path: str, context_path: str=None, context_access_token: str=None, values_file_path: str=None, values=None, **kwargs) -> None: + super(FileTaskStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + self.task_file_path = task_file_path + self.values_file_path = values_file_path + self.values = values + self.type = 'FileTask' + + +class FileTaskStepUpdateParameters(TaskStepUpdateParameters): + """The properties of updating a task step. + + All required parameters must be populated in order to send to Azure. + + :param context_path: The URL(absolute or relative) of the source context + for the task step. + :type context_path: str + :param context_access_token: The token (git PAT or SAS token of storage + account blob) associated with the context for a step. + :type context_access_token: str + :param type: Required. Constant filled by server. + :type type: str + :param task_file_path: The task template/definition file path relative to + the source context. + :type task_file_path: str + :param values_file_path: The values/parameters file path relative to the + source context. + :type values_file_path: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'context_path': {'key': 'contextPath', 'type': 'str'}, + 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, + 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, context_path: str=None, context_access_token: str=None, task_file_path: str=None, values_file_path: str=None, values=None, **kwargs) -> None: + super(FileTaskStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) + self.task_file_path = task_file_path + self.values_file_path = values_file_path + self.values = values + self.type = 'FileTask' + + +class IdentityProperties(Model): + """Managed identity for the resource. + + :param principal_id: The principal ID of resource identity. + :type principal_id: str + :param tenant_id: The tenant ID of resource. + :type tenant_id: str + :param type: The identity type. Possible values include: 'SystemAssigned', + 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + :type type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated + with the resource. The user identity + dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.containerregistry.v2019_05_01.models.UserIdentityProperties] + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentityProperties}'}, + } + + def __init__(self, *, principal_id: str=None, tenant_id: str=None, type=None, user_assigned_identities=None, **kwargs) -> None: + super(IdentityProperties, self).__init__(**kwargs) + self.principal_id = principal_id + self.tenant_id = tenant_id + self.type = type + self.user_assigned_identities = user_assigned_identities + + +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 + + +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.v2019_05_01.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 + + +class ImportImageParameters(Model): + """ImportImageParameters. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the image. + :type source: + ~azure.mgmt.containerregistry.v2019_05_01.models.ImportSource + :param target_tags: List of strings of the form repo[:tag]. When tag is + omitted the source will be used (or 'latest' if source tag is also + omitted). + :type target_tags: list[str] + :param untagged_target_repositories: List of strings of repository names + to do a manifest only copy. No tag will be created. + :type untagged_target_repositories: list[str] + :param mode: When Force, any existing target tags will be overwritten. + When NoForce, any existing target tags will fail the operation before any + copying begins. Possible values include: 'NoForce', 'Force'. Default + value: "NoForce" . + :type mode: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.ImportMode + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ImportSource'}, + 'target_tags': {'key': 'targetTags', 'type': '[str]'}, + 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, *, source, target_tags=None, untagged_target_repositories=None, mode="NoForce", **kwargs) -> None: + super(ImportImageParameters, self).__init__(**kwargs) + self.source = source + self.target_tags = target_tags + self.untagged_target_repositories = untagged_target_repositories + self.mode = mode + + +class ImportSource(Model): + """ImportSource. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: The resource identifier of the source Azure Container + Registry. + :type resource_id: str + :param registry_uri: The address of the source registry (e.g. + 'mcr.microsoft.com'). + :type registry_uri: str + :param credentials: Credentials used when importing from a registry uri. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01.models.ImportSourceCredentials + :param source_image: Required. Repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' + tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest + ('hello-world@sha256:abc123'). + :type source_image: str + """ + + _validation = { + 'source_image': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'registry_uri': {'key': 'registryUri', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, + 'source_image': {'key': 'sourceImage', 'type': 'str'}, + } + + def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None: + super(ImportSource, self).__init__(**kwargs) + self.resource_id = resource_id + self.registry_uri = registry_uri + self.credentials = credentials + self.source_image = source_image + + +class ImportSourceCredentials(Model): + """ImportSourceCredentials. + + All required parameters must be populated in order to send to Azure. + + :param username: The username to authenticate with the source registry. + :type username: str + :param password: Required. The password used to authenticate with the + source registry. + :type password: str + """ + + _validation = { + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, password: str, username: str=None, **kwargs) -> None: + super(ImportSourceCredentials, self).__init__(**kwargs) + self.username = username + self.password = password + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.Action + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.action = action + self.ip_address_or_range = ip_address_or_range + + +class NetworkRuleSet(Model): + """The network rule set for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Required. The default action of allow or deny when + no other rules match. Possible values include: 'Allow', 'Deny'. Default + value: "Allow" . + :type default_action: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.DefaultAction + :param virtual_network_rules: The virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.containerregistry.v2019_05_01.models.VirtualNetworkRule] + :param ip_rules: The IP ACL rules. + :type ip_rules: + list[~azure.mgmt.containerregistry.v2019_05_01.models.IPRule] + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + } + + def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = default_action + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param origin: The origin information of the container registry operation. + :type origin: str + :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.v2019_05_01.models.OperationDisplayDefinition + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2019_05_01.models.OperationServiceSpecificationDefinition + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, + } + + def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.origin = origin + self.name = name + self.display = display + self.service_specification = service_specification + + +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 + + +class OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.internal_metric_name = internal_metric_name + + +class OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2019_05_01.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class PlatformProperties(Model): + """The platform properties against which the run has to happen. + + All required parameters must be populated in order to send to Azure. + + :param os: Required. The operating system type required for the run. + Possible values include: 'Windows', 'Linux' + :type os: str or ~azure.mgmt.containerregistry.v2019_05_01.models.OS + :param architecture: The OS architecture. Possible values include: + 'amd64', 'x86', 'arm' + :type architecture: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.Architecture + :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', + 'v8' + :type variant: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.Variant + """ + + _validation = { + 'os': {'required': True}, + } + + _attribute_map = { + 'os': {'key': 'os', 'type': 'str'}, + 'architecture': {'key': 'architecture', 'type': 'str'}, + 'variant': {'key': 'variant', 'type': 'str'}, + } + + def __init__(self, *, os, architecture=None, variant=None, **kwargs) -> None: + super(PlatformProperties, self).__init__(**kwargs) + self.os = os + self.architecture = architecture + self.variant = variant + + +class PlatformUpdateParameters(Model): + """The properties for updating the platform configuration. + + :param os: The operating system type required for the run. Possible values + include: 'Windows', 'Linux' + :type os: str or ~azure.mgmt.containerregistry.v2019_05_01.models.OS + :param architecture: The OS architecture. Possible values include: + 'amd64', 'x86', 'arm' + :type architecture: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.Architecture + :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', + 'v8' + :type variant: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.Variant + """ + + _attribute_map = { + 'os': {'key': 'os', 'type': 'str'}, + 'architecture': {'key': 'architecture', 'type': 'str'}, + 'variant': {'key': 'variant', 'type': 'str'}, + } + + def __init__(self, *, os=None, architecture=None, variant=None, **kwargs) -> None: + super(PlatformUpdateParameters, self).__init__(**kwargs) + self.os = os + self.architecture = architecture + self.variant = variant + + +class Policies(Model): + """The policies for a container registry. + + :param quarantine_policy: The quarantine policy for a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2019_05_01.models.QuarantinePolicy + :param trust_policy: The content trust policy for a container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2019_05_01.models.TrustPolicy + :param retention_policy: The retention policy for a container registry. + :type retention_policy: + ~azure.mgmt.containerregistry.v2019_05_01.models.RetentionPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__(self, *, quarantine_policy=None, trust_policy=None, retention_policy=None, **kwargs) -> None: + super(Policies, self).__init__(**kwargs) + self.quarantine_policy = quarantine_policy + self.trust_policy = trust_policy + self.retention_policy = retention_policy + + +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 + + +class QuarantinePolicy(Model): + """The quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status=None, **kwargs) -> None: + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = status + + +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.v2019_05_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 + + +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 + + +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.v2019_05_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.v2019_05_01.models.ProvisioningState + :ivar status: The status of the container registry at the time the + operation was called. + :vartype status: ~azure.mgmt.containerregistry.v2019_05_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.v2019_05_01.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2019_05_01.models.NetworkRuleSet + :param policies: The policies for a container registry. + :type policies: ~azure.mgmt.containerregistry.v2019_05_01.models.Policies + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + 'policies': {'key': 'properties.policies', 'type': 'Policies'}, + } + + def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=None, policies=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 + self.network_rule_set = network_rule_set + self.policies = policies + + +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.v2019_05_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 + + +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 + + +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 + + +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.v2019_05_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 + + +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.v2019_05_01.models.Sku + :param admin_user_enabled: The value that indicates whether the admin user + is enabled. + :type admin_user_enabled: bool + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2019_05_01.models.NetworkRuleSet + :param policies: The policies for a container registry. + :type policies: ~azure.mgmt.containerregistry.v2019_05_01.models.Policies + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + 'policies': {'key': 'properties.policies', 'type': 'Policies'}, + } + + def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, network_rule_set=None, policies=None, **kwargs) -> None: + super(RegistryUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.sku = sku + self.admin_user_enabled = admin_user_enabled + self.network_rule_set = network_rule_set + self.policies = policies + + +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.v2019_05_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 + + +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.v2019_05_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 + + +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.v2019_05_01.models.ProvisioningState + :ivar status: The status of the replication at the time the operation was + called. + :vartype status: ~azure.mgmt.containerregistry.v2019_05_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 + + +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 + + +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 + + +class RetentionPolicy(Model): + """The retention policy for a container registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param days: The number of days to retain manifest before it expires. + :type days: int + :ivar last_updated_time: The timestamp when the policy was last updated. + :vartype last_updated_time: datetime + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus + """ + + _validation = { + 'last_updated_time': {'readonly': True}, + } + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, days: int=None, status=None, **kwargs) -> None: + super(RetentionPolicy, self).__init__(**kwargs) + self.days = days + self.last_updated_time = None + self.status = status + + +class Run(ProxyResource): + """Run 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 run_id: The unique identifier for the run. + :type run_id: str + :param status: The current status of the run. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.RunStatus + :param last_updated_time: The last updated time for the run. + :type last_updated_time: datetime + :param run_type: The type of run. Possible values include: 'QuickBuild', + 'QuickRun', 'AutoBuild', 'AutoRun' + :type run_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.RunType + :param create_time: The time the run was scheduled. + :type create_time: datetime + :param start_time: The time the run started. + :type start_time: datetime + :param finish_time: The time the run finished. + :type finish_time: datetime + :param output_images: The list of all images that were generated from the + run. This is applicable if the run generates base image dependencies. + :type output_images: + list[~azure.mgmt.containerregistry.v2019_05_01.models.ImageDescriptor] + :param task: The task against which run was scheduled. + :type task: str + :param image_update_trigger: The image update trigger that caused the run. + This is applicable if the task has base image trigger configured. + :type image_update_trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.ImageUpdateTrigger + :param source_trigger: The source trigger that caused the run. + :type source_trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerDescriptor + :param platform: The platform properties against which the run will + happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties + :param source_registry_auth: The scope of the credentials that were used + to login to the source registry during this run. + :type source_registry_auth: str + :param custom_registries: The list of custom registries that were logged + in during this run. + :type custom_registries: list[str] + :ivar run_error_message: The error message received from backend systems + after the run is scheduled. + :vartype run_error_message: str + :param provisioning_state: The provisioning state of a run. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :type provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.ProvisioningState + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. Default value: False . + :type is_archive_enabled: bool + :param timer_trigger: The timer trigger that caused the run. + :type timer_trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.TimerTriggerDescriptor + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'run_error_message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'run_id': {'key': 'properties.runId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'run_type': {'key': 'properties.runType', '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]'}, + 'task': {'key': 'properties.task', 'type': 'str'}, + 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, + 'source_trigger': {'key': 'properties.sourceTrigger', 'type': 'SourceTriggerDescriptor'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'source_registry_auth': {'key': 'properties.sourceRegistryAuth', 'type': 'str'}, + 'custom_registries': {'key': 'properties.customRegistries', 'type': '[str]'}, + 'run_error_message': {'key': 'properties.runErrorMessage', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, + 'timer_trigger': {'key': 'properties.timerTrigger', 'type': 'TimerTriggerDescriptor'}, + } + + def __init__(self, *, run_id: str=None, status=None, last_updated_time=None, run_type=None, create_time=None, start_time=None, finish_time=None, output_images=None, task: str=None, image_update_trigger=None, source_trigger=None, platform=None, agent_configuration=None, source_registry_auth: str=None, custom_registries=None, provisioning_state=None, is_archive_enabled: bool=False, timer_trigger=None, **kwargs) -> None: + super(Run, self).__init__(**kwargs) + self.run_id = run_id + self.status = status + self.last_updated_time = last_updated_time + self.run_type = run_type + self.create_time = create_time + self.start_time = start_time + self.finish_time = finish_time + self.output_images = output_images + self.task = task + self.image_update_trigger = image_update_trigger + self.source_trigger = source_trigger + self.platform = platform + self.agent_configuration = agent_configuration + self.source_registry_auth = source_registry_auth + self.custom_registries = custom_registries + self.run_error_message = None + self.provisioning_state = provisioning_state + self.is_archive_enabled = is_archive_enabled + self.timer_trigger = timer_trigger + + +class RunFilter(Model): + """Properties that are enabled for Odata querying on runs. + + :param run_id: The unique identifier for the run. + :type run_id: str + :param run_type: The type of run. Possible values include: 'QuickBuild', + 'QuickRun', 'AutoBuild', 'AutoRun' + :type run_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.RunType + :param status: The current status of the run. Possible values include: + 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + 'Error', 'Timeout' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.RunStatus + :param create_time: The create time for a run. + :type create_time: datetime + :param finish_time: The time the run finished. + :type finish_time: datetime + :param output_image_manifests: The list of comma-separated image manifests + that were generated from the run. This is applicable if the run is of + build type. + :type output_image_manifests: str + :param is_archive_enabled: The value that indicates whether archiving is + enabled or not. + :type is_archive_enabled: bool + :param task_name: The name of the task that the run corresponds to. + :type task_name: str + """ + + _attribute_map = { + 'run_id': {'key': 'runId', 'type': 'str'}, + 'run_type': {'key': 'runType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, + 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + } + + def __init__(self, *, run_id: str=None, run_type=None, status=None, create_time=None, finish_time=None, output_image_manifests: str=None, is_archive_enabled: bool=None, task_name: str=None, **kwargs) -> None: + super(RunFilter, self).__init__(**kwargs) + self.run_id = run_id + self.run_type = run_type + self.status = status + self.create_time = create_time + self.finish_time = finish_time + self.output_image_manifests = output_image_manifests + self.is_archive_enabled = is_archive_enabled + self.task_name = task_name + + +class RunGetLogResult(Model): + """The result of get log link operation. + + :param log_link: The link to logs for a run on a azure container registry. + :type log_link: str + """ + + _attribute_map = { + 'log_link': {'key': 'logLink', 'type': 'str'}, + } + + def __init__(self, *, log_link: str=None, **kwargs) -> None: + super(RunGetLogResult, self).__init__(**kwargs) + self.log_link = log_link + + +class RunUpdateParameters(Model): + """The set of run 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(RunUpdateParameters, self).__init__(**kwargs) + self.is_archive_enabled = is_archive_enabled + + +class SecretObject(Model): + """Describes the properties of a secret object value. + + :param value: The value of the secret. The format of this value will be + determined + based on the type of the secret object. If the type is Opaque, the value + will be + used as is without any modification. + :type value: str + :param type: The type of the secret object which determines how the value + of the secret object has to be + interpreted. Possible values include: 'Opaque', 'Vaultsecret' + :type type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.SecretObjectType + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, type=None, **kwargs) -> None: + super(SecretObject, self).__init__(**kwargs) + self.value = value + self.type = type + + +class SetValue(Model): + """The properties of a overridable value that can be passed to a task + template. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the overridable value. + :type name: str + :param value: Required. The overridable value. + :type value: str + :param is_secret: Flag to indicate whether the value represents a secret + or not. Default value: False . + :type is_secret: bool + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'is_secret': {'key': 'isSecret', 'type': 'bool'}, + } + + def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: + super(SetValue, self).__init__(**kwargs) + self.name = name + self.value = value + self.is_secret = is_secret + + +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.v2019_05_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.v2019_05_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 + + +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 + + +class SourceProperties(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.v2019_05_01.models.SourceControlType + :param repository_url: Required. The full URL to the source code + repository + :type repository_url: str + :param branch: The branch name of the source code. + :type branch: str + :param source_control_auth_properties: The authorization properties for + accessing the source code repository and to set up + webhooks for notifications. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2019_05_01.models.AuthInfo + """ + + _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'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfo'}, + } + + def __init__(self, *, source_control_type, repository_url: str, branch: str=None, source_control_auth_properties=None, **kwargs) -> None: + super(SourceProperties, self).__init__(**kwargs) + self.source_control_type = source_control_type + self.repository_url = repository_url + self.branch = branch + self.source_control_auth_properties = source_control_auth_properties + + +class SourceRegistryCredentials(Model): + """Describes the credential parameters for accessing the source registry. + + :param login_mode: The authentication mode which determines the source + registry login scope. The credentials for the source registry + will be generated using the given scope. These credentials will be used to + login to + the source registry during the run. Possible values include: 'None', + 'Default' + :type login_mode: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceRegistryLoginMode + """ + + _attribute_map = { + 'login_mode': {'key': 'loginMode', 'type': 'str'}, + } + + def __init__(self, *, login_mode=None, **kwargs) -> None: + super(SourceRegistryCredentials, self).__init__(**kwargs) + self.login_mode = login_mode + + +class SourceTrigger(Model): + """The properties of a source based trigger. + + All required parameters must be populated in order to send to Azure. + + :param source_repository: Required. The properties that describes the + source(code) for the task. + :type source_repository: + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceProperties + :param source_trigger_events: Required. The source event corresponding to + the trigger. + :type source_trigger_events: list[str or + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerEvent] + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'source_repository': {'required': True}, + 'source_trigger_events': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'source_repository': {'key': 'sourceRepository', 'type': 'SourceProperties'}, + 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, source_repository, source_trigger_events, name: str, status="Enabled", **kwargs) -> None: + super(SourceTrigger, self).__init__(**kwargs) + self.source_repository = source_repository + self.source_trigger_events = source_trigger_events + self.status = status + self.name = name + + +class SourceTriggerDescriptor(Model): + """The source trigger that caused a run. + + :param id: The unique ID of the trigger. + :type id: str + :param event_type: The event type of the trigger. + :type event_type: str + :param commit_id: The unique ID that identifies a commit. + :type commit_id: str + :param pull_request_id: The unique ID that identifies pull request. + :type pull_request_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'}, + 'event_type': {'key': 'eventType', 'type': 'str'}, + 'commit_id': {'key': 'commitId', 'type': 'str'}, + 'pull_request_id': {'key': 'pullRequestId', '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, event_type: str=None, commit_id: str=None, pull_request_id: str=None, repository_url: str=None, branch_name: str=None, provider_type: str=None, **kwargs) -> None: + super(SourceTriggerDescriptor, self).__init__(**kwargs) + self.id = id + self.event_type = event_type + self.commit_id = commit_id + self.pull_request_id = pull_request_id + self.repository_url = repository_url + self.branch_name = branch_name + self.provider_type = provider_type + + +class SourceTriggerUpdateParameters(Model): + """The properties for updating a source based trigger. + + All required parameters must be populated in order to send to Azure. + + :param source_repository: The properties that describes the source(code) + for the task. + :type source_repository: + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceUpdateParameters + :param source_trigger_events: The source event corresponding to the + trigger. + :type source_trigger_events: list[str or + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerEvent] + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'source_repository': {'key': 'sourceRepository', 'type': 'SourceUpdateParameters'}, + 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, source_repository=None, source_trigger_events=None, status="Enabled", **kwargs) -> None: + super(SourceTriggerUpdateParameters, self).__init__(**kwargs) + self.source_repository = source_repository + self.source_trigger_events = source_trigger_events + self.status = status + self.name = name + + +class SourceUpdateParameters(Model): + """The properties for updating the source code repository. + + :param source_control_type: The type of source control service. Possible + values include: 'Github', 'VisualStudioTeamService' + :type source_control_type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.SourceControlType + :param repository_url: The full URL to the source code repository + :type repository_url: str + :param branch: The branch name of the source code. + :type branch: str + :param source_control_auth_properties: The authorization properties for + accessing the source code repository and to set up + webhooks for notifications. + :type source_control_auth_properties: + ~azure.mgmt.containerregistry.v2019_05_01.models.AuthInfoUpdateParameters + """ + + _attribute_map = { + 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, + 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'branch', 'type': 'str'}, + 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfoUpdateParameters'}, + } + + def __init__(self, *, source_control_type=None, repository_url: str=None, branch: str=None, source_control_auth_properties=None, **kwargs) -> None: + super(SourceUpdateParameters, self).__init__(**kwargs) + self.source_control_type = source_control_type + self.repository_url = repository_url + self.branch = branch + self.source_control_auth_properties = source_control_auth_properties + + +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 + + +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 + + +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 + + +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 + :param name: The name of the artifact. + :type name: str + :param version: The version of the artifact. + :type version: 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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', '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, name: str=None, version: 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 + self.name = name + self.version = version + + +class Task(Resource): + """The task that has the ARM resource and task properties. + The task will have all information to schedule a run 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] + :param identity: Identity for the resource. + :type identity: + ~azure.mgmt.containerregistry.v2019_05_01.models.IdentityProperties + :ivar provisioning_state: The provisioning state of the task. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.ProvisioningState + :ivar creation_date: The creation date of task. + :vartype creation_date: datetime + :param status: The current status of task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStatus + :param platform: Required. The platform properties against which the run + has to happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties + :param timeout: Run timeout in seconds. Default value: 3600 . + :type timeout: int + :param step: Required. The properties of a task step. + :type step: + ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStepProperties + :param trigger: The properties that describe all triggers for the task. + :type trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerProperties + :param credentials: The properties that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'platform': {'required': True}, + 'timeout': {'maximum': 28800, 'minimum': 300}, + 'step': {'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}'}, + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, + 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, + 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, + } + + def __init__(self, *, location: str, platform, step, tags=None, identity=None, status=None, agent_configuration=None, timeout: int=3600, trigger=None, credentials=None, **kwargs) -> None: + super(Task, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity + self.provisioning_state = None + self.creation_date = None + self.status = status + self.platform = platform + self.agent_configuration = agent_configuration + self.timeout = timeout + self.step = step + self.trigger = trigger + self.credentials = credentials + + +class TaskRunRequest(RunRequest): + """The parameters for a task run request. + + All required parameters must be populated in order to send to Azure. + + :param is_archive_enabled: The value that indicates whether archiving is + enabled for the run or not. Default value: False . + :type is_archive_enabled: bool + :param type: Required. Constant filled by server. + :type type: str + :param task_name: Required. The name of task against which run has to be + queued. + :type task_name: str + :param values: The collection of overridable values that can be passed + when running a task. + :type values: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] + """ + + _validation = { + 'type': {'required': True}, + 'task_name': {'required': True}, + } + + _attribute_map = { + 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[SetValue]'}, + } + + def __init__(self, *, task_name: str, is_archive_enabled: bool=False, values=None, **kwargs) -> None: + super(TaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) + self.task_name = task_name + self.values = values + self.type = 'TaskRunRequest' + + +class TaskUpdateParameters(Model): + """The parameters for updating a task. + + :param identity: Identity for the resource. + :type identity: + ~azure.mgmt.containerregistry.v2019_05_01.models.IdentityProperties + :param status: The current status of task. Possible values include: + 'Disabled', 'Enabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStatus + :param platform: The platform properties against which the run has to + happen. + :type platform: + ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformUpdateParameters + :param agent_configuration: The machine configuration of the run agent. + :type agent_configuration: + ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties + :param timeout: Run timeout in seconds. + :type timeout: int + :param step: The properties for updating a task step. + :type step: + ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStepUpdateParameters + :param trigger: The properties for updating trigger properties. + :type trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerUpdateParameters + :param credentials: The parameters that describes a set of credentials + that will be used when this run is invoked. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, + 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, + 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, + 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, identity=None, status=None, platform=None, agent_configuration=None, timeout: int=None, step=None, trigger=None, credentials=None, tags=None, **kwargs) -> None: + super(TaskUpdateParameters, self).__init__(**kwargs) + self.identity = identity + self.status = status + self.platform = platform + self.agent_configuration = agent_configuration + self.timeout = timeout + self.step = step + self.trigger = trigger + self.credentials = credentials + self.tags = tags + + +class TimerTrigger(Model): + """The properties of a timer trigger. + + All required parameters must be populated in order to send to Azure. + + :param schedule: Required. The CRON expression for the task schedule + :type schedule: str + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'schedule': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, schedule: str, name: str, status="Enabled", **kwargs) -> None: + super(TimerTrigger, self).__init__(**kwargs) + self.schedule = schedule + self.status = status + self.name = name + + +class TimerTriggerDescriptor(Model): + """TimerTriggerDescriptor. + + :param timer_trigger_name: The timer trigger name that caused the run. + :type timer_trigger_name: str + :param schedule_occurrence: The occurrence that triggered the run. + :type schedule_occurrence: str + """ + + _attribute_map = { + 'timer_trigger_name': {'key': 'timerTriggerName', 'type': 'str'}, + 'schedule_occurrence': {'key': 'scheduleOccurrence', 'type': 'str'}, + } + + def __init__(self, *, timer_trigger_name: str=None, schedule_occurrence: str=None, **kwargs) -> None: + super(TimerTriggerDescriptor, self).__init__(**kwargs) + self.timer_trigger_name = timer_trigger_name + self.schedule_occurrence = schedule_occurrence + + +class TimerTriggerUpdateParameters(Model): + """The properties for updating a timer trigger. + + All required parameters must be populated in order to send to Azure. + + :param schedule: The CRON expression for the task schedule + :type schedule: str + :param status: The current status of trigger. Possible values include: + 'Disabled', 'Enabled'. Default value: "Enabled" . + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus + :param name: Required. The name of the trigger. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, schedule: str=None, status="Enabled", **kwargs) -> None: + super(TimerTriggerUpdateParameters, self).__init__(**kwargs) + self.schedule = schedule + self.status = status + self.name = name + + +class TriggerProperties(Model): + """The properties of a trigger. + + :param timer_triggers: The collection of timer triggers. + :type timer_triggers: + list[~azure.mgmt.containerregistry.v2019_05_01.models.TimerTrigger] + :param source_triggers: The collection of triggers based on source code + repository. + :type source_triggers: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SourceTrigger] + :param base_image_trigger: The trigger based on base image dependencies. + :type base_image_trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTrigger + """ + + _attribute_map = { + 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTrigger]'}, + 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTrigger]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTrigger'}, + } + + def __init__(self, *, timer_triggers=None, source_triggers=None, base_image_trigger=None, **kwargs) -> None: + super(TriggerProperties, self).__init__(**kwargs) + self.timer_triggers = timer_triggers + self.source_triggers = source_triggers + self.base_image_trigger = base_image_trigger + + +class TriggerUpdateParameters(Model): + """The properties for updating triggers. + + :param timer_triggers: The collection of timer triggers. + :type timer_triggers: + list[~azure.mgmt.containerregistry.v2019_05_01.models.TimerTriggerUpdateParameters] + :param source_triggers: The collection of triggers based on source code + repository. + :type source_triggers: + list[~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerUpdateParameters] + :param base_image_trigger: The trigger based on base image dependencies. + :type base_image_trigger: + ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTriggerUpdateParameters + """ + + _attribute_map = { + 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTriggerUpdateParameters]'}, + 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTriggerUpdateParameters]'}, + 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTriggerUpdateParameters'}, + } + + def __init__(self, *, timer_triggers=None, source_triggers=None, base_image_trigger=None, **kwargs) -> None: + super(TriggerUpdateParameters, self).__init__(**kwargs) + self.timer_triggers = timer_triggers + self.source_triggers = source_triggers + self.base_image_trigger = base_image_trigger + + +class TrustPolicy(Model): + """The content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, type=None, status=None, **kwargs) -> None: + super(TrustPolicy, self).__init__(**kwargs) + self.type = type + self.status = status + + +class UserIdentityProperties(Model): + """UserIdentityProperties. + + :param principal_id: The principal id of user assigned identity. + :type principal_id: str + :param client_id: The client id of user assigned identity. + :type client_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, client_id: str=None, **kwargs) -> None: + super(UserIdentityProperties, self).__init__(**kwargs) + self.principal_id = principal_id + self.client_id = client_id + + +class VirtualNetworkRule(Model): + """Virtual network rule. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2019_05_01.models.Action + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.action = action + self.virtual_network_resource_id = virtual_network_resource_id + + +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.v2019_05_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.v2019_05_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.v2019_05_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 + + +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.v2019_05_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.v2019_05_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 + + +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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/_paged_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/_paged_models.py new file mode 100644 index 000000000000..908f8e6fb090 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/_paged_models.py @@ -0,0 +1,105 @@ +# 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) +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) +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) +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) +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) +class RunPaged(Paged): + """ + A paging container for iterating over a list of :class:`Run ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Run]'} + } + + def __init__(self, *args, **kwargs): + + super(RunPaged, self).__init__(*args, **kwargs) +class TaskPaged(Paged): + """ + A paging container for iterating over a list of :class:`Task ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Task]'} + } + + def __init__(self, *args, **kwargs): + + super(TaskPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/actor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/actor.py deleted file mode 100644 index a662f9008a31..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/actor.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/actor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/actor_py3.py deleted file mode 100644 index fdd8b96dda52..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/actor_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/agent_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/agent_properties.py deleted file mode 100644 index c002042a921b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/agent_properties.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 AgentProperties(Model): - """The properties that determine the run agent configuration. - - :param cpu: The CPU configuration in terms of number of cores required for - the run. - :type cpu: int - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(AgentProperties, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/agent_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/agent_properties_py3.py deleted file mode 100644 index 055a36946db8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/agent_properties_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 AgentProperties(Model): - """The properties that determine the run agent configuration. - - :param cpu: The CPU configuration in terms of number of cores required for - the run. - :type cpu: int - """ - - _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'int'}, - } - - def __init__(self, *, cpu: int=None, **kwargs) -> None: - super(AgentProperties, self).__init__(**kwargs) - self.cpu = cpu diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/argument.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/argument.py deleted file mode 100644 index d081a86245b0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/argument.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 Argument(Model): - """The properties of a run argument. - - All required parameters must be populated in order to send to Azure. - - :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 = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(Argument, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/argument_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/argument_py3.py deleted file mode 100644 index 1f520368d006..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/argument_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 Argument(Model): - """The properties of a run argument. - - All required parameters must be populated in order to send to Azure. - - :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 = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - } - - def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: - super(Argument, self).__init__(**kwargs) - self.name = name - self.value = value - self.is_secret = is_secret diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/auth_info.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/auth_info.py deleted file mode 100644 index 2379a0642d17..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/auth_info.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 AuthInfo(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: Required. The type of Auth token. Possible values - include: 'PAT', 'OAuth' - :type token_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.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_type': {'required': True}, - '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(AuthInfo, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/auth_info_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/auth_info_py3.py deleted file mode 100644 index 776fd2847a2d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/auth_info_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 AuthInfo(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: Required. The type of Auth token. Possible values - include: 'PAT', 'OAuth' - :type token_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.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_type': {'required': True}, - '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_type, token: str, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: - super(AuthInfo, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/auth_info_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/auth_info_update_parameters.py deleted file mode 100644 index 6aee1032fca5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/auth_info_update_parameters.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 AuthInfoUpdateParameters(Model): - """The authorization properties for accessing the source code repository. - - :param token_type: The type of Auth token. Possible values include: 'PAT', - 'OAuth' - :type token_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TokenType - :param token: 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 - """ - - _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(AuthInfoUpdateParameters, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/auth_info_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/auth_info_update_parameters_py3.py deleted file mode 100644 index 2a22aff350b4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/auth_info_update_parameters_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 AuthInfoUpdateParameters(Model): - """The authorization properties for accessing the source code repository. - - :param token_type: The type of Auth token. Possible values include: 'PAT', - 'OAuth' - :type token_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TokenType - :param token: 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 - """ - - _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_type=None, token: str=None, refresh_token: str=None, scope: str=None, expires_in: int=None, **kwargs) -> None: - super(AuthInfoUpdateParameters, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_dependency.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_dependency.py deleted file mode 100644 index 8a8b2d92dad2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_dependency.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.v2019_05_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_dependency_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_dependency_py3.py deleted file mode 100644 index d8f48f382bc1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_dependency_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.v2019_05_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_trigger.py deleted file mode 100644 index 48a63cf3ddde..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_trigger.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 BaseImageTrigger(Model): - """The trigger based on base image dependency. - - All required parameters must be populated in order to send to Azure. - - :param base_image_trigger_type: Required. The type of the auto trigger for - base image dependency updates. Possible values include: 'All', 'Runtime' - :type base_image_trigger_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTriggerType - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'base_image_trigger_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(BaseImageTrigger, self).__init__(**kwargs) - self.base_image_trigger_type = kwargs.get('base_image_trigger_type', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_trigger_py3.py deleted file mode 100644 index 47f0b26ff844..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_trigger_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 BaseImageTrigger(Model): - """The trigger based on base image dependency. - - All required parameters must be populated in order to send to Azure. - - :param base_image_trigger_type: Required. The type of the auto trigger for - base image dependency updates. Possible values include: 'All', 'Runtime' - :type base_image_trigger_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTriggerType - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'base_image_trigger_type': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, base_image_trigger_type, name: str, status="Enabled", **kwargs) -> None: - super(BaseImageTrigger, self).__init__(**kwargs) - self.base_image_trigger_type = base_image_trigger_type - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_trigger_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_trigger_update_parameters.py deleted file mode 100644 index 24e982485575..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_trigger_update_parameters.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 BaseImageTriggerUpdateParameters(Model): - """The properties for updating base image dependency trigger. - - All required parameters must be populated in order to send to Azure. - - :param base_image_trigger_type: The type of the auto trigger for base - image dependency updates. Possible values include: 'All', 'Runtime' - :type base_image_trigger_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTriggerType - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(BaseImageTriggerUpdateParameters, self).__init__(**kwargs) - self.base_image_trigger_type = kwargs.get('base_image_trigger_type', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_trigger_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_trigger_update_parameters_py3.py deleted file mode 100644 index 6277bdc19d29..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/base_image_trigger_update_parameters_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 BaseImageTriggerUpdateParameters(Model): - """The properties for updating base image dependency trigger. - - All required parameters must be populated in order to send to Azure. - - :param base_image_trigger_type: The type of the auto trigger for base - image dependency updates. Possible values include: 'All', 'Runtime' - :type base_image_trigger_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTriggerType - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'base_image_trigger_type': {'key': 'baseImageTriggerType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str, base_image_trigger_type=None, status="Enabled", **kwargs) -> None: - super(BaseImageTriggerUpdateParameters, self).__init__(**kwargs) - self.base_image_trigger_type = base_image_trigger_type - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/callback_config.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/callback_config.py deleted file mode 100644 index 8ad43a9f785a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/callback_config.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/callback_config_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/callback_config_py3.py deleted file mode 100644 index 27ffc7825431..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/callback_config_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/credentials.py deleted file mode 100644 index cd4be95e6f2b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/credentials.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 Credentials(Model): - """The parameters that describes a set of credentials that will be used when a - run is invoked. - - :param source_registry: Describes the credential parameters for accessing - the source registry. - :type source_registry: - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceRegistryCredentials - :param custom_registries: Describes the credential parameters for - accessing other custom registries. The key - for the dictionary item will be the registry login server - (myregistry.azurecr.io) and - the value of the item will be the registry credentials for accessing the - registry. - :type custom_registries: dict[str, - ~azure.mgmt.containerregistry.v2019_05_01.models.CustomRegistryCredentials] - """ - - _attribute_map = { - 'source_registry': {'key': 'sourceRegistry', 'type': 'SourceRegistryCredentials'}, - 'custom_registries': {'key': 'customRegistries', 'type': '{CustomRegistryCredentials}'}, - } - - def __init__(self, **kwargs): - super(Credentials, self).__init__(**kwargs) - self.source_registry = kwargs.get('source_registry', None) - self.custom_registries = kwargs.get('custom_registries', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/credentials_py3.py deleted file mode 100644 index 6e63db72101b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/credentials_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 Credentials(Model): - """The parameters that describes a set of credentials that will be used when a - run is invoked. - - :param source_registry: Describes the credential parameters for accessing - the source registry. - :type source_registry: - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceRegistryCredentials - :param custom_registries: Describes the credential parameters for - accessing other custom registries. The key - for the dictionary item will be the registry login server - (myregistry.azurecr.io) and - the value of the item will be the registry credentials for accessing the - registry. - :type custom_registries: dict[str, - ~azure.mgmt.containerregistry.v2019_05_01.models.CustomRegistryCredentials] - """ - - _attribute_map = { - 'source_registry': {'key': 'sourceRegistry', 'type': 'SourceRegistryCredentials'}, - 'custom_registries': {'key': 'customRegistries', 'type': '{CustomRegistryCredentials}'}, - } - - def __init__(self, *, source_registry=None, custom_registries=None, **kwargs) -> None: - super(Credentials, self).__init__(**kwargs) - self.source_registry = source_registry - self.custom_registries = custom_registries diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/custom_registry_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/custom_registry_credentials.py deleted file mode 100644 index 3ad1acad8b88..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/custom_registry_credentials.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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 CustomRegistryCredentials(Model): - """Describes the credentials that will be used to access a custom registry - during a run. - - :param user_name: The username for logging into the custom registry. - :type user_name: - ~azure.mgmt.containerregistry.v2019_05_01.models.SecretObject - :param password: The password for logging into the custom registry. The - password is a secret - object that allows multiple ways of providing the value for it. - :type password: - ~azure.mgmt.containerregistry.v2019_05_01.models.SecretObject - :param identity: Indicates the managed identity assigned to the custom - credential. If a user-assigned identity - this value is the Client ID. If a system-assigned identity, the value will - be `system`. In - the case of a system-assigned identity, the Client ID will be determined - by the runner. This - identity may be used to authenticate to key vault to retrieve credentials - or it may be the only - source of authentication used for accessing the registry. - :type identity: str - """ - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'SecretObject'}, - 'password': {'key': 'password', 'type': 'SecretObject'}, - 'identity': {'key': 'identity', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CustomRegistryCredentials, self).__init__(**kwargs) - self.user_name = kwargs.get('user_name', None) - self.password = kwargs.get('password', None) - self.identity = kwargs.get('identity', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/custom_registry_credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/custom_registry_credentials_py3.py deleted file mode 100644 index 8f77c94f542d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/custom_registry_credentials_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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 CustomRegistryCredentials(Model): - """Describes the credentials that will be used to access a custom registry - during a run. - - :param user_name: The username for logging into the custom registry. - :type user_name: - ~azure.mgmt.containerregistry.v2019_05_01.models.SecretObject - :param password: The password for logging into the custom registry. The - password is a secret - object that allows multiple ways of providing the value for it. - :type password: - ~azure.mgmt.containerregistry.v2019_05_01.models.SecretObject - :param identity: Indicates the managed identity assigned to the custom - credential. If a user-assigned identity - this value is the Client ID. If a system-assigned identity, the value will - be `system`. In - the case of a system-assigned identity, the Client ID will be determined - by the runner. This - identity may be used to authenticate to key vault to retrieve credentials - or it may be the only - source of authentication used for accessing the registry. - :type identity: str - """ - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'SecretObject'}, - 'password': {'key': 'password', 'type': 'SecretObject'}, - 'identity': {'key': 'identity', 'type': 'str'}, - } - - def __init__(self, *, user_name=None, password=None, identity: str=None, **kwargs) -> None: - super(CustomRegistryCredentials, self).__init__(**kwargs) - self.user_name = user_name - self.password = password - self.identity = identity diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_request.py deleted file mode 100644 index 16e5bfc004f4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_request.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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 .run_request import RunRequest - - -class DockerBuildRequest(RunRequest): - """The parameters for a docker quick build. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :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 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: Required. The Docker file path relative to the - source location. - :type docker_file_path: str - :param target: The name of the target build stage for the docker build. - :type target: str - :param arguments: The collection of override arguments to be used when - executing the run. - :type arguments: - list[~azure.mgmt.containerregistry.v2019_05_01.models.Argument] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'docker_file_path': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', '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'}, - 'target': {'key': 'target', 'type': 'str'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, **kwargs): - super(DockerBuildRequest, self).__init__(**kwargs) - 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.target = kwargs.get('target', None) - self.arguments = kwargs.get('arguments', None) - self.timeout = kwargs.get('timeout', 3600) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.source_location = kwargs.get('source_location', None) - self.credentials = kwargs.get('credentials', None) - self.type = 'DockerBuildRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_request_py3.py deleted file mode 100644 index 0752d24fbe3e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_request_py3.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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 .run_request_py3 import RunRequest - - -class DockerBuildRequest(RunRequest): - """The parameters for a docker quick build. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :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 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: Required. The Docker file path relative to the - source location. - :type docker_file_path: str - :param target: The name of the target build stage for the docker build. - :type target: str - :param arguments: The collection of override arguments to be used when - executing the run. - :type arguments: - list[~azure.mgmt.containerregistry.v2019_05_01.models.Argument] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'docker_file_path': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', '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'}, - 'target': {'key': 'target', 'type': 'str'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, *, docker_file_path: str, platform, is_archive_enabled: bool=False, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(DockerBuildRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) - 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.target = target - self.arguments = arguments - self.timeout = timeout - self.platform = platform - self.agent_configuration = agent_configuration - self.source_location = source_location - self.credentials = credentials - self.type = 'DockerBuildRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_step.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_step.py deleted file mode 100644 index 58c2361f9352..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_step.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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 .task_step_properties import TaskStepProperties - - -class DockerBuildStep(TaskStepProperties): - """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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :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 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: Required. The Docker file path relative to the - source context. - :type docker_file_path: str - :param target: The name of the target build stage for the docker build. - :type target: str - :param arguments: The collection of override arguments to be used when - executing this build step. - :type arguments: - list[~azure.mgmt.containerregistry.v2019_05_01.models.Argument] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'docker_file_path': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', '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'}, - 'target': {'key': 'target', 'type': 'str'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - } - - def __init__(self, **kwargs): - super(DockerBuildStep, self).__init__(**kwargs) - 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.target = kwargs.get('target', None) - self.arguments = kwargs.get('arguments', None) - self.type = 'Docker' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_step_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_step_py3.py deleted file mode 100644 index 6d3e64623541..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_step_py3.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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 .task_step_properties_py3 import TaskStepProperties - - -class DockerBuildStep(TaskStepProperties): - """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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :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 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: Required. The Docker file path relative to the - source context. - :type docker_file_path: str - :param target: The name of the target build stage for the docker build. - :type target: str - :param arguments: The collection of override arguments to be used when - executing this build step. - :type arguments: - list[~azure.mgmt.containerregistry.v2019_05_01.models.Argument] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'docker_file_path': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', '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'}, - 'target': {'key': 'target', 'type': 'str'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - } - - def __init__(self, *, docker_file_path: str, context_path: str=None, context_access_token: str=None, image_names=None, is_push_enabled: bool=True, no_cache: bool=False, target: str=None, arguments=None, **kwargs) -> None: - super(DockerBuildStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - 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.target = target - self.arguments = arguments - self.type = 'Docker' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_step_update_parameters.py deleted file mode 100644 index d8ec578eba7e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_step_update_parameters.py +++ /dev/null @@ -1,72 +0,0 @@ -# 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 .task_step_update_parameters import TaskStepUpdateParameters - - -class DockerBuildStepUpdateParameters(TaskStepUpdateParameters): - """The properties for updating a docker build step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :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 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 - context. - :type docker_file_path: str - :param arguments: The collection of override arguments to be used when - executing this build step. - :type arguments: - list[~azure.mgmt.containerregistry.v2019_05_01.models.Argument] - :param target: The name of the target build stage for the docker build. - :type target: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', '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'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DockerBuildStepUpdateParameters, self).__init__(**kwargs) - 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.arguments = kwargs.get('arguments', None) - self.target = kwargs.get('target', None) - self.type = 'Docker' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_step_update_parameters_py3.py deleted file mode 100644 index 440720935480..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/docker_build_step_update_parameters_py3.py +++ /dev/null @@ -1,72 +0,0 @@ -# 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 .task_step_update_parameters_py3 import TaskStepUpdateParameters - - -class DockerBuildStepUpdateParameters(TaskStepUpdateParameters): - """The properties for updating a docker build step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :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 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 - context. - :type docker_file_path: str - :param arguments: The collection of override arguments to be used when - executing this build step. - :type arguments: - list[~azure.mgmt.containerregistry.v2019_05_01.models.Argument] - :param target: The name of the target build stage for the docker build. - :type target: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', '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'}, - 'arguments': {'key': 'arguments', 'type': '[Argument]'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, image_names=None, is_push_enabled: bool=None, no_cache: bool=None, docker_file_path: str=None, arguments=None, target: str=None, **kwargs) -> None: - super(DockerBuildStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - 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.arguments = arguments - self.target = target - self.type = 'Docker' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_run_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_run_request.py deleted file mode 100644 index fa8ce234b3b7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_run_request.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 .run_request import RunRequest - - -class EncodedTaskRunRequest(RunRequest): - """The parameters for a quick task run request. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Required. Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'encoded_task_content': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, **kwargs): - super(EncodedTaskRunRequest, self).__init__(**kwargs) - self.encoded_task_content = kwargs.get('encoded_task_content', None) - self.encoded_values_content = kwargs.get('encoded_values_content', None) - self.values = kwargs.get('values', None) - self.timeout = kwargs.get('timeout', 3600) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.source_location = kwargs.get('source_location', None) - self.credentials = kwargs.get('credentials', None) - self.type = 'EncodedTaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_run_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_run_request_py3.py deleted file mode 100644 index 6b200f1a0744..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_run_request_py3.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 .run_request_py3 import RunRequest - - -class EncodedTaskRunRequest(RunRequest): - """The parameters for a quick task run request. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Required. Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'encoded_task_content': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, *, encoded_task_content: str, platform, is_archive_enabled: bool=False, encoded_values_content: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(EncodedTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) - self.encoded_task_content = encoded_task_content - self.encoded_values_content = encoded_values_content - self.values = values - self.timeout = timeout - self.platform = platform - self.agent_configuration = agent_configuration - self.source_location = source_location - self.credentials = credentials - self.type = 'EncodedTaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_step.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_step.py deleted file mode 100644 index c52ca2087a4d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_step.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .task_step_properties import TaskStepProperties - - -class EncodedTaskStep(TaskStepProperties): - """The properties of a encoded task 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Required. Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'encoded_task_content': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(EncodedTaskStep, self).__init__(**kwargs) - self.encoded_task_content = kwargs.get('encoded_task_content', None) - self.encoded_values_content = kwargs.get('encoded_values_content', None) - self.values = kwargs.get('values', None) - self.type = 'EncodedTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_step_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_step_py3.py deleted file mode 100644 index c203efff0156..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_step_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .task_step_properties_py3 import TaskStepProperties - - -class EncodedTaskStep(TaskStepProperties): - """The properties of a encoded task 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Required. Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'encoded_task_content': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, encoded_task_content: str, context_path: str=None, context_access_token: str=None, encoded_values_content: str=None, values=None, **kwargs) -> None: - super(EncodedTaskStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - self.encoded_task_content = encoded_task_content - self.encoded_values_content = encoded_values_content - self.values = values - self.type = 'EncodedTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_step_update_parameters.py deleted file mode 100644 index e0d141d5ae0a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_step_update_parameters.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 .task_step_update_parameters import TaskStepUpdateParameters - - -class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters): - """The properties for updating encoded task step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(EncodedTaskStepUpdateParameters, self).__init__(**kwargs) - self.encoded_task_content = kwargs.get('encoded_task_content', None) - self.encoded_values_content = kwargs.get('encoded_values_content', None) - self.values = kwargs.get('values', None) - self.type = 'EncodedTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_step_update_parameters_py3.py deleted file mode 100644 index ec700e43df12..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/encoded_task_step_update_parameters_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 .task_step_update_parameters_py3 import TaskStepUpdateParameters - - -class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters): - """The properties for updating encoded task step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param encoded_task_content: Base64 encoded value of the - template/definition file content. - :type encoded_task_content: str - :param encoded_values_content: Base64 encoded value of the - parameters/values file content. - :type encoded_values_content: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'encoded_task_content': {'key': 'encodedTaskContent', 'type': 'str'}, - 'encoded_values_content': {'key': 'encodedValuesContent', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, encoded_task_content: str=None, encoded_values_content: str=None, values=None, **kwargs) -> None: - super(EncodedTaskStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - self.encoded_task_content = encoded_task_content - self.encoded_values_content = encoded_values_content - self.values = values - self.type = 'EncodedTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event.py deleted file mode 100644 index 2e9f03449f94..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.v2019_05_01.models.EventRequestMessage - :param event_response_message: The event response message received from - the service URI. - :type event_response_message: - ~azure.mgmt.containerregistry.v2019_05_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_content.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_content.py deleted file mode 100644 index a56ac3a052bd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_content.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.v2019_05_01.models.Target - :param request: The request that generated the event. - :type request: ~azure.mgmt.containerregistry.v2019_05_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.v2019_05_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.v2019_05_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_content_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_content_py3.py deleted file mode 100644 index d9873887b6a4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_content_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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.v2019_05_01.models.Target - :param request: The request that generated the event. - :type request: ~azure.mgmt.containerregistry.v2019_05_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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_info.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_info.py deleted file mode 100644 index 7199044b2e39..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_info.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_info_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_info_py3.py deleted file mode 100644 index 192990067407..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_info_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_paged.py deleted file mode 100644 index 47939f9e9eed..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_py3.py deleted file mode 100644 index dec5f2df7596..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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_py3 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.v2019_05_01.models.EventRequestMessage - :param event_response_message: The event response message received from - the service URI. - :type event_response_message: - ~azure.mgmt.containerregistry.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_request_message.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_request_message.py deleted file mode 100644 index 20d07e95eb3a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_request_message.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.v2019_05_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_request_message_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_request_message_py3.py deleted file mode 100644 index 88226576691b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_request_message_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_response_message.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_response_message.py deleted file mode 100644 index ffb8feb12a1e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_response_message.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_response_message_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_response_message_py3.py deleted file mode 100644 index 4b1351377b4b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/event_response_message_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_run_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_run_request.py deleted file mode 100644 index 30da53d76cc5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_run_request.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 .run_request import RunRequest - - -class FileTaskRunRequest(RunRequest): - """The request parameters for a scheduling run against a task file. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: Required. The template/definition file path - relative to the source. - :type task_file_path: str - :param values_file_path: The values/parameters file path relative to the - source. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'task_file_path': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, **kwargs): - super(FileTaskRunRequest, self).__init__(**kwargs) - self.task_file_path = kwargs.get('task_file_path', None) - self.values_file_path = kwargs.get('values_file_path', None) - self.values = kwargs.get('values', None) - self.timeout = kwargs.get('timeout', 3600) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.source_location = kwargs.get('source_location', None) - self.credentials = kwargs.get('credentials', None) - self.type = 'FileTaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_run_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_run_request_py3.py deleted file mode 100644 index 0de583588959..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_run_request_py3.py +++ /dev/null @@ -1,85 +0,0 @@ -# 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 .run_request_py3 import RunRequest - - -class FileTaskRunRequest(RunRequest): - """The request parameters for a scheduling run against a task file. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: Required. The template/definition file path - relative to the source. - :type task_file_path: str - :param values_file_path: The values/parameters file path relative to the - source. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties - :param source_location: The URL(absolute or relative) of the source - context. It can be an URL to a tar or git repository. - If it is relative URL, the relative path should be obtained from calling - listBuildSourceUploadUrl API. - :type source_location: str - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials - """ - - _validation = { - 'type': {'required': True}, - 'task_file_path': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'platform': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - 'timeout': {'key': 'timeout', 'type': 'int'}, - 'platform': {'key': 'platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'agentConfiguration', 'type': 'AgentProperties'}, - 'source_location': {'key': 'sourceLocation', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'Credentials'}, - } - - def __init__(self, *, task_file_path: str, platform, is_archive_enabled: bool=False, values_file_path: str=None, values=None, timeout: int=3600, agent_configuration=None, source_location: str=None, credentials=None, **kwargs) -> None: - super(FileTaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) - self.task_file_path = task_file_path - self.values_file_path = values_file_path - self.values = values - self.timeout = timeout - self.platform = platform - self.agent_configuration = agent_configuration - self.source_location = source_location - self.credentials = credentials - self.type = 'FileTaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_step.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_step.py deleted file mode 100644 index e400b62069a4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_step.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .task_step_properties import TaskStepProperties - - -class FileTaskStep(TaskStepProperties): - """The properties of a task 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: Required. The task template/definition file path - relative to the source context. - :type task_file_path: str - :param values_file_path: The task values/parameters file path relative to - the source context. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'task_file_path': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(FileTaskStep, self).__init__(**kwargs) - self.task_file_path = kwargs.get('task_file_path', None) - self.values_file_path = kwargs.get('values_file_path', None) - self.values = kwargs.get('values', None) - self.type = 'FileTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_step_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_step_py3.py deleted file mode 100644 index 45c75c315118..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_step_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 .task_step_properties_py3 import TaskStepProperties - - -class FileTaskStep(TaskStepProperties): - """The properties of a task 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: Required. The task template/definition file path - relative to the source context. - :type task_file_path: str - :param values_file_path: The task values/parameters file path relative to - the source context. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - 'task_file_path': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, task_file_path: str, context_path: str=None, context_access_token: str=None, values_file_path: str=None, values=None, **kwargs) -> None: - super(FileTaskStep, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - self.task_file_path = task_file_path - self.values_file_path = values_file_path - self.values = values - self.type = 'FileTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_step_update_parameters.py deleted file mode 100644 index 30e133009dd6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_step_update_parameters.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 .task_step_update_parameters import TaskStepUpdateParameters - - -class FileTaskStepUpdateParameters(TaskStepUpdateParameters): - """The properties of updating a task step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: The task template/definition file path relative to - the source context. - :type task_file_path: str - :param values_file_path: The values/parameters file path relative to the - source context. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(FileTaskStepUpdateParameters, self).__init__(**kwargs) - self.task_file_path = kwargs.get('task_file_path', None) - self.values_file_path = kwargs.get('values_file_path', None) - self.values = kwargs.get('values', None) - self.type = 'FileTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_step_update_parameters_py3.py deleted file mode 100644 index 0361888fe5f7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/file_task_step_update_parameters_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 .task_step_update_parameters_py3 import TaskStepUpdateParameters - - -class FileTaskStepUpdateParameters(TaskStepUpdateParameters): - """The properties of updating a task step. - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - :param task_file_path: The task template/definition file path relative to - the source context. - :type task_file_path: str - :param values_file_path: The values/parameters file path relative to the - source context. - :type values_file_path: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_file_path': {'key': 'taskFilePath', 'type': 'str'}, - 'values_file_path': {'key': 'valuesFilePath', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, task_file_path: str=None, values_file_path: str=None, values=None, **kwargs) -> None: - super(FileTaskStepUpdateParameters, self).__init__(context_path=context_path, context_access_token=context_access_token, **kwargs) - self.task_file_path = task_file_path - self.values_file_path = values_file_path - self.values = values - self.type = 'FileTask' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/identity_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/identity_properties.py deleted file mode 100644 index 19bdd2b6f100..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/identity_properties.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 IdentityProperties(Model): - """Managed identity for the resource. - - :param principal_id: The principal ID of resource identity. - :type principal_id: str - :param tenant_id: The tenant ID of resource. - :type tenant_id: str - :param type: The identity type. Possible values include: 'SystemAssigned', - 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' - :type type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.ResourceIdentityType - :param user_assigned_identities: The list of user identities associated - with the resource. The user identity - dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ - providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerregistry.v2019_05_01.models.UserIdentityProperties] - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentityProperties}'}, - } - - def __init__(self, **kwargs): - super(IdentityProperties, self).__init__(**kwargs) - self.principal_id = kwargs.get('principal_id', None) - self.tenant_id = kwargs.get('tenant_id', None) - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/identity_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/identity_properties_py3.py deleted file mode 100644 index 91528b3f2f89..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/identity_properties_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 IdentityProperties(Model): - """Managed identity for the resource. - - :param principal_id: The principal ID of resource identity. - :type principal_id: str - :param tenant_id: The tenant ID of resource. - :type tenant_id: str - :param type: The identity type. Possible values include: 'SystemAssigned', - 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' - :type type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.ResourceIdentityType - :param user_assigned_identities: The list of user identities associated - with the resource. The user identity - dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ - providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.containerregistry.v2019_05_01.models.UserIdentityProperties] - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentityProperties}'}, - } - - def __init__(self, *, principal_id: str=None, tenant_id: str=None, type=None, user_assigned_identities=None, **kwargs) -> None: - super(IdentityProperties, self).__init__(**kwargs) - self.principal_id = principal_id - self.tenant_id = tenant_id - self.type = type - self.user_assigned_identities = user_assigned_identities diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/image_descriptor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/image_descriptor.py deleted file mode 100644 index 1cfd03ed778c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/image_descriptor.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/image_descriptor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/image_descriptor_py3.py deleted file mode 100644 index 72928cf47326..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/image_descriptor_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/image_update_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/image_update_trigger.py deleted file mode 100644 index d3be588df8c0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/image_update_trigger.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.v2019_05_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/image_update_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/image_update_trigger_py3.py deleted file mode 100644 index 77923c8ee2de..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/image_update_trigger_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.v2019_05_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_image_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_image_parameters.py deleted file mode 100644 index 32d39cb62587..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_image_parameters.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportImageParameters(Model): - """ImportImageParameters. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. The source of the image. - :type source: - ~azure.mgmt.containerregistry.v2019_05_01.models.ImportSource - :param target_tags: List of strings of the form repo[:tag]. When tag is - omitted the source will be used (or 'latest' if source tag is also - omitted). - :type target_tags: list[str] - :param untagged_target_repositories: List of strings of repository names - to do a manifest only copy. No tag will be created. - :type untagged_target_repositories: list[str] - :param mode: When Force, any existing target tags will be overwritten. - When NoForce, any existing target tags will fail the operation before any - copying begins. Possible values include: 'NoForce', 'Force'. Default - value: "NoForce" . - :type mode: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.ImportMode - """ - - _validation = { - 'source': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ImportSource'}, - 'target_tags': {'key': 'targetTags', 'type': '[str]'}, - 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportImageParameters, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.target_tags = kwargs.get('target_tags', None) - self.untagged_target_repositories = kwargs.get('untagged_target_repositories', None) - self.mode = kwargs.get('mode', "NoForce") diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_image_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_image_parameters_py3.py deleted file mode 100644 index a8c80e1140a0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_image_parameters_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportImageParameters(Model): - """ImportImageParameters. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. The source of the image. - :type source: - ~azure.mgmt.containerregistry.v2019_05_01.models.ImportSource - :param target_tags: List of strings of the form repo[:tag]. When tag is - omitted the source will be used (or 'latest' if source tag is also - omitted). - :type target_tags: list[str] - :param untagged_target_repositories: List of strings of repository names - to do a manifest only copy. No tag will be created. - :type untagged_target_repositories: list[str] - :param mode: When Force, any existing target tags will be overwritten. - When NoForce, any existing target tags will fail the operation before any - copying begins. Possible values include: 'NoForce', 'Force'. Default - value: "NoForce" . - :type mode: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.ImportMode - """ - - _validation = { - 'source': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ImportSource'}, - 'target_tags': {'key': 'targetTags', 'type': '[str]'}, - 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__(self, *, source, target_tags=None, untagged_target_repositories=None, mode="NoForce", **kwargs) -> None: - super(ImportImageParameters, self).__init__(**kwargs) - self.source = source - self.target_tags = target_tags - self.untagged_target_repositories = untagged_target_repositories - self.mode = mode diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_source.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_source.py deleted file mode 100644 index bc48c0699d68..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_source.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportSource(Model): - """ImportSource. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource identifier of the source Azure Container - Registry. - :type resource_id: str - :param registry_uri: The address of the source registry (e.g. - 'mcr.microsoft.com'). - :type registry_uri: str - :param credentials: Credentials used when importing from a registry uri. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01.models.ImportSourceCredentials - :param source_image: Required. Repository name of the source image. - Specify an image by repository ('hello-world'). This will use the 'latest' - tag. - Specify an image by tag ('hello-world:latest'). - Specify an image by sha256-based manifest digest - ('hello-world@sha256:abc123'). - :type source_image: str - """ - - _validation = { - 'source_image': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'registry_uri': {'key': 'registryUri', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, - 'source_image': {'key': 'sourceImage', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportSource, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.registry_uri = kwargs.get('registry_uri', None) - self.credentials = kwargs.get('credentials', None) - self.source_image = kwargs.get('source_image', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_source_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_source_credentials.py deleted file mode 100644 index b31e5f7e8405..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_source_credentials.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ImportSourceCredentials(Model): - """ImportSourceCredentials. - - All required parameters must be populated in order to send to Azure. - - :param username: The username to authenticate with the source registry. - :type username: str - :param password: Required. The password used to authenticate with the - source registry. - :type password: str - """ - - _validation = { - 'password': {'required': True}, - } - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportSourceCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_source_credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_source_credentials_py3.py deleted file mode 100644 index 4a610e022f88..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_source_credentials_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ImportSourceCredentials(Model): - """ImportSourceCredentials. - - All required parameters must be populated in order to send to Azure. - - :param username: The username to authenticate with the source registry. - :type username: str - :param password: Required. The password used to authenticate with the - source registry. - :type password: str - """ - - _validation = { - 'password': {'required': True}, - } - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__(self, *, password: str, username: str=None, **kwargs) -> None: - super(ImportSourceCredentials, self).__init__(**kwargs) - self.username = username - self.password = password diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_source_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_source_py3.py deleted file mode 100644 index 1fe2196a4947..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/import_source_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportSource(Model): - """ImportSource. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource identifier of the source Azure Container - Registry. - :type resource_id: str - :param registry_uri: The address of the source registry (e.g. - 'mcr.microsoft.com'). - :type registry_uri: str - :param credentials: Credentials used when importing from a registry uri. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01.models.ImportSourceCredentials - :param source_image: Required. Repository name of the source image. - Specify an image by repository ('hello-world'). This will use the 'latest' - tag. - Specify an image by tag ('hello-world:latest'). - Specify an image by sha256-based manifest digest - ('hello-world@sha256:abc123'). - :type source_image: str - """ - - _validation = { - 'source_image': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'registry_uri': {'key': 'registryUri', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, - 'source_image': {'key': 'sourceImage', 'type': 'str'}, - } - - def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None: - super(ImportSource, self).__init__(**kwargs) - self.resource_id = resource_id - self.registry_uri = registry_uri - self.credentials = credentials - self.source_image = source_image diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/ip_rule.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/ip_rule.py deleted file mode 100644 index ccde6bbee153..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/ip_rule.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.Action - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.action = kwargs.get('action', "Allow") - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/ip_rule_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/ip_rule_py3.py deleted file mode 100644 index 22b8fd28d1d4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/ip_rule_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.Action - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.action = action - self.ip_address_or_range = ip_address_or_range diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/network_rule_set.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/network_rule_set.py deleted file mode 100644 index b0d969d42a40..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/network_rule_set.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 NetworkRuleSet(Model): - """The network rule set for a container registry. - - All required parameters must be populated in order to send to Azure. - - :param default_action: Required. The default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . - :type default_action: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.DefaultAction - :param virtual_network_rules: The virtual network rules. - :type virtual_network_rules: - list[~azure.mgmt.containerregistry.v2019_05_01.models.VirtualNetworkRule] - :param ip_rules: The IP ACL rules. - :type ip_rules: - list[~azure.mgmt.containerregistry.v2019_05_01.models.IPRule] - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.default_action = kwargs.get('default_action', "Allow") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/network_rule_set_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/network_rule_set_py3.py deleted file mode 100644 index 54298df2cedf..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/network_rule_set_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 NetworkRuleSet(Model): - """The network rule set for a container registry. - - All required parameters must be populated in order to send to Azure. - - :param default_action: Required. The default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . - :type default_action: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.DefaultAction - :param virtual_network_rules: The virtual network rules. - :type virtual_network_rules: - list[~azure.mgmt.containerregistry.v2019_05_01.models.VirtualNetworkRule] - :param ip_rules: The IP ACL rules. - :type ip_rules: - list[~azure.mgmt.containerregistry.v2019_05_01.models.IPRule] - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.default_action = default_action - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_definition.py deleted file mode 100644 index feb70e74ab97..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_definition.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 origin: The origin information of the container registry operation. - :type origin: str - :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.v2019_05_01.models.OperationDisplayDefinition - :param service_specification: The definition of Azure Monitoring service. - :type service_specification: - ~azure.mgmt.containerregistry.v2019_05_01.models.OperationServiceSpecificationDefinition - """ - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, - } - - def __init__(self, **kwargs): - super(OperationDefinition, self).__init__(**kwargs) - self.origin = kwargs.get('origin', None) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_definition_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_definition_paged.py deleted file mode 100644 index b294cd04ad0a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_definition_py3.py deleted file mode 100644 index 63b0842bd6f6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_definition_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 origin: The origin information of the container registry operation. - :type origin: str - :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.v2019_05_01.models.OperationDisplayDefinition - :param service_specification: The definition of Azure Monitoring service. - :type service_specification: - ~azure.mgmt.containerregistry.v2019_05_01.models.OperationServiceSpecificationDefinition - """ - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, - } - - def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: - super(OperationDefinition, self).__init__(**kwargs) - self.origin = origin - self.name = name - self.display = display - self.service_specification = service_specification diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_display_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_display_definition.py deleted file mode 100644 index 6cb8463b21fc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_display_definition.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_display_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_display_definition_py3.py deleted file mode 100644 index 98abb699335c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_display_definition_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_metric_specification_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_metric_specification_definition.py deleted file mode 100644 index 8b40b3b4d6f1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_metric_specification_definition.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 OperationMetricSpecificationDefinition(Model): - """The definition of Azure Monitoring metric. - - :param name: Metric name. - :type name: str - :param display_name: Metric display name. - :type display_name: str - :param display_description: Metric description. - :type display_description: str - :param unit: Metric unit. - :type unit: str - :param aggregation_type: Metric aggregation type. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.internal_metric_name = kwargs.get('internal_metric_name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_metric_specification_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_metric_specification_definition_py3.py deleted file mode 100644 index db4f31c14a17..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_metric_specification_definition_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 OperationMetricSpecificationDefinition(Model): - """The definition of Azure Monitoring metric. - - :param name: Metric name. - :type name: str - :param display_name: Metric display name. - :type display_name: str - :param display_description: Metric description. - :type display_description: str - :param unit: Metric unit. - :type unit: str - :param aggregation_type: Metric aggregation type. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: - super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.internal_metric_name = internal_metric_name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_service_specification_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_service_specification_definition.py deleted file mode 100644 index edec01270b82..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_service_specification_definition.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 OperationServiceSpecificationDefinition(Model): - """The definition of Azure Monitoring metrics list. - - :param metric_specifications: A list of Azure Monitoring metrics - definition. - :type metric_specifications: - list[~azure.mgmt.containerregistry.v2019_05_01.models.OperationMetricSpecificationDefinition] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, - } - - def __init__(self, **kwargs): - super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_service_specification_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_service_specification_definition_py3.py deleted file mode 100644 index 23e05d62fe69..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/operation_service_specification_definition_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 OperationServiceSpecificationDefinition(Model): - """The definition of Azure Monitoring metrics list. - - :param metric_specifications: A list of Azure Monitoring metrics - definition. - :type metric_specifications: - list[~azure.mgmt.containerregistry.v2019_05_01.models.OperationMetricSpecificationDefinition] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/platform_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/platform_properties.py deleted file mode 100644 index 0ac3d4cadbd7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/platform_properties.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 run has to happen. - - All required parameters must be populated in order to send to Azure. - - :param os: Required. The operating system type required for the run. - Possible values include: 'Windows', 'Linux' - :type os: str or ~azure.mgmt.containerregistry.v2019_05_01.models.OS - :param architecture: The OS architecture. Possible values include: - 'amd64', 'x86', 'arm' - :type architecture: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.Architecture - :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', - 'v8' - :type variant: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.Variant - """ - - _validation = { - 'os': {'required': True}, - } - - _attribute_map = { - 'os': {'key': 'os', 'type': 'str'}, - 'architecture': {'key': 'architecture', 'type': 'str'}, - 'variant': {'key': 'variant', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PlatformProperties, self).__init__(**kwargs) - self.os = kwargs.get('os', None) - self.architecture = kwargs.get('architecture', None) - self.variant = kwargs.get('variant', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/platform_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/platform_properties_py3.py deleted file mode 100644 index 921897c3b8b9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/platform_properties_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 run has to happen. - - All required parameters must be populated in order to send to Azure. - - :param os: Required. The operating system type required for the run. - Possible values include: 'Windows', 'Linux' - :type os: str or ~azure.mgmt.containerregistry.v2019_05_01.models.OS - :param architecture: The OS architecture. Possible values include: - 'amd64', 'x86', 'arm' - :type architecture: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.Architecture - :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', - 'v8' - :type variant: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.Variant - """ - - _validation = { - 'os': {'required': True}, - } - - _attribute_map = { - 'os': {'key': 'os', 'type': 'str'}, - 'architecture': {'key': 'architecture', 'type': 'str'}, - 'variant': {'key': 'variant', 'type': 'str'}, - } - - def __init__(self, *, os, architecture=None, variant=None, **kwargs) -> None: - super(PlatformProperties, self).__init__(**kwargs) - self.os = os - self.architecture = architecture - self.variant = variant diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/platform_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/platform_update_parameters.py deleted file mode 100644 index 678709a2605d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/platform_update_parameters.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 PlatformUpdateParameters(Model): - """The properties for updating the platform configuration. - - :param os: The operating system type required for the run. Possible values - include: 'Windows', 'Linux' - :type os: str or ~azure.mgmt.containerregistry.v2019_05_01.models.OS - :param architecture: The OS architecture. Possible values include: - 'amd64', 'x86', 'arm' - :type architecture: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.Architecture - :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', - 'v8' - :type variant: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.Variant - """ - - _attribute_map = { - 'os': {'key': 'os', 'type': 'str'}, - 'architecture': {'key': 'architecture', 'type': 'str'}, - 'variant': {'key': 'variant', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PlatformUpdateParameters, self).__init__(**kwargs) - self.os = kwargs.get('os', None) - self.architecture = kwargs.get('architecture', None) - self.variant = kwargs.get('variant', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/platform_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/platform_update_parameters_py3.py deleted file mode 100644 index 70b67aa1ff14..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/platform_update_parameters_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 PlatformUpdateParameters(Model): - """The properties for updating the platform configuration. - - :param os: The operating system type required for the run. Possible values - include: 'Windows', 'Linux' - :type os: str or ~azure.mgmt.containerregistry.v2019_05_01.models.OS - :param architecture: The OS architecture. Possible values include: - 'amd64', 'x86', 'arm' - :type architecture: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.Architecture - :param variant: Variant of the CPU. Possible values include: 'v6', 'v7', - 'v8' - :type variant: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.Variant - """ - - _attribute_map = { - 'os': {'key': 'os', 'type': 'str'}, - 'architecture': {'key': 'architecture', 'type': 'str'}, - 'variant': {'key': 'variant', 'type': 'str'}, - } - - def __init__(self, *, os=None, architecture=None, variant=None, **kwargs) -> None: - super(PlatformUpdateParameters, self).__init__(**kwargs) - self.os = os - self.architecture = architecture - self.variant = variant diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/policies.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/policies.py deleted file mode 100644 index 8757a8d49193..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/policies.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 Policies(Model): - """The policies for a container registry. - - :param quarantine_policy: The quarantine policy for a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2019_05_01.models.QuarantinePolicy - :param trust_policy: The content trust policy for a container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2019_05_01.models.TrustPolicy - :param retention_policy: The retention policy for a container registry. - :type retention_policy: - ~azure.mgmt.containerregistry.v2019_05_01.models.RetentionPolicy - """ - - _attribute_map = { - 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, - 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, - 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, - } - - def __init__(self, **kwargs): - super(Policies, self).__init__(**kwargs) - self.quarantine_policy = kwargs.get('quarantine_policy', None) - self.trust_policy = kwargs.get('trust_policy', None) - self.retention_policy = kwargs.get('retention_policy', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/policies_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/policies_py3.py deleted file mode 100644 index f865ae33ce81..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/policies_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 Policies(Model): - """The policies for a container registry. - - :param quarantine_policy: The quarantine policy for a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2019_05_01.models.QuarantinePolicy - :param trust_policy: The content trust policy for a container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2019_05_01.models.TrustPolicy - :param retention_policy: The retention policy for a container registry. - :type retention_policy: - ~azure.mgmt.containerregistry.v2019_05_01.models.RetentionPolicy - """ - - _attribute_map = { - 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, - 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, - 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, - } - - def __init__(self, *, quarantine_policy=None, trust_policy=None, retention_policy=None, **kwargs) -> None: - super(Policies, self).__init__(**kwargs) - self.quarantine_policy = quarantine_policy - self.trust_policy = trust_policy - self.retention_policy = retention_policy diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/proxy_resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/proxy_resource.py deleted file mode 100644 index 5c52aad9de10..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/proxy_resource.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/proxy_resource_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/proxy_resource_py3.py deleted file mode 100644 index d310c7cbf9b1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/proxy_resource_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/quarantine_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/quarantine_policy.py deleted file mode 100644 index 74cb47fa217b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/quarantine_policy.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 QuarantinePolicy(Model): - """The quarantine policy for a container registry. - - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(QuarantinePolicy, self).__init__(**kwargs) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/quarantine_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/quarantine_policy_py3.py deleted file mode 100644 index 1cb9ea7377e8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/quarantine_policy_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 QuarantinePolicy(Model): - """The quarantine policy for a container registry. - - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, status=None, **kwargs) -> None: - super(QuarantinePolicy, self).__init__(**kwargs) - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/regenerate_credential_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/regenerate_credential_parameters.py deleted file mode 100644 index 34636f2d88b9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/regenerate_credential_parameters.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.v2019_05_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/regenerate_credential_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/regenerate_credential_parameters_py3.py deleted file mode 100644 index 8be6c1fc18bc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/regenerate_credential_parameters_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry.py deleted file mode 100644 index 3201ccc03c15..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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.v2019_05_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.v2019_05_01.models.ProvisioningState - :ivar status: The status of the container registry at the time the - operation was called. - :vartype status: ~azure.mgmt.containerregistry.v2019_05_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.v2019_05_01.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2019_05_01.models.NetworkRuleSet - :param policies: The policies for a container registry. - :type policies: ~azure.mgmt.containerregistry.v2019_05_01.models.Policies - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - 'policies': {'key': 'properties.policies', 'type': 'Policies'}, - } - - 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) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.policies = kwargs.get('policies', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_list_credentials_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_list_credentials_result.py deleted file mode 100644 index dcf539c70032..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_list_credentials_result.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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.v2019_05_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_list_credentials_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_list_credentials_result_py3.py deleted file mode 100644 index d6100932c120..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_list_credentials_result_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_name_check_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_name_check_request.py deleted file mode 100644 index 9d4a575eac04..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_name_check_request.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_name_check_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_name_check_request_py3.py deleted file mode 100644 index 67f5ff9be671..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_name_check_request_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_name_status.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_name_status.py deleted file mode 100644 index 94345ba6d549..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_name_status.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_name_status_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_name_status_py3.py deleted file mode 100644 index 8b7b264c2d0d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_name_status_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_paged.py deleted file mode 100644 index 220260e6d265..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_password.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_password.py deleted file mode 100644 index ee7c90af042b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_password.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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.v2019_05_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, **kwargs): - super(RegistryPassword, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.value = kwargs.get('value', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_password_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_password_py3.py deleted file mode 100644 index 7f881e40635b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_password_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_py3.py deleted file mode 100644 index 97342bc51e49..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_py3.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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_py3 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.v2019_05_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.v2019_05_01.models.ProvisioningState - :ivar status: The status of the container registry at the time the - operation was called. - :vartype status: ~azure.mgmt.containerregistry.v2019_05_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.v2019_05_01.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2019_05_01.models.NetworkRuleSet - :param policies: The policies for a container registry. - :type policies: ~azure.mgmt.containerregistry.v2019_05_01.models.Policies - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - 'policies': {'key': 'properties.policies', 'type': 'Policies'}, - } - - def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=None, policies=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 - self.network_rule_set = network_rule_set - self.policies = policies diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_update_parameters.py deleted file mode 100644 index b059bceb942c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_update_parameters.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.v2019_05_01.models.Sku - :param admin_user_enabled: The value that indicates whether the admin user - is enabled. - :type admin_user_enabled: bool - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2019_05_01.models.NetworkRuleSet - :param policies: The policies for a container registry. - :type policies: ~azure.mgmt.containerregistry.v2019_05_01.models.Policies - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - 'policies': {'key': 'properties.policies', 'type': 'Policies'}, - } - - 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.network_rule_set = kwargs.get('network_rule_set', None) - self.policies = kwargs.get('policies', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_update_parameters_py3.py deleted file mode 100644 index 2aeeb94e3514..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_update_parameters_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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.v2019_05_01.models.Sku - :param admin_user_enabled: The value that indicates whether the admin user - is enabled. - :type admin_user_enabled: bool - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2019_05_01.models.NetworkRuleSet - :param policies: The policies for a container registry. - :type policies: ~azure.mgmt.containerregistry.v2019_05_01.models.Policies - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - 'policies': {'key': 'properties.policies', 'type': 'Policies'}, - } - - def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, network_rule_set=None, policies=None, **kwargs) -> None: - super(RegistryUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.sku = sku - self.admin_user_enabled = admin_user_enabled - self.network_rule_set = network_rule_set - self.policies = policies diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_usage.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_usage.py deleted file mode 100644 index 840c186cb43e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_usage.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.v2019_05_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_usage_list_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_usage_list_result.py deleted file mode 100644 index fc32b11a7b01..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_usage_list_result.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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.v2019_05_01.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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_usage_list_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_usage_list_result_py3.py deleted file mode 100644 index 8c68b8132e62..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_usage_list_result_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_usage_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_usage_py3.py deleted file mode 100644 index 39950a3aa199..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/registry_usage_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication.py deleted file mode 100644 index 697594343b4c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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.v2019_05_01.models.ProvisioningState - :ivar status: The status of the replication at the time the operation was - called. - :vartype status: ~azure.mgmt.containerregistry.v2019_05_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, **kwargs): - super(Replication, self).__init__(**kwargs) - self.provisioning_state = None - self.status = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication_paged.py deleted file mode 100644 index 196a67ca15b9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication_py3.py deleted file mode 100644 index 76c9f5d4db98..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication_py3.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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_py3 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.v2019_05_01.models.ProvisioningState - :ivar status: The status of the replication at the time the operation was - called. - :vartype status: ~azure.mgmt.containerregistry.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication_update_parameters.py deleted file mode 100644 index 003b15583a55..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication_update_parameters.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication_update_parameters_py3.py deleted file mode 100644 index 5497bcdbc1f7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/replication_update_parameters_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/request.py deleted file mode 100644 index e08090f53205..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/request.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/request_py3.py deleted file mode 100644 index f42dae28c955..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/request_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/resource.py deleted file mode 100644 index 3965a6f0cf40..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/resource.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/resource_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/resource_py3.py deleted file mode 100644 index 3a1d4bc4edd1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/resource_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/retention_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/retention_policy.py deleted file mode 100644 index 169b2d00c976..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/retention_policy.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 RetentionPolicy(Model): - """The retention policy for a container registry. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param days: The number of days to retain manifest before it expires. - :type days: int - :ivar last_updated_time: The timestamp when the policy was last updated. - :vartype last_updated_time: datetime - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus - """ - - _validation = { - 'last_updated_time': {'readonly': True}, - } - - _attribute_map = { - 'days': {'key': 'days', 'type': 'int'}, - 'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RetentionPolicy, self).__init__(**kwargs) - self.days = kwargs.get('days', None) - self.last_updated_time = None - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/retention_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/retention_policy_py3.py deleted file mode 100644 index 14e82ed4fb57..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/retention_policy_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 RetentionPolicy(Model): - """The retention policy for a container registry. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param days: The number of days to retain manifest before it expires. - :type days: int - :ivar last_updated_time: The timestamp when the policy was last updated. - :vartype last_updated_time: datetime - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus - """ - - _validation = { - 'last_updated_time': {'readonly': True}, - } - - _attribute_map = { - 'days': {'key': 'days', 'type': 'int'}, - 'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, days: int=None, status=None, **kwargs) -> None: - super(RetentionPolicy, self).__init__(**kwargs) - self.days = days - self.last_updated_time = None - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run.py deleted file mode 100644 index 765a8adf18b9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run.py +++ /dev/null @@ -1,140 +0,0 @@ -# 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 Run(ProxyResource): - """Run 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 run_id: The unique identifier for the run. - :type run_id: str - :param status: The current status of the run. Possible values include: - 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', - 'Error', 'Timeout' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.RunStatus - :param last_updated_time: The last updated time for the run. - :type last_updated_time: datetime - :param run_type: The type of run. Possible values include: 'QuickBuild', - 'QuickRun', 'AutoBuild', 'AutoRun' - :type run_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.RunType - :param create_time: The time the run was scheduled. - :type create_time: datetime - :param start_time: The time the run started. - :type start_time: datetime - :param finish_time: The time the run finished. - :type finish_time: datetime - :param output_images: The list of all images that were generated from the - run. This is applicable if the run generates base image dependencies. - :type output_images: - list[~azure.mgmt.containerregistry.v2019_05_01.models.ImageDescriptor] - :param task: The task against which run was scheduled. - :type task: str - :param image_update_trigger: The image update trigger that caused the run. - This is applicable if the task has base image trigger configured. - :type image_update_trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.ImageUpdateTrigger - :param source_trigger: The source trigger that caused the run. - :type source_trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerDescriptor - :param platform: The platform properties against which the run will - happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties - :param source_registry_auth: The scope of the credentials that were used - to login to the source registry during this run. - :type source_registry_auth: str - :param custom_registries: The list of custom registries that were logged - in during this run. - :type custom_registries: list[str] - :ivar run_error_message: The error message received from backend systems - after the run is scheduled. - :vartype run_error_message: str - :param provisioning_state: The provisioning state of a run. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :type provisioning_state: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.ProvisioningState - :param is_archive_enabled: The value that indicates whether archiving is - enabled or not. Default value: False . - :type is_archive_enabled: bool - :param timer_trigger: The timer trigger that caused the run. - :type timer_trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.TimerTriggerDescriptor - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'run_error_message': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'run_id': {'key': 'properties.runId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, - 'run_type': {'key': 'properties.runType', '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]'}, - 'task': {'key': 'properties.task', 'type': 'str'}, - 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, - 'source_trigger': {'key': 'properties.sourceTrigger', 'type': 'SourceTriggerDescriptor'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'source_registry_auth': {'key': 'properties.sourceRegistryAuth', 'type': 'str'}, - 'custom_registries': {'key': 'properties.customRegistries', 'type': '[str]'}, - 'run_error_message': {'key': 'properties.runErrorMessage', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, - 'timer_trigger': {'key': 'properties.timerTrigger', 'type': 'TimerTriggerDescriptor'}, - } - - def __init__(self, **kwargs): - super(Run, self).__init__(**kwargs) - self.run_id = kwargs.get('run_id', None) - self.status = kwargs.get('status', None) - self.last_updated_time = kwargs.get('last_updated_time', None) - self.run_type = kwargs.get('run_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.task = kwargs.get('task', None) - self.image_update_trigger = kwargs.get('image_update_trigger', None) - self.source_trigger = kwargs.get('source_trigger', None) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.source_registry_auth = kwargs.get('source_registry_auth', None) - self.custom_registries = kwargs.get('custom_registries', None) - self.run_error_message = None - self.provisioning_state = kwargs.get('provisioning_state', None) - self.is_archive_enabled = kwargs.get('is_archive_enabled', False) - self.timer_trigger = kwargs.get('timer_trigger', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_filter.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_filter.py deleted file mode 100644 index 4d9ec0c1d559..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_filter.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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 RunFilter(Model): - """Properties that are enabled for Odata querying on runs. - - :param run_id: The unique identifier for the run. - :type run_id: str - :param run_type: The type of run. Possible values include: 'QuickBuild', - 'QuickRun', 'AutoBuild', 'AutoRun' - :type run_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.RunType - :param status: The current status of the run. Possible values include: - 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', - 'Error', 'Timeout' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.RunStatus - :param create_time: The create time for a run. - :type create_time: datetime - :param finish_time: The time the run finished. - :type finish_time: datetime - :param output_image_manifests: The list of comma-separated image manifests - that were generated from the run. This is applicable if the run is of - build type. - :type output_image_manifests: str - :param is_archive_enabled: The value that indicates whether archiving is - enabled or not. - :type is_archive_enabled: bool - :param task_name: The name of the task that the run corresponds to. - :type task_name: str - """ - - _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'run_type': {'key': 'runType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, - 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'task_name': {'key': 'taskName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RunFilter, self).__init__(**kwargs) - self.run_id = kwargs.get('run_id', None) - self.run_type = kwargs.get('run_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_manifests = kwargs.get('output_image_manifests', None) - self.is_archive_enabled = kwargs.get('is_archive_enabled', None) - self.task_name = kwargs.get('task_name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_filter_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_filter_py3.py deleted file mode 100644 index 766eca952652..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_filter_py3.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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 RunFilter(Model): - """Properties that are enabled for Odata querying on runs. - - :param run_id: The unique identifier for the run. - :type run_id: str - :param run_type: The type of run. Possible values include: 'QuickBuild', - 'QuickRun', 'AutoBuild', 'AutoRun' - :type run_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.RunType - :param status: The current status of the run. Possible values include: - 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', - 'Error', 'Timeout' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.RunStatus - :param create_time: The create time for a run. - :type create_time: datetime - :param finish_time: The time the run finished. - :type finish_time: datetime - :param output_image_manifests: The list of comma-separated image manifests - that were generated from the run. This is applicable if the run is of - build type. - :type output_image_manifests: str - :param is_archive_enabled: The value that indicates whether archiving is - enabled or not. - :type is_archive_enabled: bool - :param task_name: The name of the task that the run corresponds to. - :type task_name: str - """ - - _attribute_map = { - 'run_id': {'key': 'runId', 'type': 'str'}, - 'run_type': {'key': 'runType', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, - 'output_image_manifests': {'key': 'outputImageManifests', 'type': 'str'}, - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'task_name': {'key': 'taskName', 'type': 'str'}, - } - - def __init__(self, *, run_id: str=None, run_type=None, status=None, create_time=None, finish_time=None, output_image_manifests: str=None, is_archive_enabled: bool=None, task_name: str=None, **kwargs) -> None: - super(RunFilter, self).__init__(**kwargs) - self.run_id = run_id - self.run_type = run_type - self.status = status - self.create_time = create_time - self.finish_time = finish_time - self.output_image_manifests = output_image_manifests - self.is_archive_enabled = is_archive_enabled - self.task_name = task_name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_get_log_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_get_log_result.py deleted file mode 100644 index bfe07c60ccee..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_get_log_result.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 RunGetLogResult(Model): - """The result of get log link operation. - - :param log_link: The link to logs for a run on a azure container registry. - :type log_link: str - """ - - _attribute_map = { - 'log_link': {'key': 'logLink', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(RunGetLogResult, self).__init__(**kwargs) - self.log_link = kwargs.get('log_link', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_get_log_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_get_log_result_py3.py deleted file mode 100644 index dc68e84d93db..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_get_log_result_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 RunGetLogResult(Model): - """The result of get log link operation. - - :param log_link: The link to logs for a run on a azure container registry. - :type log_link: str - """ - - _attribute_map = { - 'log_link': {'key': 'logLink', 'type': 'str'}, - } - - def __init__(self, *, log_link: str=None, **kwargs) -> None: - super(RunGetLogResult, self).__init__(**kwargs) - self.log_link = log_link diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_paged.py deleted file mode 100644 index 29934847326f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 RunPaged(Paged): - """ - A paging container for iterating over a list of :class:`Run ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Run]'} - } - - def __init__(self, *args, **kwargs): - - super(RunPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_py3.py deleted file mode 100644 index 12b50c00e66e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_py3.py +++ /dev/null @@ -1,140 +0,0 @@ -# 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_py3 import ProxyResource - - -class Run(ProxyResource): - """Run 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 run_id: The unique identifier for the run. - :type run_id: str - :param status: The current status of the run. Possible values include: - 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', - 'Error', 'Timeout' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.RunStatus - :param last_updated_time: The last updated time for the run. - :type last_updated_time: datetime - :param run_type: The type of run. Possible values include: 'QuickBuild', - 'QuickRun', 'AutoBuild', 'AutoRun' - :type run_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.RunType - :param create_time: The time the run was scheduled. - :type create_time: datetime - :param start_time: The time the run started. - :type start_time: datetime - :param finish_time: The time the run finished. - :type finish_time: datetime - :param output_images: The list of all images that were generated from the - run. This is applicable if the run generates base image dependencies. - :type output_images: - list[~azure.mgmt.containerregistry.v2019_05_01.models.ImageDescriptor] - :param task: The task against which run was scheduled. - :type task: str - :param image_update_trigger: The image update trigger that caused the run. - This is applicable if the task has base image trigger configured. - :type image_update_trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.ImageUpdateTrigger - :param source_trigger: The source trigger that caused the run. - :type source_trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerDescriptor - :param platform: The platform properties against which the run will - happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties - :param source_registry_auth: The scope of the credentials that were used - to login to the source registry during this run. - :type source_registry_auth: str - :param custom_registries: The list of custom registries that were logged - in during this run. - :type custom_registries: list[str] - :ivar run_error_message: The error message received from backend systems - after the run is scheduled. - :vartype run_error_message: str - :param provisioning_state: The provisioning state of a run. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :type provisioning_state: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.ProvisioningState - :param is_archive_enabled: The value that indicates whether archiving is - enabled or not. Default value: False . - :type is_archive_enabled: bool - :param timer_trigger: The timer trigger that caused the run. - :type timer_trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.TimerTriggerDescriptor - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'run_error_message': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'run_id': {'key': 'properties.runId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, - 'run_type': {'key': 'properties.runType', '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]'}, - 'task': {'key': 'properties.task', 'type': 'str'}, - 'image_update_trigger': {'key': 'properties.imageUpdateTrigger', 'type': 'ImageUpdateTrigger'}, - 'source_trigger': {'key': 'properties.sourceTrigger', 'type': 'SourceTriggerDescriptor'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'source_registry_auth': {'key': 'properties.sourceRegistryAuth', 'type': 'str'}, - 'custom_registries': {'key': 'properties.customRegistries', 'type': '[str]'}, - 'run_error_message': {'key': 'properties.runErrorMessage', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'is_archive_enabled': {'key': 'properties.isArchiveEnabled', 'type': 'bool'}, - 'timer_trigger': {'key': 'properties.timerTrigger', 'type': 'TimerTriggerDescriptor'}, - } - - def __init__(self, *, run_id: str=None, status=None, last_updated_time=None, run_type=None, create_time=None, start_time=None, finish_time=None, output_images=None, task: str=None, image_update_trigger=None, source_trigger=None, platform=None, agent_configuration=None, source_registry_auth: str=None, custom_registries=None, provisioning_state=None, is_archive_enabled: bool=False, timer_trigger=None, **kwargs) -> None: - super(Run, self).__init__(**kwargs) - self.run_id = run_id - self.status = status - self.last_updated_time = last_updated_time - self.run_type = run_type - self.create_time = create_time - self.start_time = start_time - self.finish_time = finish_time - self.output_images = output_images - self.task = task - self.image_update_trigger = image_update_trigger - self.source_trigger = source_trigger - self.platform = platform - self.agent_configuration = agent_configuration - self.source_registry_auth = source_registry_auth - self.custom_registries = custom_registries - self.run_error_message = None - self.provisioning_state = provisioning_state - self.is_archive_enabled = is_archive_enabled - self.timer_trigger = timer_trigger diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_request.py deleted file mode 100644 index 6a49775b5fe9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_request.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 RunRequest(Model): - """The request parameters for scheduling a run. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildRequest, FileTaskRunRequest, TaskRunRequest, - EncodedTaskRunRequest - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} - } - - def __init__(self, **kwargs): - super(RunRequest, self).__init__(**kwargs) - self.is_archive_enabled = kwargs.get('is_archive_enabled', False) - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_request_py3.py deleted file mode 100644 index 1bf6cabe0c2d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_request_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 RunRequest(Model): - """The request parameters for scheduling a run. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildRequest, FileTaskRunRequest, TaskRunRequest, - EncodedTaskRunRequest - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'DockerBuildRequest': 'DockerBuildRequest', 'FileTaskRunRequest': 'FileTaskRunRequest', 'TaskRunRequest': 'TaskRunRequest', 'EncodedTaskRunRequest': 'EncodedTaskRunRequest'} - } - - def __init__(self, *, is_archive_enabled: bool=False, **kwargs) -> None: - super(RunRequest, self).__init__(**kwargs) - self.is_archive_enabled = is_archive_enabled - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_update_parameters.py deleted file mode 100644 index 7c99f1e212d0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_update_parameters.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 RunUpdateParameters(Model): - """The set of run 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(RunUpdateParameters, self).__init__(**kwargs) - self.is_archive_enabled = kwargs.get('is_archive_enabled', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_update_parameters_py3.py deleted file mode 100644 index 62bcd0c6f4bd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/run_update_parameters_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 RunUpdateParameters(Model): - """The set of run 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(RunUpdateParameters, self).__init__(**kwargs) - self.is_archive_enabled = is_archive_enabled diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/secret_object.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/secret_object.py deleted file mode 100644 index 334c2ef70e53..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/secret_object.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 SecretObject(Model): - """Describes the properties of a secret object value. - - :param value: The value of the secret. The format of this value will be - determined - based on the type of the secret object. If the type is Opaque, the value - will be - used as is without any modification. - :type value: str - :param type: The type of the secret object which determines how the value - of the secret object has to be - interpreted. Possible values include: 'Opaque', 'Vaultsecret' - :type type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.SecretObjectType - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SecretObject, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.type = kwargs.get('type', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/secret_object_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/secret_object_py3.py deleted file mode 100644 index 4136ef60f3c6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/secret_object_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 SecretObject(Model): - """Describes the properties of a secret object value. - - :param value: The value of the secret. The format of this value will be - determined - based on the type of the secret object. If the type is Opaque, the value - will be - used as is without any modification. - :type value: str - :param type: The type of the secret object which determines how the value - of the secret object has to be - interpreted. Possible values include: 'Opaque', 'Vaultsecret' - :type type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.SecretObjectType - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, *, value: str=None, type=None, **kwargs) -> None: - super(SecretObject, self).__init__(**kwargs) - self.value = value - self.type = type diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/set_value.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/set_value.py deleted file mode 100644 index ec349f6bb414..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/set_value.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 SetValue(Model): - """The properties of a overridable value that can be passed to a task - template. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the overridable value. - :type name: str - :param value: Required. The overridable value. - :type value: str - :param is_secret: Flag to indicate whether the value represents a secret - or not. Default value: False . - :type is_secret: bool - """ - - _validation = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(SetValue, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/set_value_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/set_value_py3.py deleted file mode 100644 index cce869040a6a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/set_value_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 SetValue(Model): - """The properties of a overridable value that can be passed to a task - template. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The name of the overridable value. - :type name: str - :param value: Required. The overridable value. - :type value: str - :param is_secret: Flag to indicate whether the value represents a secret - or not. Default value: False . - :type is_secret: bool - """ - - _validation = { - 'name': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'is_secret': {'key': 'isSecret', 'type': 'bool'}, - } - - def __init__(self, *, name: str, value: str, is_secret: bool=False, **kwargs) -> None: - super(SetValue, self).__init__(**kwargs) - self.name = name - self.value = value - self.is_secret = is_secret diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/sku.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/sku.py deleted file mode 100644 index d4a833f47952..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/sku.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.v2019_05_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.v2019_05_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, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/sku_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/sku_py3.py deleted file mode 100644 index ed99dc5eaa82..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/sku_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source.py deleted file mode 100644 index 132f4b2c1324..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_properties.py deleted file mode 100644 index 97cbf23de55b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_properties.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 SourceProperties(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.v2019_05_01.models.SourceControlType - :param repository_url: Required. The full URL to the source code - repository - :type repository_url: str - :param branch: The branch name of the source code. - :type branch: str - :param source_control_auth_properties: The authorization properties for - accessing the source code repository and to set up - webhooks for notifications. - :type source_control_auth_properties: - ~azure.mgmt.containerregistry.v2019_05_01.models.AuthInfo - """ - - _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'}, - 'branch': {'key': 'branch', 'type': 'str'}, - 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfo'}, - } - - def __init__(self, **kwargs): - super(SourceProperties, self).__init__(**kwargs) - self.source_control_type = kwargs.get('source_control_type', None) - self.repository_url = kwargs.get('repository_url', None) - self.branch = kwargs.get('branch', None) - self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_properties_py3.py deleted file mode 100644 index 4004f68dde24..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_properties_py3.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 SourceProperties(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.v2019_05_01.models.SourceControlType - :param repository_url: Required. The full URL to the source code - repository - :type repository_url: str - :param branch: The branch name of the source code. - :type branch: str - :param source_control_auth_properties: The authorization properties for - accessing the source code repository and to set up - webhooks for notifications. - :type source_control_auth_properties: - ~azure.mgmt.containerregistry.v2019_05_01.models.AuthInfo - """ - - _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'}, - 'branch': {'key': 'branch', 'type': 'str'}, - 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfo'}, - } - - def __init__(self, *, source_control_type, repository_url: str, branch: str=None, source_control_auth_properties=None, **kwargs) -> None: - super(SourceProperties, self).__init__(**kwargs) - self.source_control_type = source_control_type - self.repository_url = repository_url - self.branch = branch - self.source_control_auth_properties = source_control_auth_properties diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_py3.py deleted file mode 100644 index 5aadcd407862..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_registry_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_registry_credentials.py deleted file mode 100644 index ba7d6ea7d08e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_registry_credentials.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 SourceRegistryCredentials(Model): - """Describes the credential parameters for accessing the source registry. - - :param login_mode: The authentication mode which determines the source - registry login scope. The credentials for the source registry - will be generated using the given scope. These credentials will be used to - login to - the source registry during the run. Possible values include: 'None', - 'Default' - :type login_mode: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceRegistryLoginMode - """ - - _attribute_map = { - 'login_mode': {'key': 'loginMode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SourceRegistryCredentials, self).__init__(**kwargs) - self.login_mode = kwargs.get('login_mode', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_registry_credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_registry_credentials_py3.py deleted file mode 100644 index b408e25972c9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_registry_credentials_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 SourceRegistryCredentials(Model): - """Describes the credential parameters for accessing the source registry. - - :param login_mode: The authentication mode which determines the source - registry login scope. The credentials for the source registry - will be generated using the given scope. These credentials will be used to - login to - the source registry during the run. Possible values include: 'None', - 'Default' - :type login_mode: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceRegistryLoginMode - """ - - _attribute_map = { - 'login_mode': {'key': 'loginMode', 'type': 'str'}, - } - - def __init__(self, *, login_mode=None, **kwargs) -> None: - super(SourceRegistryCredentials, self).__init__(**kwargs) - self.login_mode = login_mode diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger.py deleted file mode 100644 index 1f31bd24c447..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 SourceTrigger(Model): - """The properties of a source based trigger. - - All required parameters must be populated in order to send to Azure. - - :param source_repository: Required. The properties that describes the - source(code) for the task. - :type source_repository: - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceProperties - :param source_trigger_events: Required. The source event corresponding to - the trigger. - :type source_trigger_events: list[str or - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerEvent] - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'source_repository': {'required': True}, - 'source_trigger_events': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceProperties'}, - 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SourceTrigger, self).__init__(**kwargs) - self.source_repository = kwargs.get('source_repository', None) - self.source_trigger_events = kwargs.get('source_trigger_events', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_descriptor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_descriptor.py deleted file mode 100644 index 4ee9a9b20c64..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_descriptor.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 SourceTriggerDescriptor(Model): - """The source trigger that caused a run. - - :param id: The unique ID of the trigger. - :type id: str - :param event_type: The event type of the trigger. - :type event_type: str - :param commit_id: The unique ID that identifies a commit. - :type commit_id: str - :param pull_request_id: The unique ID that identifies pull request. - :type pull_request_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'}, - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'commit_id': {'key': 'commitId', 'type': 'str'}, - 'pull_request_id': {'key': 'pullRequestId', '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(SourceTriggerDescriptor, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.event_type = kwargs.get('event_type', None) - self.commit_id = kwargs.get('commit_id', None) - self.pull_request_id = kwargs.get('pull_request_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_descriptor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_descriptor_py3.py deleted file mode 100644 index bb35eb70537d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_descriptor_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 SourceTriggerDescriptor(Model): - """The source trigger that caused a run. - - :param id: The unique ID of the trigger. - :type id: str - :param event_type: The event type of the trigger. - :type event_type: str - :param commit_id: The unique ID that identifies a commit. - :type commit_id: str - :param pull_request_id: The unique ID that identifies pull request. - :type pull_request_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'}, - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'commit_id': {'key': 'commitId', 'type': 'str'}, - 'pull_request_id': {'key': 'pullRequestId', '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, event_type: str=None, commit_id: str=None, pull_request_id: str=None, repository_url: str=None, branch_name: str=None, provider_type: str=None, **kwargs) -> None: - super(SourceTriggerDescriptor, self).__init__(**kwargs) - self.id = id - self.event_type = event_type - self.commit_id = commit_id - self.pull_request_id = pull_request_id - self.repository_url = repository_url - self.branch_name = branch_name - self.provider_type = provider_type diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_py3.py deleted file mode 100644 index bb9ce31d6a82..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 SourceTrigger(Model): - """The properties of a source based trigger. - - All required parameters must be populated in order to send to Azure. - - :param source_repository: Required. The properties that describes the - source(code) for the task. - :type source_repository: - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceProperties - :param source_trigger_events: Required. The source event corresponding to - the trigger. - :type source_trigger_events: list[str or - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerEvent] - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'source_repository': {'required': True}, - 'source_trigger_events': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceProperties'}, - 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, source_repository, source_trigger_events, name: str, status="Enabled", **kwargs) -> None: - super(SourceTrigger, self).__init__(**kwargs) - self.source_repository = source_repository - self.source_trigger_events = source_trigger_events - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_update_parameters.py deleted file mode 100644 index ef42a876d069..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_update_parameters.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 SourceTriggerUpdateParameters(Model): - """The properties for updating a source based trigger. - - All required parameters must be populated in order to send to Azure. - - :param source_repository: The properties that describes the source(code) - for the task. - :type source_repository: - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceUpdateParameters - :param source_trigger_events: The source event corresponding to the - trigger. - :type source_trigger_events: list[str or - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerEvent] - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceUpdateParameters'}, - 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SourceTriggerUpdateParameters, self).__init__(**kwargs) - self.source_repository = kwargs.get('source_repository', None) - self.source_trigger_events = kwargs.get('source_trigger_events', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_update_parameters_py3.py deleted file mode 100644 index b87e598751d6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_trigger_update_parameters_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 SourceTriggerUpdateParameters(Model): - """The properties for updating a source based trigger. - - All required parameters must be populated in order to send to Azure. - - :param source_repository: The properties that describes the source(code) - for the task. - :type source_repository: - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceUpdateParameters - :param source_trigger_events: The source event corresponding to the - trigger. - :type source_trigger_events: list[str or - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerEvent] - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'source_repository': {'key': 'sourceRepository', 'type': 'SourceUpdateParameters'}, - 'source_trigger_events': {'key': 'sourceTriggerEvents', 'type': '[str]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str, source_repository=None, source_trigger_events=None, status="Enabled", **kwargs) -> None: - super(SourceTriggerUpdateParameters, self).__init__(**kwargs) - self.source_repository = source_repository - self.source_trigger_events = source_trigger_events - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_update_parameters.py deleted file mode 100644 index ed5fb51d03a5..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_update_parameters.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 SourceUpdateParameters(Model): - """The properties for updating the source code repository. - - :param source_control_type: The type of source control service. Possible - values include: 'Github', 'VisualStudioTeamService' - :type source_control_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceControlType - :param repository_url: The full URL to the source code repository - :type repository_url: str - :param branch: The branch name of the source code. - :type branch: str - :param source_control_auth_properties: The authorization properties for - accessing the source code repository and to set up - webhooks for notifications. - :type source_control_auth_properties: - ~azure.mgmt.containerregistry.v2019_05_01.models.AuthInfoUpdateParameters - """ - - _attribute_map = { - 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, - 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, - 'branch': {'key': 'branch', 'type': 'str'}, - 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfoUpdateParameters'}, - } - - def __init__(self, **kwargs): - super(SourceUpdateParameters, self).__init__(**kwargs) - self.source_control_type = kwargs.get('source_control_type', None) - self.repository_url = kwargs.get('repository_url', None) - self.branch = kwargs.get('branch', None) - self.source_control_auth_properties = kwargs.get('source_control_auth_properties', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_update_parameters_py3.py deleted file mode 100644 index 78941470e699..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_update_parameters_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 SourceUpdateParameters(Model): - """The properties for updating the source code repository. - - :param source_control_type: The type of source control service. Possible - values include: 'Github', 'VisualStudioTeamService' - :type source_control_type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.SourceControlType - :param repository_url: The full URL to the source code repository - :type repository_url: str - :param branch: The branch name of the source code. - :type branch: str - :param source_control_auth_properties: The authorization properties for - accessing the source code repository and to set up - webhooks for notifications. - :type source_control_auth_properties: - ~azure.mgmt.containerregistry.v2019_05_01.models.AuthInfoUpdateParameters - """ - - _attribute_map = { - 'source_control_type': {'key': 'sourceControlType', 'type': 'str'}, - 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, - 'branch': {'key': 'branch', 'type': 'str'}, - 'source_control_auth_properties': {'key': 'sourceControlAuthProperties', 'type': 'AuthInfoUpdateParameters'}, - } - - def __init__(self, *, source_control_type=None, repository_url: str=None, branch: str=None, source_control_auth_properties=None, **kwargs) -> None: - super(SourceUpdateParameters, self).__init__(**kwargs) - self.source_control_type = source_control_type - self.repository_url = repository_url - self.branch = branch - self.source_control_auth_properties = source_control_auth_properties diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_upload_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_upload_definition.py deleted file mode 100644 index 381fd538e9e3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_upload_definition.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_upload_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_upload_definition_py3.py deleted file mode 100644 index cff615964e11..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/source_upload_definition_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/status.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/status.py deleted file mode 100644 index 76444c500634..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/status.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/status_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/status_py3.py deleted file mode 100644 index 1f4611c49912..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/status_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/storage_account_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/storage_account_properties.py deleted file mode 100644 index 0541b7651cbd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/storage_account_properties.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/storage_account_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/storage_account_properties_py3.py deleted file mode 100644 index 5714fde0fcd2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/storage_account_properties_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/target.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/target.py deleted file mode 100644 index 228df1d19f00..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/target.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', '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) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/target_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/target_py3.py deleted file mode 100644 index 3b312ee2c0da..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/target_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', '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, name: str=None, version: 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 - self.name = name - self.version = version diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task.py deleted file mode 100644 index 06e2a043e9d6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task.py +++ /dev/null @@ -1,111 +0,0 @@ -# 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 Task(Resource): - """The task that has the ARM resource and task properties. - The task will have all information to schedule a run 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] - :param identity: Identity for the resource. - :type identity: - ~azure.mgmt.containerregistry.v2019_05_01.models.IdentityProperties - :ivar provisioning_state: The provisioning state of the task. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :vartype provisioning_state: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.ProvisioningState - :ivar creation_date: The creation date of task. - :vartype creation_date: datetime - :param status: The current status of task. Possible values include: - 'Disabled', 'Enabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStatus - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param step: Required. The properties of a task step. - :type step: - ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStepProperties - :param trigger: The properties that describe all triggers for the task. - :type trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerProperties - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'platform': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'step': {'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}'}, - 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, - 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, - 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, - } - - def __init__(self, **kwargs): - super(Task, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.creation_date = None - self.status = kwargs.get('status', None) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.timeout = kwargs.get('timeout', 3600) - self.step = kwargs.get('step', None) - self.trigger = kwargs.get('trigger', None) - self.credentials = kwargs.get('credentials', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_paged.py deleted file mode 100644 index 2035e1fbcd2e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 TaskPaged(Paged): - """ - A paging container for iterating over a list of :class:`Task ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Task]'} - } - - def __init__(self, *args, **kwargs): - - super(TaskPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_py3.py deleted file mode 100644 index d1199a4378ea..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_py3.py +++ /dev/null @@ -1,111 +0,0 @@ -# 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_py3 import Resource - - -class Task(Resource): - """The task that has the ARM resource and task properties. - The task will have all information to schedule a run 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] - :param identity: Identity for the resource. - :type identity: - ~azure.mgmt.containerregistry.v2019_05_01.models.IdentityProperties - :ivar provisioning_state: The provisioning state of the task. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :vartype provisioning_state: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.ProvisioningState - :ivar creation_date: The creation date of task. - :vartype creation_date: datetime - :param status: The current status of task. Possible values include: - 'Disabled', 'Enabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStatus - :param platform: Required. The platform properties against which the run - has to happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformProperties - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties - :param timeout: Run timeout in seconds. Default value: 3600 . - :type timeout: int - :param step: Required. The properties of a task step. - :type step: - ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStepProperties - :param trigger: The properties that describe all triggers for the task. - :type trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerProperties - :param credentials: The properties that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'platform': {'required': True}, - 'timeout': {'maximum': 28800, 'minimum': 300}, - 'step': {'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}'}, - 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformProperties'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'step': {'key': 'properties.step', 'type': 'TaskStepProperties'}, - 'trigger': {'key': 'properties.trigger', 'type': 'TriggerProperties'}, - 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, - } - - def __init__(self, *, location: str, platform, step, tags=None, identity=None, status=None, agent_configuration=None, timeout: int=3600, trigger=None, credentials=None, **kwargs) -> None: - super(Task, self).__init__(location=location, tags=tags, **kwargs) - self.identity = identity - self.provisioning_state = None - self.creation_date = None - self.status = status - self.platform = platform - self.agent_configuration = agent_configuration - self.timeout = timeout - self.step = step - self.trigger = trigger - self.credentials = credentials diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_run_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_run_request.py deleted file mode 100644 index 0f4973fb9468..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_run_request.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 .run_request import RunRequest - - -class TaskRunRequest(RunRequest): - """The parameters for a task run request. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param task_name: Required. The name of task against which run has to be - queued. - :type task_name: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - 'task_name': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_name': {'key': 'taskName', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, **kwargs): - super(TaskRunRequest, self).__init__(**kwargs) - self.task_name = kwargs.get('task_name', None) - self.values = kwargs.get('values', None) - self.type = 'TaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_run_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_run_request_py3.py deleted file mode 100644 index d6ab1c310c41..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_run_request_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 .run_request_py3 import RunRequest - - -class TaskRunRequest(RunRequest): - """The parameters for a task run request. - - All required parameters must be populated in order to send to Azure. - - :param is_archive_enabled: The value that indicates whether archiving is - enabled for the run or not. Default value: False . - :type is_archive_enabled: bool - :param type: Required. Constant filled by server. - :type type: str - :param task_name: Required. The name of task against which run has to be - queued. - :type task_name: str - :param values: The collection of overridable values that can be passed - when running a task. - :type values: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SetValue] - """ - - _validation = { - 'type': {'required': True}, - 'task_name': {'required': True}, - } - - _attribute_map = { - 'is_archive_enabled': {'key': 'isArchiveEnabled', 'type': 'bool'}, - 'type': {'key': 'type', 'type': 'str'}, - 'task_name': {'key': 'taskName', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[SetValue]'}, - } - - def __init__(self, *, task_name: str, is_archive_enabled: bool=False, values=None, **kwargs) -> None: - super(TaskRunRequest, self).__init__(is_archive_enabled=is_archive_enabled, **kwargs) - self.task_name = task_name - self.values = values - self.type = 'TaskRunRequest' diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_properties.py deleted file mode 100644 index 8663835f3090..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_properties.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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 TaskStepProperties(Model): - """Base properties for any task step. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildStep, FileTaskStep, EncodedTaskStep - - 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Docker': 'DockerBuildStep', 'FileTask': 'FileTaskStep', 'EncodedTask': 'EncodedTaskStep'} - } - - def __init__(self, **kwargs): - super(TaskStepProperties, self).__init__(**kwargs) - self.base_image_dependencies = None - self.context_path = kwargs.get('context_path', None) - self.context_access_token = kwargs.get('context_access_token', None) - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_properties_py3.py deleted file mode 100644 index 384453ecc306..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_properties_py3.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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 TaskStepProperties(Model): - """Base properties for any task step. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildStep, FileTaskStep, EncodedTaskStep - - 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 base_image_dependencies: List of base image dependencies for a step. - :vartype base_image_dependencies: - list[~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageDependency] - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'base_image_dependencies': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'base_image_dependencies': {'key': 'baseImageDependencies', 'type': '[BaseImageDependency]'}, - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Docker': 'DockerBuildStep', 'FileTask': 'FileTaskStep', 'EncodedTask': 'EncodedTaskStep'} - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, **kwargs) -> None: - super(TaskStepProperties, self).__init__(**kwargs) - self.base_image_dependencies = None - self.context_path = context_path - self.context_access_token = context_access_token - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_update_parameters.py deleted file mode 100644 index a9047fd426b9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_update_parameters.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 TaskStepUpdateParameters(Model): - """Base properties for updating any task step. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildStepUpdateParameters, - FileTaskStepUpdateParameters, EncodedTaskStepUpdateParameters - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Docker': 'DockerBuildStepUpdateParameters', 'FileTask': 'FileTaskStepUpdateParameters', 'EncodedTask': 'EncodedTaskStepUpdateParameters'} - } - - def __init__(self, **kwargs): - super(TaskStepUpdateParameters, self).__init__(**kwargs) - self.context_path = kwargs.get('context_path', None) - self.context_access_token = kwargs.get('context_access_token', None) - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_update_parameters_py3.py deleted file mode 100644 index 70f77214e15b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_step_update_parameters_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 TaskStepUpdateParameters(Model): - """Base properties for updating any task step. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: DockerBuildStepUpdateParameters, - FileTaskStepUpdateParameters, EncodedTaskStepUpdateParameters - - All required parameters must be populated in order to send to Azure. - - :param context_path: The URL(absolute or relative) of the source context - for the task step. - :type context_path: str - :param context_access_token: The token (git PAT or SAS token of storage - account blob) associated with the context for a step. - :type context_access_token: str - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'context_path': {'key': 'contextPath', 'type': 'str'}, - 'context_access_token': {'key': 'contextAccessToken', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Docker': 'DockerBuildStepUpdateParameters', 'FileTask': 'FileTaskStepUpdateParameters', 'EncodedTask': 'EncodedTaskStepUpdateParameters'} - } - - def __init__(self, *, context_path: str=None, context_access_token: str=None, **kwargs) -> None: - super(TaskStepUpdateParameters, self).__init__(**kwargs) - self.context_path = context_path - self.context_access_token = context_access_token - self.type = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_update_parameters.py deleted file mode 100644 index 9e6d2c818b70..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_update_parameters.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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 TaskUpdateParameters(Model): - """The parameters for updating a task. - - :param identity: Identity for the resource. - :type identity: - ~azure.mgmt.containerregistry.v2019_05_01.models.IdentityProperties - :param status: The current status of task. Possible values include: - 'Disabled', 'Enabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStatus - :param platform: The platform properties against which the run has to - happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformUpdateParameters - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties - :param timeout: Run timeout in seconds. - :type timeout: int - :param step: The properties for updating a task step. - :type step: - ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStepUpdateParameters - :param trigger: The properties for updating trigger properties. - :type trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerUpdateParameters - :param credentials: The parameters that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials - :param tags: The ARM resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, - 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, - 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(TaskUpdateParameters, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.status = kwargs.get('status', None) - self.platform = kwargs.get('platform', None) - self.agent_configuration = kwargs.get('agent_configuration', None) - self.timeout = kwargs.get('timeout', None) - self.step = kwargs.get('step', None) - self.trigger = kwargs.get('trigger', None) - self.credentials = kwargs.get('credentials', None) - self.tags = kwargs.get('tags', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_update_parameters_py3.py deleted file mode 100644 index 169fc2ba1594..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/task_update_parameters_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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 TaskUpdateParameters(Model): - """The parameters for updating a task. - - :param identity: Identity for the resource. - :type identity: - ~azure.mgmt.containerregistry.v2019_05_01.models.IdentityProperties - :param status: The current status of task. Possible values include: - 'Disabled', 'Enabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStatus - :param platform: The platform properties against which the run has to - happen. - :type platform: - ~azure.mgmt.containerregistry.v2019_05_01.models.PlatformUpdateParameters - :param agent_configuration: The machine configuration of the run agent. - :type agent_configuration: - ~azure.mgmt.containerregistry.v2019_05_01.models.AgentProperties - :param timeout: Run timeout in seconds. - :type timeout: int - :param step: The properties for updating a task step. - :type step: - ~azure.mgmt.containerregistry.v2019_05_01.models.TaskStepUpdateParameters - :param trigger: The properties for updating trigger properties. - :type trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerUpdateParameters - :param credentials: The parameters that describes a set of credentials - that will be used when this run is invoked. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01.models.Credentials - :param tags: The ARM resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'platform': {'key': 'properties.platform', 'type': 'PlatformUpdateParameters'}, - 'agent_configuration': {'key': 'properties.agentConfiguration', 'type': 'AgentProperties'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'step': {'key': 'properties.step', 'type': 'TaskStepUpdateParameters'}, - 'trigger': {'key': 'properties.trigger', 'type': 'TriggerUpdateParameters'}, - 'credentials': {'key': 'properties.credentials', 'type': 'Credentials'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, identity=None, status=None, platform=None, agent_configuration=None, timeout: int=None, step=None, trigger=None, credentials=None, tags=None, **kwargs) -> None: - super(TaskUpdateParameters, self).__init__(**kwargs) - self.identity = identity - self.status = status - self.platform = platform - self.agent_configuration = agent_configuration - self.timeout = timeout - self.step = step - self.trigger = trigger - self.credentials = credentials - self.tags = tags diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger.py deleted file mode 100644 index 8d1ece676ff3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 TimerTrigger(Model): - """The properties of a timer trigger. - - All required parameters must be populated in order to send to Azure. - - :param schedule: Required. The CRON expression for the task schedule - :type schedule: str - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'schedule': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'schedule': {'key': 'schedule', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TimerTrigger, self).__init__(**kwargs) - self.schedule = kwargs.get('schedule', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_descriptor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_descriptor.py deleted file mode 100644 index 8993d44e2775..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_descriptor.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 TimerTriggerDescriptor(Model): - """TimerTriggerDescriptor. - - :param timer_trigger_name: The timer trigger name that caused the run. - :type timer_trigger_name: str - :param schedule_occurrence: The occurrence that triggered the run. - :type schedule_occurrence: str - """ - - _attribute_map = { - 'timer_trigger_name': {'key': 'timerTriggerName', 'type': 'str'}, - 'schedule_occurrence': {'key': 'scheduleOccurrence', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TimerTriggerDescriptor, self).__init__(**kwargs) - self.timer_trigger_name = kwargs.get('timer_trigger_name', None) - self.schedule_occurrence = kwargs.get('schedule_occurrence', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_descriptor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_descriptor_py3.py deleted file mode 100644 index d2768782fb37..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_descriptor_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 TimerTriggerDescriptor(Model): - """TimerTriggerDescriptor. - - :param timer_trigger_name: The timer trigger name that caused the run. - :type timer_trigger_name: str - :param schedule_occurrence: The occurrence that triggered the run. - :type schedule_occurrence: str - """ - - _attribute_map = { - 'timer_trigger_name': {'key': 'timerTriggerName', 'type': 'str'}, - 'schedule_occurrence': {'key': 'scheduleOccurrence', 'type': 'str'}, - } - - def __init__(self, *, timer_trigger_name: str=None, schedule_occurrence: str=None, **kwargs) -> None: - super(TimerTriggerDescriptor, self).__init__(**kwargs) - self.timer_trigger_name = timer_trigger_name - self.schedule_occurrence = schedule_occurrence diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_py3.py deleted file mode 100644 index 4f1a476c270e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 TimerTrigger(Model): - """The properties of a timer trigger. - - All required parameters must be populated in order to send to Azure. - - :param schedule: Required. The CRON expression for the task schedule - :type schedule: str - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'schedule': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'schedule': {'key': 'schedule', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, schedule: str, name: str, status="Enabled", **kwargs) -> None: - super(TimerTrigger, self).__init__(**kwargs) - self.schedule = schedule - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_update_parameters.py deleted file mode 100644 index a4efae5602b4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_update_parameters.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 TimerTriggerUpdateParameters(Model): - """The properties for updating a timer trigger. - - All required parameters must be populated in order to send to Azure. - - :param schedule: The CRON expression for the task schedule - :type schedule: str - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'schedule': {'key': 'schedule', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TimerTriggerUpdateParameters, self).__init__(**kwargs) - self.schedule = kwargs.get('schedule', None) - self.status = kwargs.get('status', "Enabled") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_update_parameters_py3.py deleted file mode 100644 index ee98d2b49306..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/timer_trigger_update_parameters_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 TimerTriggerUpdateParameters(Model): - """The properties for updating a timer trigger. - - All required parameters must be populated in order to send to Azure. - - :param schedule: The CRON expression for the task schedule - :type schedule: str - :param status: The current status of trigger. Possible values include: - 'Disabled', 'Enabled'. Default value: "Enabled" . - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TriggerStatus - :param name: Required. The name of the trigger. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'schedule': {'key': 'schedule', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, name: str, schedule: str=None, status="Enabled", **kwargs) -> None: - super(TimerTriggerUpdateParameters, self).__init__(**kwargs) - self.schedule = schedule - self.status = status - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trigger_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trigger_properties.py deleted file mode 100644 index 2c2420c7a86e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trigger_properties.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 TriggerProperties(Model): - """The properties of a trigger. - - :param timer_triggers: The collection of timer triggers. - :type timer_triggers: - list[~azure.mgmt.containerregistry.v2019_05_01.models.TimerTrigger] - :param source_triggers: The collection of triggers based on source code - repository. - :type source_triggers: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SourceTrigger] - :param base_image_trigger: The trigger based on base image dependencies. - :type base_image_trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTrigger - """ - - _attribute_map = { - 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTrigger]'}, - 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTrigger]'}, - 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTrigger'}, - } - - def __init__(self, **kwargs): - super(TriggerProperties, self).__init__(**kwargs) - self.timer_triggers = kwargs.get('timer_triggers', None) - self.source_triggers = kwargs.get('source_triggers', None) - self.base_image_trigger = kwargs.get('base_image_trigger', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trigger_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trigger_properties_py3.py deleted file mode 100644 index efada1e923f2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trigger_properties_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 TriggerProperties(Model): - """The properties of a trigger. - - :param timer_triggers: The collection of timer triggers. - :type timer_triggers: - list[~azure.mgmt.containerregistry.v2019_05_01.models.TimerTrigger] - :param source_triggers: The collection of triggers based on source code - repository. - :type source_triggers: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SourceTrigger] - :param base_image_trigger: The trigger based on base image dependencies. - :type base_image_trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTrigger - """ - - _attribute_map = { - 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTrigger]'}, - 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTrigger]'}, - 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTrigger'}, - } - - def __init__(self, *, timer_triggers=None, source_triggers=None, base_image_trigger=None, **kwargs) -> None: - super(TriggerProperties, self).__init__(**kwargs) - self.timer_triggers = timer_triggers - self.source_triggers = source_triggers - self.base_image_trigger = base_image_trigger diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trigger_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trigger_update_parameters.py deleted file mode 100644 index 58617252233b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trigger_update_parameters.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 TriggerUpdateParameters(Model): - """The properties for updating triggers. - - :param timer_triggers: The collection of timer triggers. - :type timer_triggers: - list[~azure.mgmt.containerregistry.v2019_05_01.models.TimerTriggerUpdateParameters] - :param source_triggers: The collection of triggers based on source code - repository. - :type source_triggers: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerUpdateParameters] - :param base_image_trigger: The trigger based on base image dependencies. - :type base_image_trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTriggerUpdateParameters - """ - - _attribute_map = { - 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTriggerUpdateParameters]'}, - 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTriggerUpdateParameters]'}, - 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTriggerUpdateParameters'}, - } - - def __init__(self, **kwargs): - super(TriggerUpdateParameters, self).__init__(**kwargs) - self.timer_triggers = kwargs.get('timer_triggers', None) - self.source_triggers = kwargs.get('source_triggers', None) - self.base_image_trigger = kwargs.get('base_image_trigger', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trigger_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trigger_update_parameters_py3.py deleted file mode 100644 index 8df8ab193bce..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trigger_update_parameters_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 TriggerUpdateParameters(Model): - """The properties for updating triggers. - - :param timer_triggers: The collection of timer triggers. - :type timer_triggers: - list[~azure.mgmt.containerregistry.v2019_05_01.models.TimerTriggerUpdateParameters] - :param source_triggers: The collection of triggers based on source code - repository. - :type source_triggers: - list[~azure.mgmt.containerregistry.v2019_05_01.models.SourceTriggerUpdateParameters] - :param base_image_trigger: The trigger based on base image dependencies. - :type base_image_trigger: - ~azure.mgmt.containerregistry.v2019_05_01.models.BaseImageTriggerUpdateParameters - """ - - _attribute_map = { - 'timer_triggers': {'key': 'timerTriggers', 'type': '[TimerTriggerUpdateParameters]'}, - 'source_triggers': {'key': 'sourceTriggers', 'type': '[SourceTriggerUpdateParameters]'}, - 'base_image_trigger': {'key': 'baseImageTrigger', 'type': 'BaseImageTriggerUpdateParameters'}, - } - - def __init__(self, *, timer_triggers=None, source_triggers=None, base_image_trigger=None, **kwargs) -> None: - super(TriggerUpdateParameters, self).__init__(**kwargs) - self.timer_triggers = timer_triggers - self.source_triggers = source_triggers - self.base_image_trigger = base_image_trigger diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trust_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trust_policy.py deleted file mode 100644 index b5b31820b59f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trust_policy.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TrustPolicy(Model): - """The content trust policy for a container registry. - - :param type: The type of trust policy. Possible values include: 'Notary' - :type type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TrustPolicyType - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrustPolicy, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trust_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trust_policy_py3.py deleted file mode 100644 index af53096f6cde..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/trust_policy_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TrustPolicy(Model): - """The content trust policy for a container registry. - - :param type: The type of trust policy. Possible values include: 'Notary' - :type type: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.TrustPolicyType - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.PolicyStatus - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, type=None, status=None, **kwargs) -> None: - super(TrustPolicy, self).__init__(**kwargs) - self.type = type - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/user_identity_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/user_identity_properties.py deleted file mode 100644 index 1f93d39ec2b7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/user_identity_properties.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 UserIdentityProperties(Model): - """UserIdentityProperties. - - :param principal_id: The principal id of user assigned identity. - :type principal_id: str - :param client_id: The client id of user assigned identity. - :type client_id: str - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UserIdentityProperties, self).__init__(**kwargs) - self.principal_id = kwargs.get('principal_id', None) - self.client_id = kwargs.get('client_id', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/user_identity_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/user_identity_properties_py3.py deleted file mode 100644 index 7897fcec7758..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/user_identity_properties_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 UserIdentityProperties(Model): - """UserIdentityProperties. - - :param principal_id: The principal id of user assigned identity. - :type principal_id: str - :param client_id: The client id of user assigned identity. - :type client_id: str - """ - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__(self, *, principal_id: str=None, client_id: str=None, **kwargs) -> None: - super(UserIdentityProperties, self).__init__(**kwargs) - self.principal_id = principal_id - self.client_id = client_id diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/virtual_network_rule.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/virtual_network_rule.py deleted file mode 100644 index b00c33ca886c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/virtual_network_rule.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual network rule. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.Action - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.action = kwargs.get('action', "Allow") - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/virtual_network_rule_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/virtual_network_rule_py3.py deleted file mode 100644 index 685d77093666..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual network rule. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2019_05_01.models.Action - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.action = action - self.virtual_network_resource_id = virtual_network_resource_id diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook.py deleted file mode 100644 index b94d89aded96..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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.v2019_05_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.v2019_05_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.v2019_05_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_create_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_create_parameters.py deleted file mode 100644 index ed0f36112053..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_create_parameters.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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.v2019_05_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.v2019_05_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_create_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_create_parameters_py3.py deleted file mode 100644 index edd5cab994c4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_create_parameters_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_paged.py deleted file mode 100644 index 9b7f6ca2948d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_py3.py deleted file mode 100644 index 397da228a553..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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_py3 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.v2019_05_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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_update_parameters.py deleted file mode 100644 index 0c28b60a43a2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_update_parameters.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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.v2019_05_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.v2019_05_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, **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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_update_parameters_py3.py deleted file mode 100644 index b87cd9310c1e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/webhook_update_parameters_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/__init__.py index d9dadb00c503..b05c49580519 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/__init__.py @@ -9,12 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from .registries_operations import RegistriesOperations -from .operations import Operations -from .replications_operations import ReplicationsOperations -from .webhooks_operations import WebhooksOperations -from .runs_operations import RunsOperations -from .tasks_operations import TasksOperations +from ._registries_operations import RegistriesOperations +from ._operations import Operations +from ._replications_operations import ReplicationsOperations +from ._webhooks_operations import WebhooksOperations +from ._runs_operations import RunsOperations +from ._tasks_operations import TasksOperations __all__ = [ 'RegistriesOperations', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_operations.py new file mode 100644 index 000000000000..01d3d9968c91 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_operations.py @@ -0,0 +1,103 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2019-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-05-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.v2019_05_01.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2019_05_01.models.OperationDefinition] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.ContainerRegistry/operations'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_registries_operations.py new file mode 100644 index 000000000000..e70682e45994 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_registries_operations.py @@ -0,0 +1,1078 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 _import_image_initial( + self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2019-05-01" + + # Construct URL + url = self.import_image.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', min_length=1), + '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(parameters, 'ImportImageParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 import_image( + self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Copies an image to this container registry from 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 parameters: The parameters specifying the image to copy and the + source container registry. + :type parameters: + ~azure.mgmt.containerregistry.v2019_05_01.models.ImportImageParameters + :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._import_image_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + parameters=parameters, + 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) + import_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage'} + + 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.v2019_05_01.models.RegistryNameStatus or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + registry_name_check_request = models.RegistryNameCheckRequest(name=name) + + api_version = "2019-05-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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_01.models.Registry or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2019-05-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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 = "2019-05-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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_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.v2019_05_01.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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) + 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 = "2019-05-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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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 = "2019-05-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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_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.v2019_05_01.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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 + ) + + 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.v2019_05_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2019_05_01.models.Registry] + :raises: :class:`CloudError` + """ + api_version = "2019-05-01" + + def prepare_request(next_link=None): + 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', min_length=1) + } + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2019_05_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2019_05_01.models.Registry] + :raises: :class:`CloudError` + """ + api_version = "2019-05-01" + + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2019_05_01.models.RegistryListCredentialsResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2019-05-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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2019_05_01.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.v2019_05_01.models.RegistryListCredentialsResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_credential_parameters = models.RegenerateCredentialParameters(name=name) + + api_version = "2019-05-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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_01.models.RegistryUsageListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2019-05-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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 _schedule_run_initial( + self, resource_group_name, registry_name, run_request, custom_headers=None, raw=False, **operation_config): + api_version = "2019-04-01" + + # Construct URL + url = self.schedule_run.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', min_length=1), + '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['Accept'] = 'application/json' + 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(run_request, 'RunRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Run', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def schedule_run( + self, resource_group_name, registry_name, run_request, custom_headers=None, raw=False, polling=True, **operation_config): + """Schedules a new run based on the request parameters and add it to the + run 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 run_request: The parameters of a run that needs to scheduled. + :type run_request: + ~azure.mgmt.containerregistry.v2019_05_01.models.RunRequest + :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 Run or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01.models.Run] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01.models.Run]] + :raises: :class:`CloudError` + """ + raw_result = self._schedule_run_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + run_request=run_request, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Run', 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) + schedule_run.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun'} + + 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.v2019_05_01.models.SourceUploadDefinition + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2019-04-01" + + # 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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}/listBuildSourceUploadUrl'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_replications_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_replications_operations.py new file mode 100644 index 000000000000..5070b7781a53 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2019-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-05-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.v2019_05_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_01.models.Replication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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 = 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_01.models.Replication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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 + ) + + 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.v2019_05_01.models.ReplicationPaged[~azure.mgmt.containerregistry.v2019_05_01.models.Replication] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.ReplicationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_runs_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_runs_operations.py new file mode 100644 index 000000000000..8a6e18023d49 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_runs_operations.py @@ -0,0 +1,452 @@ +# 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 RunsOperations(object): + """RunsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, resource_group_name, registry_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Gets all the runs 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 runs filter to apply on the operation. Arithmetic + operators are not supported. The allowed string function is + 'contains'. All logical operators except 'Not', 'Has', 'All' are + allowed. + :type filter: str + :param top: $top is supported for get list of runs, which limits the + maximum number of runs to return. + :type top: int + :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 Run + :rtype: + ~azure.mgmt.containerregistry.v2019_05_01.models.RunPaged[~azure.mgmt.containerregistry.v2019_05_01.models.Run] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RunPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs'} + + def get( + self, resource_group_name, registry_name, run_id, custom_headers=None, raw=False, **operation_config): + """Gets the detailed information for a given run. + + :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 run_id: The run ID. + :type run_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: Run or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerregistry.v2019_05_01.models.Run 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Run', 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}/runs/{runId}'} + + + def _update_initial( + self, resource_group_name, registry_name, run_id, is_archive_enabled=None, custom_headers=None, raw=False, **operation_config): + run_update_parameters = models.RunUpdateParameters(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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' + 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(run_update_parameters, 'RunUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Run', response) + if response.status_code == 201: + deserialized = self._deserialize('Run', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, run_id, is_archive_enabled=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Patch the run 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 run_id: The run ID. + :type run_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 Run or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01.models.Run] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01.models.Run]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + run_id=run_id, + is_archive_enabled=is_archive_enabled, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Run', 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}/runs/{runId}'} + + def get_log_sas_url( + self, resource_group_name, registry_name, run_id, custom_headers=None, raw=False, **operation_config): + """Gets a link to download the run 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 run_id: The run ID. + :type run_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: RunGetLogResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2019_05_01.models.RunGetLogResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_log_sas_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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('RunGetLogResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_log_sas_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl'} + + + def _cancel_initial( + self, resource_group_name, registry_name, run_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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'runId': self._serialize.url("run_id", run_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 = {} + 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, header_parameters) + response = self._client.send(request, 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, run_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Cancel an existing run. + + :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 run_id: The run ID. + :type run_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, + run_id=run_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}/runs/{runId}/cancel'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_tasks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_tasks_operations.py new file mode 100644 index 000000000000..f837d1e24cfc --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_tasks_operations.py @@ -0,0 +1,545 @@ +# 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 TasksOperations(object): + """TasksOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists all the 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 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 Task + :rtype: + ~azure.mgmt.containerregistry.v2019_05_01.models.TaskPaged[~azure.mgmt.containerregistry.v2019_05_01.models.Task] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.TaskPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks'} + + def get( + self, resource_group_name, registry_name, task_name, custom_headers=None, raw=False, **operation_config): + """Get the properties of a specified 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 task_name: The name of the container registry task. + :type 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: Task or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerregistry.v2019_05_01.models.Task 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Task', 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}/tasks/{taskName}'} + + + def _create_initial( + self, resource_group_name, registry_name, task_name, 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' + 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(task_create_parameters, 'Task') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Task', response) + if response.status_code == 201: + deserialized = self._deserialize('Task', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, task_name, task_create_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a 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 task_name: The name of the container registry task. + :type task_name: str + :param task_create_parameters: The parameters for creating a task. + :type task_create_parameters: + ~azure.mgmt.containerregistry.v2019_05_01.models.Task + :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 Task or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01.models.Task] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01.models.Task]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + task_name=task_name, + task_create_parameters=task_create_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Task', 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}/tasks/{taskName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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 = {} + 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, header_parameters) + response = self._client.send(request, 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, task_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a specified 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 task_name: The name of the container registry task. + :type 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, + task_name=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}/tasks/{taskName}'} + + + def _update_initial( + self, resource_group_name, registry_name, task_name, 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' + 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(task_update_parameters, 'TaskUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Task', response) + if response.status_code == 201: + deserialized = self._deserialize('Task', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, task_name, task_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a 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 task_name: The name of the container registry task. + :type task_name: str + :param task_update_parameters: The parameters for updating a task. + :type task_update_parameters: + ~azure.mgmt.containerregistry.v2019_05_01.models.TaskUpdateParameters + :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 Task or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01.models.Task] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01.models.Task]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + task_name=task_name, + task_update_parameters=task_update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Task', 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}/tasks/{taskName}'} + + def get_details( + self, resource_group_name, registry_name, task_name, custom_headers=None, raw=False, **operation_config): + """Returns a task with extended information that includes all secrets. + + :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 task_name: The name of the container registry task. + :type 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: Task or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerregistry.v2019_05_01.models.Task or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_details.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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Task', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_webhooks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_webhooks_operations.py new file mode 100644 index 000000000000..d2e59a805668 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/_webhooks_operations.py @@ -0,0 +1,691 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2019-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-05-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.v2019_05_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_01.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.v2019_05_01.models.Webhook] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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 = 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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_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.v2019_05_01.models.Webhook] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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 + ) + + 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.v2019_05_01.models.WebhookPaged[~azure.mgmt.containerregistry.v2019_05_01.models.Webhook] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.WebhookPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2019_05_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2019_05_01.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2019_05_01.models.EventPaged[~azure.mgmt.containerregistry.v2019_05_01.models.Event] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.EventPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_events.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/operations.py deleted file mode 100644 index 66744ecc0aa3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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: "2019-05-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-05-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.v2019_05_01.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2019_05_01.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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/registries_operations.py deleted file mode 100644 index 40cbad45594f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/registries_operations.py +++ /dev/null @@ -1,1078 +0,0 @@ -# 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 _import_image_initial( - self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2019-05-01" - - # Construct URL - url = self.import_image.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', min_length=1), - '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(parameters, 'ImportImageParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 import_image( - self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Copies an image to this container registry from 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 parameters: The parameters specifying the image to copy and the - source container registry. - :type parameters: - ~azure.mgmt.containerregistry.v2019_05_01.models.ImportImageParameters - :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._import_image_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - parameters=parameters, - 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) - import_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage'} - - 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.v2019_05_01.models.RegistryNameStatus or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - registry_name_check_request = models.RegistryNameCheckRequest(name=name) - - api_version = "2019-05-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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_01.models.Registry or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-05-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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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 = "2019-05-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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_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.v2019_05_01.models.Registry] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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) - 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 = "2019-05-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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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 = "2019-05-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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_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.v2019_05_01.models.Registry] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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 - ) - - 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.v2019_05_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2019_05_01.models.Registry] - :raises: :class:`CloudError` - """ - api_version = "2019-05-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', min_length=1) - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_05_01.models.RegistryPaged[~azure.mgmt.containerregistry.v2019_05_01.models.Registry] - :raises: :class:`CloudError` - """ - api_version = "2019-05-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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_05_01.models.RegistryListCredentialsResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-05-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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_05_01.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.v2019_05_01.models.RegistryListCredentialsResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_credential_parameters = models.RegenerateCredentialParameters(name=name) - - api_version = "2019-05-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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_01.models.RegistryUsageListResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-05-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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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 _schedule_run_initial( - self, resource_group_name, registry_name, run_request, custom_headers=None, raw=False, **operation_config): - api_version = "2019-04-01" - - # Construct URL - url = self.schedule_run.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', min_length=1), - '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['Accept'] = 'application/json' - 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(run_request, 'RunRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Run', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def schedule_run( - self, resource_group_name, registry_name, run_request, custom_headers=None, raw=False, polling=True, **operation_config): - """Schedules a new run based on the request parameters and add it to the - run 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 run_request: The parameters of a run that needs to scheduled. - :type run_request: - ~azure.mgmt.containerregistry.v2019_05_01.models.RunRequest - :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 Run or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01.models.Run] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01.models.Run]] - :raises: :class:`CloudError` - """ - raw_result = self._schedule_run_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - run_request=run_request, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Run', 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) - schedule_run.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun'} - - 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.v2019_05_01.models.SourceUploadDefinition - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2019-04-01" - - # 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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}/listBuildSourceUploadUrl'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/replications_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/replications_operations.py deleted file mode 100644 index db36d4de9b3e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/replications_operations.py +++ /dev/null @@ -1,485 +0,0 @@ -# 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: "2019-05-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-05-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.v2019_05_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_01.models.Replication] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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 = 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_01.models.Replication] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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 - ) - - 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.v2019_05_01.models.ReplicationPaged[~azure.mgmt.containerregistry.v2019_05_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/runs_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/runs_operations.py deleted file mode 100644 index d19dd3b45102..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/runs_operations.py +++ /dev/null @@ -1,450 +0,0 @@ -# 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 RunsOperations(object): - """RunsOperations 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: "2019-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01" - - self.config = config - - def list( - self, resource_group_name, registry_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): - """Gets all the runs 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 runs filter to apply on the operation. Arithmetic - operators are not supported. The allowed string function is - 'contains'. All logical operators except 'Not', 'Has', 'All' are - allowed. - :type filter: str - :param top: $top is supported for get list of runs, which limits the - maximum number of runs to return. - :type top: int - :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 Run - :rtype: - ~azure.mgmt.containerregistry.v2019_05_01.models.RunPaged[~azure.mgmt.containerregistry.v2019_05_01.models.Run] - :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', min_length=1), - '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') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.RunPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.RunPaged(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}/runs'} - - def get( - self, resource_group_name, registry_name, run_id, custom_headers=None, raw=False, **operation_config): - """Gets the detailed information for a given run. - - :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 run_id: The run ID. - :type run_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: Run or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerregistry.v2019_05_01.models.Run 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('Run', 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}/runs/{runId}'} - - - def _update_initial( - self, resource_group_name, registry_name, run_id, is_archive_enabled=None, custom_headers=None, raw=False, **operation_config): - run_update_parameters = models.RunUpdateParameters(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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' - 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(run_update_parameters, 'RunUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Run', response) - if response.status_code == 201: - deserialized = self._deserialize('Run', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, registry_name, run_id, is_archive_enabled=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Patch the run 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 run_id: The run ID. - :type run_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 Run or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01.models.Run] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01.models.Run]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - run_id=run_id, - is_archive_enabled=is_archive_enabled, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Run', 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}/runs/{runId}'} - - def get_log_sas_url( - self, resource_group_name, registry_name, run_id, custom_headers=None, raw=False, **operation_config): - """Gets a link to download the run 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 run_id: The run ID. - :type run_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: RunGetLogResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerregistry.v2019_05_01.models.RunGetLogResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_log_sas_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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'runId': self._serialize.url("run_id", run_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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('RunGetLogResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_log_sas_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl'} - - - def _cancel_initial( - self, resource_group_name, registry_name, run_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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'runId': self._serialize.url("run_id", run_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 = {} - 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, header_parameters) - response = self._client.send(request, 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, run_id, custom_headers=None, raw=False, polling=True, **operation_config): - """Cancel an existing run. - - :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 run_id: The run ID. - :type run_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, - run_id=run_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}/runs/{runId}/cancel'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/tasks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/tasks_operations.py deleted file mode 100644 index 2feead88b275..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/tasks_operations.py +++ /dev/null @@ -1,543 +0,0 @@ -# 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 TasksOperations(object): - """TasksOperations 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: "2019-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01" - - self.config = config - - def list( - self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): - """Lists all the 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 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 Task - :rtype: - ~azure.mgmt.containerregistry.v2019_05_01.models.TaskPaged[~azure.mgmt.containerregistry.v2019_05_01.models.Task] - :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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.TaskPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.TaskPaged(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}/tasks'} - - def get( - self, resource_group_name, registry_name, task_name, custom_headers=None, raw=False, **operation_config): - """Get the properties of a specified 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 task_name: The name of the container registry task. - :type 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: Task or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerregistry.v2019_05_01.models.Task 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('Task', 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}/tasks/{taskName}'} - - - def _create_initial( - self, resource_group_name, registry_name, task_name, 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' - 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(task_create_parameters, 'Task') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Task', response) - if response.status_code == 201: - deserialized = self._deserialize('Task', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, registry_name, task_name, task_create_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates a 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 task_name: The name of the container registry task. - :type task_name: str - :param task_create_parameters: The parameters for creating a task. - :type task_create_parameters: - ~azure.mgmt.containerregistry.v2019_05_01.models.Task - :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 Task or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01.models.Task] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01.models.Task]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - task_name=task_name, - task_create_parameters=task_create_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Task', 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}/tasks/{taskName}'} - - - def _delete_initial( - self, resource_group_name, registry_name, 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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 = {} - 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, header_parameters) - response = self._client.send(request, 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, task_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes a specified 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 task_name: The name of the container registry task. - :type 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, - task_name=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}/tasks/{taskName}'} - - - def _update_initial( - self, resource_group_name, registry_name, task_name, 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' - 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(task_update_parameters, 'TaskUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Task', response) - if response.status_code == 201: - deserialized = self._deserialize('Task', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, registry_name, task_name, task_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates a 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 task_name: The name of the container registry task. - :type task_name: str - :param task_update_parameters: The parameters for updating a task. - :type task_update_parameters: - ~azure.mgmt.containerregistry.v2019_05_01.models.TaskUpdateParameters - :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 Task or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01.models.Task] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01.models.Task]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - task_name=task_name, - task_update_parameters=task_update_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Task', 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}/tasks/{taskName}'} - - def get_details( - self, resource_group_name, registry_name, task_name, custom_headers=None, raw=False, **operation_config): - """Returns a task with extended information that includes all secrets. - - :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 task_name: The name of the container registry task. - :type 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: Task or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerregistry.v2019_05_01.models.Task or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_details.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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'taskName': self._serialize.url("task_name", 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('Task', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/webhooks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/webhooks_operations.py deleted file mode 100644 index cb7b7269eb33..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/operations/webhooks_operations.py +++ /dev/null @@ -1,688 +0,0 @@ -# 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: "2019-05-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-05-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.v2019_05_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_01.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.v2019_05_01.models.Webhook] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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 = 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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_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.v2019_05_01.models.Webhook] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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 - ) - - 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.v2019_05_01.models.WebhookPaged[~azure.mgmt.containerregistry.v2019_05_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_05_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_05_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_05_01.models.EventPaged[~azure.mgmt.containerregistry.v2019_05_01.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/__init__.py index 511d3d37a4aa..81ad2ac1ed64 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .container_registry_management_client import ContainerRegistryManagementClient -from .version import VERSION +from ._configuration import ContainerRegistryManagementClientConfiguration +from ._container_registry_management_client import ContainerRegistryManagementClient +__all__ = ['ContainerRegistryManagementClient', 'ContainerRegistryManagementClientConfiguration'] -__all__ = ['ContainerRegistryManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/_configuration.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/_configuration.py new file mode 100644 index 000000000000..4e021787210f --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +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) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + 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 diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/_container_registry_management_client.py new file mode 100644 index 000000000000..337600bbbf8e --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/_container_registry_management_client.py @@ -0,0 +1,73 @@ +# 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 ._configuration import ContainerRegistryManagementClientConfiguration +from .operations import RegistriesOperations +from .operations import Operations +from .operations import ReplicationsOperations +from .operations import WebhooksOperations +from .operations import ScopeMapsOperations +from .operations import TokensOperations +from . import models + + +class ContainerRegistryManagementClient(SDKClient): + """ContainerRegistryManagementClient + + :ivar config: Configuration for client. + :vartype config: ContainerRegistryManagementClientConfiguration + + :ivar registries: Registries operations + :vartype registries: azure.mgmt.containerregistry.v2019_05_01_preview.operations.RegistriesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerregistry.v2019_05_01_preview.operations.Operations + :ivar replications: Replications operations + :vartype replications: azure.mgmt.containerregistry.v2019_05_01_preview.operations.ReplicationsOperations + :ivar webhooks: Webhooks operations + :vartype webhooks: azure.mgmt.containerregistry.v2019_05_01_preview.operations.WebhooksOperations + :ivar scope_maps: ScopeMaps operations + :vartype scope_maps: azure.mgmt.containerregistry.v2019_05_01_preview.operations.ScopeMapsOperations + :ivar tokens: Tokens operations + :vartype tokens: azure.mgmt.containerregistry.v2019_05_01_preview.operations.TokensOperations + + :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.scope_maps = ScopeMapsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tokens = TokensOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/container_registry_management_client.py deleted file mode 100644 index a1e24e19fc02..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/container_registry_management_client.py +++ /dev/null @@ -1,105 +0,0 @@ -# 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.scope_maps_operations import ScopeMapsOperations -from .operations.tokens_operations import TokensOperations -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.v2019_05_01_preview.operations.RegistriesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.containerregistry.v2019_05_01_preview.operations.Operations - :ivar replications: Replications operations - :vartype replications: azure.mgmt.containerregistry.v2019_05_01_preview.operations.ReplicationsOperations - :ivar webhooks: Webhooks operations - :vartype webhooks: azure.mgmt.containerregistry.v2019_05_01_preview.operations.WebhooksOperations - :ivar scope_maps: ScopeMaps operations - :vartype scope_maps: azure.mgmt.containerregistry.v2019_05_01_preview.operations.ScopeMapsOperations - :ivar tokens: Tokens operations - :vartype tokens: azure.mgmt.containerregistry.v2019_05_01_preview.operations.TokensOperations - - :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.scope_maps = ScopeMapsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.tokens = TokensOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/__init__.py index 8072719d02b7..632004dc6fb7 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/__init__.py @@ -10,117 +10,117 @@ # -------------------------------------------------------------------------- try: - from .import_source_credentials_py3 import ImportSourceCredentials - from .import_source_py3 import ImportSource - from .import_image_parameters_py3 import ImportImageParameters - from .registry_name_check_request_py3 import RegistryNameCheckRequest - from .registry_name_status_py3 import RegistryNameStatus - from .operation_display_definition_py3 import OperationDisplayDefinition - from .operation_metric_specification_definition_py3 import OperationMetricSpecificationDefinition - from .operation_service_specification_definition_py3 import OperationServiceSpecificationDefinition - from .operation_definition_py3 import OperationDefinition - from .sku_py3 import Sku - from .status1_py3 import Status1 - from .storage_account_properties_py3 import StorageAccountProperties - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - 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 .quarantine_policy_py3 import QuarantinePolicy - from .trust_policy_py3 import TrustPolicy - from .registry_policies_py3 import RegistryPolicies - 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 .scope_map_py3 import ScopeMap - from .scope_map_update_parameters_py3 import ScopeMapUpdateParameters - from .token_certificate_py3 import TokenCertificate - from .token_password_py3 import TokenPassword - from .token_credentials_properties_py3 import TokenCredentialsProperties - from .token_py3 import Token - from .token_update_parameters_py3 import TokenUpdateParameters - from .generate_credentials_parameters_py3 import GenerateCredentialsParameters - from .generate_credentials_result_py3 import GenerateCredentialsResult - from .proxy_resource_py3 import ProxyResource + from ._models_py3 import Actor + from ._models_py3 import CallbackConfig + from ._models_py3 import Event + from ._models_py3 import EventContent + from ._models_py3 import EventInfo + from ._models_py3 import EventRequestMessage + from ._models_py3 import EventResponseMessage + from ._models_py3 import GenerateCredentialsParameters + from ._models_py3 import GenerateCredentialsResult + from ._models_py3 import ImportImageParameters + from ._models_py3 import ImportSource + from ._models_py3 import ImportSourceCredentials + from ._models_py3 import IPRule + from ._models_py3 import NetworkRuleSet + from ._models_py3 import OperationDefinition + from ._models_py3 import OperationDisplayDefinition + from ._models_py3 import OperationMetricSpecificationDefinition + from ._models_py3 import OperationServiceSpecificationDefinition + from ._models_py3 import ProxyResource + from ._models_py3 import QuarantinePolicy + from ._models_py3 import RegenerateCredentialParameters + from ._models_py3 import Registry + from ._models_py3 import RegistryListCredentialsResult + from ._models_py3 import RegistryNameCheckRequest + from ._models_py3 import RegistryNameStatus + from ._models_py3 import RegistryPassword + from ._models_py3 import RegistryPolicies + from ._models_py3 import RegistryUpdateParameters + from ._models_py3 import RegistryUsage + from ._models_py3 import RegistryUsageListResult + from ._models_py3 import Replication + from ._models_py3 import ReplicationUpdateParameters + from ._models_py3 import Request + from ._models_py3 import Resource + from ._models_py3 import ScopeMap + from ._models_py3 import ScopeMapUpdateParameters + from ._models_py3 import Sku + from ._models_py3 import Source + from ._models_py3 import Status1 + from ._models_py3 import StorageAccountProperties + from ._models_py3 import Target + from ._models_py3 import Token + from ._models_py3 import TokenCertificate + from ._models_py3 import TokenCredentialsProperties + from ._models_py3 import TokenPassword + from ._models_py3 import TokenUpdateParameters + from ._models_py3 import TrustPolicy + from ._models_py3 import VirtualNetworkRule + from ._models_py3 import Webhook + from ._models_py3 import WebhookCreateParameters + from ._models_py3 import WebhookUpdateParameters except (SyntaxError, ImportError): - from .import_source_credentials import ImportSourceCredentials - from .import_source import ImportSource - from .import_image_parameters import ImportImageParameters - from .registry_name_check_request import RegistryNameCheckRequest - from .registry_name_status import RegistryNameStatus - from .operation_display_definition import OperationDisplayDefinition - from .operation_metric_specification_definition import OperationMetricSpecificationDefinition - from .operation_service_specification_definition import OperationServiceSpecificationDefinition - from .operation_definition import OperationDefinition - from .sku import Sku - from .status1 import Status1 - from .storage_account_properties import StorageAccountProperties - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - 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 .quarantine_policy import QuarantinePolicy - from .trust_policy import TrustPolicy - from .registry_policies import RegistryPolicies - 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 .scope_map import ScopeMap - from .scope_map_update_parameters import ScopeMapUpdateParameters - from .token_certificate import TokenCertificate - from .token_password import TokenPassword - from .token_credentials_properties import TokenCredentialsProperties - from .token import Token - from .token_update_parameters import TokenUpdateParameters - from .generate_credentials_parameters import GenerateCredentialsParameters - from .generate_credentials_result import GenerateCredentialsResult - from .proxy_resource import ProxyResource -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 .scope_map_paged import ScopeMapPaged -from .token_paged import TokenPaged -from .container_registry_management_client_enums import ( + from ._models import Actor + from ._models import CallbackConfig + from ._models import Event + from ._models import EventContent + from ._models import EventInfo + from ._models import EventRequestMessage + from ._models import EventResponseMessage + from ._models import GenerateCredentialsParameters + from ._models import GenerateCredentialsResult + from ._models import ImportImageParameters + from ._models import ImportSource + from ._models import ImportSourceCredentials + from ._models import IPRule + from ._models import NetworkRuleSet + from ._models import OperationDefinition + from ._models import OperationDisplayDefinition + from ._models import OperationMetricSpecificationDefinition + from ._models import OperationServiceSpecificationDefinition + from ._models import ProxyResource + from ._models import QuarantinePolicy + from ._models import RegenerateCredentialParameters + from ._models import Registry + from ._models import RegistryListCredentialsResult + from ._models import RegistryNameCheckRequest + from ._models import RegistryNameStatus + from ._models import RegistryPassword + from ._models import RegistryPolicies + from ._models import RegistryUpdateParameters + from ._models import RegistryUsage + from ._models import RegistryUsageListResult + from ._models import Replication + from ._models import ReplicationUpdateParameters + from ._models import Request + from ._models import Resource + from ._models import ScopeMap + from ._models import ScopeMapUpdateParameters + from ._models import Sku + from ._models import Source + from ._models import Status1 + from ._models import StorageAccountProperties + from ._models import Target + from ._models import Token + from ._models import TokenCertificate + from ._models import TokenCredentialsProperties + from ._models import TokenPassword + from ._models import TokenUpdateParameters + from ._models import TrustPolicy + from ._models import VirtualNetworkRule + from ._models import Webhook + from ._models import WebhookCreateParameters + from ._models import WebhookUpdateParameters +from ._paged_models import EventPaged +from ._paged_models import OperationDefinitionPaged +from ._paged_models import RegistryPaged +from ._paged_models import ReplicationPaged +from ._paged_models import ScopeMapPaged +from ._paged_models import TokenPaged +from ._paged_models import WebhookPaged +from ._container_registry_management_client_enums import ( ImportMode, SkuName, SkuTier, @@ -139,57 +139,57 @@ ) __all__ = [ - 'ImportSourceCredentials', - 'ImportSource', + 'Actor', + 'CallbackConfig', + 'Event', + 'EventContent', + 'EventInfo', + 'EventRequestMessage', + 'EventResponseMessage', + 'GenerateCredentialsParameters', + 'GenerateCredentialsResult', 'ImportImageParameters', - 'RegistryNameCheckRequest', - 'RegistryNameStatus', + 'ImportSource', + 'ImportSourceCredentials', + 'IPRule', + 'NetworkRuleSet', + 'OperationDefinition', 'OperationDisplayDefinition', 'OperationMetricSpecificationDefinition', 'OperationServiceSpecificationDefinition', - 'OperationDefinition', - 'Sku', - 'Status1', - 'StorageAccountProperties', - 'VirtualNetworkRule', - 'IPRule', - 'NetworkRuleSet', + 'ProxyResource', + 'QuarantinePolicy', + 'RegenerateCredentialParameters', 'Registry', - 'RegistryUpdateParameters', - 'RegistryPassword', 'RegistryListCredentialsResult', - 'RegenerateCredentialParameters', + 'RegistryNameCheckRequest', + 'RegistryNameStatus', + 'RegistryPassword', + 'RegistryPolicies', + 'RegistryUpdateParameters', 'RegistryUsage', 'RegistryUsageListResult', - 'QuarantinePolicy', - 'TrustPolicy', - 'RegistryPolicies', 'Replication', 'ReplicationUpdateParameters', - 'Webhook', - 'WebhookCreateParameters', - 'WebhookUpdateParameters', - 'EventInfo', - 'CallbackConfig', - 'Target', 'Request', - 'Actor', - 'Source', - 'EventContent', - 'EventRequestMessage', - 'EventResponseMessage', - 'Event', 'Resource', 'ScopeMap', 'ScopeMapUpdateParameters', + 'Sku', + 'Source', + 'Status1', + 'StorageAccountProperties', + 'Target', + 'Token', 'TokenCertificate', - 'TokenPassword', 'TokenCredentialsProperties', - 'Token', + 'TokenPassword', 'TokenUpdateParameters', - 'GenerateCredentialsParameters', - 'GenerateCredentialsResult', - 'ProxyResource', + 'TrustPolicy', + 'VirtualNetworkRule', + 'Webhook', + 'WebhookCreateParameters', + 'WebhookUpdateParameters', 'RegistryPaged', 'OperationDefinitionPaged', 'ReplicationPaged', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/container_registry_management_client_enums.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/_container_registry_management_client_enums.py similarity index 100% rename from sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/container_registry_management_client_enums.py rename to sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/_container_registry_management_client_enums.py diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/_models.py new file mode 100644 index 000000000000..9f23a709afce --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/_models.py @@ -0,0 +1,1746 @@ +# 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) + + +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) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +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) + + +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.v2019_05_01_preview.models.EventRequestMessage + :param event_response_message: The event response message received from + the service URI. + :type event_response_message: + ~azure.mgmt.containerregistry.v2019_05_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) + + +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.v2019_05_01_preview.models.Target + :param request: The request that generated the event. + :type request: + ~azure.mgmt.containerregistry.v2019_05_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.v2019_05_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.v2019_05_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) + + +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.v2019_05_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) + + +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) + + +class GenerateCredentialsParameters(Model): + """The parameters used to generate credentials for a specified token or user + of a container registry. + + :param token_id: The resource ID of the token for which credentials have + to be generated. + :type token_id: str + :param expiry: The expiry date of the generated credentials after which + the credentials become invalid. Default value: + "9999-12-31T15:59:59.9999999-08:00" . + :type expiry: datetime + :param name: Specifies name of the password which should be regenerated if + any -- password or password2. Possible values include: 'password1', + 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPasswordName + """ + + _attribute_map = { + 'token_id': {'key': 'tokenId', 'type': 'str'}, + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GenerateCredentialsParameters, self).__init__(**kwargs) + self.token_id = kwargs.get('token_id', None) + self.expiry = kwargs.get('expiry', "9999-12-31T15:59:59.9999999-08:00") + self.name = kwargs.get('name', None) + + +class GenerateCredentialsResult(Model): + """The response from the GenerateCredentials 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.v2019_05_01_preview.models.TokenPassword] + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'passwords': {'key': 'passwords', 'type': '[TokenPassword]'}, + } + + def __init__(self, **kwargs): + super(GenerateCredentialsResult, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.passwords = kwargs.get('passwords', None) + + +class ImportImageParameters(Model): + """ImportImageParameters. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the image. + :type source: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportSource + :param target_tags: List of strings of the form repo[:tag]. When tag is + omitted the source will be used (or 'latest' if source tag is also + omitted). + :type target_tags: list[str] + :param untagged_target_repositories: List of strings of repository names + to do a manifest only copy. No tag will be created. + :type untagged_target_repositories: list[str] + :param mode: When Force, any existing target tags will be overwritten. + When NoForce, any existing target tags will fail the operation before any + copying begins. Possible values include: 'NoForce', 'Force'. Default + value: "NoForce" . + :type mode: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportMode + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ImportSource'}, + 'target_tags': {'key': 'targetTags', 'type': '[str]'}, + 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportImageParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.target_tags = kwargs.get('target_tags', None) + self.untagged_target_repositories = kwargs.get('untagged_target_repositories', None) + self.mode = kwargs.get('mode', "NoForce") + + +class ImportSource(Model): + """ImportSource. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: The resource identifier of the source Azure Container + Registry. + :type resource_id: str + :param registry_uri: The address of the source registry (e.g. + 'mcr.microsoft.com'). + :type registry_uri: str + :param credentials: Credentials used when importing from a registry uri. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportSourceCredentials + :param source_image: Required. Repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' + tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest + ('hello-world@sha256:abc123'). + :type source_image: str + """ + + _validation = { + 'source_image': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'registry_uri': {'key': 'registryUri', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, + 'source_image': {'key': 'sourceImage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportSource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.registry_uri = kwargs.get('registry_uri', None) + self.credentials = kwargs.get('credentials', None) + self.source_image = kwargs.get('source_image', None) + + +class ImportSourceCredentials(Model): + """ImportSourceCredentials. + + All required parameters must be populated in order to send to Azure. + + :param username: The username to authenticate with the source registry. + :type username: str + :param password: Required. The password used to authenticate with the + source registry. + :type password: str + """ + + _validation = { + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportSourceCredentials, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Action + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.action = kwargs.get('action', "Allow") + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + + +class NetworkRuleSet(Model): + """The network rule set for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Required. The default action of allow or deny when + no other rules match. Possible values include: 'Allow', 'Deny'. Default + value: "Allow" . + :type default_action: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.DefaultAction + :param virtual_network_rules: The virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.VirtualNetworkRule] + :param ip_rules: The IP ACL rules. + :type ip_rules: + list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.IPRule] + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = kwargs.get('default_action', "Allow") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param origin: The origin information of the container registry operation. + :type origin: str + :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.v2019_05_01_preview.models.OperationDisplayDefinition + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.OperationServiceSpecificationDefinition + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, + } + + def __init__(self, **kwargs): + super(OperationDefinition, self).__init__(**kwargs) + self.origin = kwargs.get('origin', None) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.service_specification = kwargs.get('service_specification', None) + + +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) + + +class OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) + + +class OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, **kwargs): + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +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 + + +class QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + +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.v2019_05_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) + + +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) + + +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.v2019_05_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.v2019_05_01_preview.models.ProvisioningState + :ivar status: The status of the container registry at the time the + operation was called. + :vartype status: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status1 + :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.v2019_05_01_preview.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.NetworkRuleSet + """ + + _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': 'Status1'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + 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) + self.network_rule_set = kwargs.get('network_rule_set', None) + + +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.v2019_05_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) + + +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) + + +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) + + +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.v2019_05_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) + + +class RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, **kwargs): + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = kwargs.get('quarantine_policy', None) + self.trust_policy = kwargs.get('trust_policy', None) + + +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.v2019_05_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.v2019_05_01_preview.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + 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) + self.network_rule_set = kwargs.get('network_rule_set', None) + + +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.v2019_05_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) + + +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.v2019_05_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) + + +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.v2019_05_01_preview.models.ProvisioningState + :ivar status: The status of the replication at the time the operation was + called. + :vartype status: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status1 + """ + + _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': 'Status1'}, + } + + def __init__(self, **kwargs): + super(Replication, self).__init__(**kwargs) + self.provisioning_state = None + self.status = None + + +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) + + +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) + + +class ScopeMap(ProxyResource): + """An object that represents a scope map 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 description: The user friendly description of the scope map. + :type description: str + :ivar scope_map_type: The type of the scope map. E.g. BuildIn scope map. + :vartype scope_map_type: str + :ivar creation_date: The creation date of scope map. + :vartype creation_date: datetime + :ivar provisioning_state: Provisioning state of the resource. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ProvisioningState + :param actions: Required. The list of scoped permissions for registry + artifacts. + E.g. repositories/repository-name/pull, + repositories/repository-name/delete + :type actions: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'scope_map_type': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'actions': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'scope_map_type': {'key': 'properties.type', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ScopeMap, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.scope_map_type = None + self.creation_date = None + self.provisioning_state = None + self.actions = kwargs.get('actions', None) + + +class ScopeMapUpdateParameters(Model): + """The properties for updating the scope map. + + :param description: The user friendly description of the scope map. + :type description: str + :param actions: The list of scope permissions for registry artifacts. + E.g. repositories/repository-name/pull, + repositories/repository-name/delete + :type actions: list[str] + """ + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ScopeMapUpdateParameters, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.actions = kwargs.get('actions', None) + + +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.v2019_05_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.v2019_05_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 + + +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) + + +class Status1(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(Status1, self).__init__(**kwargs) + self.display_status = None + self.message = None + self.timestamp = None + + +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) + + +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 + :param name: The name of the artifact. + :type name: str + :param version: The version of the artifact. + :type version: 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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', '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) + self.name = kwargs.get('name', None) + self.version = kwargs.get('version', None) + + +class Token(ProxyResource): + """An object that represents a token for a container registry. + + 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 + :ivar creation_date: The creation date of scope map. + :vartype creation_date: datetime + :ivar provisioning_state: Provisioning state of the resource. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ProvisioningState + :param scope_map_id: The resource ID of the scope map to which the token + will be associated with. + :type scope_map_id: str + :param object_id: The user/group/application object ID for which the token + has to be created. + :type object_id: str + :param credentials: The credentials that can be used for authenticating + the token. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCredentialsProperties + :param status: The status of the token example enabled or disabled. + Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'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'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'scope_map_id': {'key': 'properties.scopeMapId', 'type': 'str'}, + 'object_id': {'key': 'properties.objectId', 'type': 'str'}, + 'credentials': {'key': 'properties.credentials', 'type': 'TokenCredentialsProperties'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Token, self).__init__(**kwargs) + self.creation_date = None + self.provisioning_state = None + self.scope_map_id = kwargs.get('scope_map_id', None) + self.object_id = kwargs.get('object_id', None) + self.credentials = kwargs.get('credentials', None) + self.status = kwargs.get('status', None) + + +class TokenCertificate(Model): + """The properties of a certificate used for authenticating a token. + + :param name: Possible values include: 'certificate1', 'certificate2' + :type name: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCertificateName + :param expiry: The expiry datetime of the certificate. + :type expiry: datetime + :param thumbprint: The thumbprint of the certificate. + :type thumbprint: str + :param encoded_pem_certificate: Base 64 encoded string of the public + certificate1 in PEM format that will be used for authenticating the token. + :type encoded_pem_certificate: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'encoded_pem_certificate': {'key': 'encodedPemCertificate', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TokenCertificate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.expiry = kwargs.get('expiry', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.encoded_pem_certificate = kwargs.get('encoded_pem_certificate', None) + + +class TokenCredentialsProperties(Model): + """The properties of the credentials that can be used for authenticating the + token. + + :param certificates: + :type certificates: + list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCertificate] + :param passwords: + :type passwords: + list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPassword] + """ + + _attribute_map = { + 'certificates': {'key': 'certificates', 'type': '[TokenCertificate]'}, + 'passwords': {'key': 'passwords', 'type': '[TokenPassword]'}, + } + + def __init__(self, **kwargs): + super(TokenCredentialsProperties, self).__init__(**kwargs) + self.certificates = kwargs.get('certificates', None) + self.passwords = kwargs.get('passwords', None) + + +class TokenPassword(Model): + """The password that will be used for authenticating the token of a container + registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param creation_time: The password created datetime of the password. + :type creation_time: datetime + :param expiry: The expiry datetime of the password. + :type expiry: datetime + :param name: The password name "password" or "password2". Possible values + include: 'password1', 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPasswordName + :ivar value: The password value. + :vartype value: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TokenPassword, self).__init__(**kwargs) + self.creation_time = kwargs.get('creation_time', None) + self.expiry = kwargs.get('expiry', None) + self.name = kwargs.get('name', None) + self.value = None + + +class TokenUpdateParameters(Model): + """The parameters for updating a token. + + :param scope_map_id: The resource ID of the scope map to which the token + will be associated with. + :type scope_map_id: str + :param status: The status of the token example enabled or disabled. + Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status + :param credentials: The credentials that can be used for authenticating + the token. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCredentialsProperties + """ + + _attribute_map = { + 'scope_map_id': {'key': 'properties.scopeMapId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'credentials': {'key': 'properties.credentials', 'type': 'TokenCredentialsProperties'}, + } + + def __init__(self, **kwargs): + super(TokenUpdateParameters, self).__init__(**kwargs) + self.scope_map_id = kwargs.get('scope_map_id', None) + self.status = kwargs.get('status', None) + self.credentials = kwargs.get('credentials', None) + + +class TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrustPolicy, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.status = kwargs.get('status', None) + + +class VirtualNetworkRule(Model): + """Virtual network rule. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Action + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.action = kwargs.get('action', "Allow") + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + + +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.v2019_05_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.v2019_05_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.v2019_05_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 + + +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.v2019_05_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.v2019_05_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) + + +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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/_models_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..88a6c8a6eaef --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/_models_py3.py @@ -0,0 +1,1746 @@ +# 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 + + +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 + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +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 + + +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.v2019_05_01_preview.models.EventRequestMessage + :param event_response_message: The event response message received from + the service URI. + :type event_response_message: + ~azure.mgmt.containerregistry.v2019_05_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 + + +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.v2019_05_01_preview.models.Target + :param request: The request that generated the event. + :type request: + ~azure.mgmt.containerregistry.v2019_05_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.v2019_05_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.v2019_05_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 + + +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.v2019_05_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 + + +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 + + +class GenerateCredentialsParameters(Model): + """The parameters used to generate credentials for a specified token or user + of a container registry. + + :param token_id: The resource ID of the token for which credentials have + to be generated. + :type token_id: str + :param expiry: The expiry date of the generated credentials after which + the credentials become invalid. Default value: + "9999-12-31T15:59:59.9999999-08:00" . + :type expiry: datetime + :param name: Specifies name of the password which should be regenerated if + any -- password or password2. Possible values include: 'password1', + 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPasswordName + """ + + _attribute_map = { + 'token_id': {'key': 'tokenId', 'type': 'str'}, + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, token_id: str=None, expiry="9999-12-31T15:59:59.9999999-08:00", name=None, **kwargs) -> None: + super(GenerateCredentialsParameters, self).__init__(**kwargs) + self.token_id = token_id + self.expiry = expiry + self.name = name + + +class GenerateCredentialsResult(Model): + """The response from the GenerateCredentials 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.v2019_05_01_preview.models.TokenPassword] + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'passwords': {'key': 'passwords', 'type': '[TokenPassword]'}, + } + + def __init__(self, *, username: str=None, passwords=None, **kwargs) -> None: + super(GenerateCredentialsResult, self).__init__(**kwargs) + self.username = username + self.passwords = passwords + + +class ImportImageParameters(Model): + """ImportImageParameters. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source of the image. + :type source: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportSource + :param target_tags: List of strings of the form repo[:tag]. When tag is + omitted the source will be used (or 'latest' if source tag is also + omitted). + :type target_tags: list[str] + :param untagged_target_repositories: List of strings of repository names + to do a manifest only copy. No tag will be created. + :type untagged_target_repositories: list[str] + :param mode: When Force, any existing target tags will be overwritten. + When NoForce, any existing target tags will fail the operation before any + copying begins. Possible values include: 'NoForce', 'Force'. Default + value: "NoForce" . + :type mode: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportMode + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ImportSource'}, + 'target_tags': {'key': 'targetTags', 'type': '[str]'}, + 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, *, source, target_tags=None, untagged_target_repositories=None, mode="NoForce", **kwargs) -> None: + super(ImportImageParameters, self).__init__(**kwargs) + self.source = source + self.target_tags = target_tags + self.untagged_target_repositories = untagged_target_repositories + self.mode = mode + + +class ImportSource(Model): + """ImportSource. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: The resource identifier of the source Azure Container + Registry. + :type resource_id: str + :param registry_uri: The address of the source registry (e.g. + 'mcr.microsoft.com'). + :type registry_uri: str + :param credentials: Credentials used when importing from a registry uri. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportSourceCredentials + :param source_image: Required. Repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' + tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest + ('hello-world@sha256:abc123'). + :type source_image: str + """ + + _validation = { + 'source_image': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'registry_uri': {'key': 'registryUri', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, + 'source_image': {'key': 'sourceImage', 'type': 'str'}, + } + + def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None: + super(ImportSource, self).__init__(**kwargs) + self.resource_id = resource_id + self.registry_uri = registry_uri + self.credentials = credentials + self.source_image = source_image + + +class ImportSourceCredentials(Model): + """ImportSourceCredentials. + + All required parameters must be populated in order to send to Azure. + + :param username: The username to authenticate with the source registry. + :type username: str + :param password: Required. The password used to authenticate with the + source registry. + :type password: str + """ + + _validation = { + 'password': {'required': True}, + } + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, password: str, username: str=None, **kwargs) -> None: + super(ImportSourceCredentials, self).__init__(**kwargs) + self.username = username + self.password = password + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Action + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.action = action + self.ip_address_or_range = ip_address_or_range + + +class NetworkRuleSet(Model): + """The network rule set for a container registry. + + All required parameters must be populated in order to send to Azure. + + :param default_action: Required. The default action of allow or deny when + no other rules match. Possible values include: 'Allow', 'Deny'. Default + value: "Allow" . + :type default_action: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.DefaultAction + :param virtual_network_rules: The virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.VirtualNetworkRule] + :param ip_rules: The IP ACL rules. + :type ip_rules: + list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.IPRule] + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + } + + def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.default_action = default_action + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + + +class OperationDefinition(Model): + """The definition of a container registry operation. + + :param origin: The origin information of the container registry operation. + :type origin: str + :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.v2019_05_01_preview.models.OperationDisplayDefinition + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.OperationServiceSpecificationDefinition + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, + } + + def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: + super(OperationDefinition, self).__init__(**kwargs) + self.origin = origin + self.name = name + self.display = display + self.service_specification = service_specification + + +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 + + +class OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.internal_metric_name = internal_metric_name + + +class OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +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 + + +class QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status=None, **kwargs) -> None: + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = status + + +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.v2019_05_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 + + +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 + + +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.v2019_05_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.v2019_05_01_preview.models.ProvisioningState + :ivar status: The status of the container registry at the time the + operation was called. + :vartype status: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status1 + :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.v2019_05_01_preview.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.NetworkRuleSet + """ + + _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': 'Status1'}, + 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, + 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=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 + self.network_rule_set = network_rule_set + + +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.v2019_05_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 + + +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 + + +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 + + +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.v2019_05_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 + + +class RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, *, quarantine_policy=None, trust_policy=None, **kwargs) -> None: + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = quarantine_policy + self.trust_policy = trust_policy + + +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.v2019_05_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.v2019_05_01_preview.models.StorageAccountProperties + :param network_rule_set: The network rule set for a container registry. + :type network_rule_set: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.NetworkRuleSet + """ + + _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'}, + 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, network_rule_set=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 + self.network_rule_set = network_rule_set + + +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.v2019_05_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 + + +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.v2019_05_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 + + +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.v2019_05_01_preview.models.ProvisioningState + :ivar status: The status of the replication at the time the operation was + called. + :vartype status: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status1 + """ + + _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': 'Status1'}, + } + + 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 + + +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 + + +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 + + +class ScopeMap(ProxyResource): + """An object that represents a scope map 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 description: The user friendly description of the scope map. + :type description: str + :ivar scope_map_type: The type of the scope map. E.g. BuildIn scope map. + :vartype scope_map_type: str + :ivar creation_date: The creation date of scope map. + :vartype creation_date: datetime + :ivar provisioning_state: Provisioning state of the resource. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ProvisioningState + :param actions: Required. The list of scoped permissions for registry + artifacts. + E.g. repositories/repository-name/pull, + repositories/repository-name/delete + :type actions: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'scope_map_type': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'actions': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'scope_map_type': {'key': 'properties.type', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + } + + def __init__(self, *, actions, description: str=None, **kwargs) -> None: + super(ScopeMap, self).__init__(**kwargs) + self.description = description + self.scope_map_type = None + self.creation_date = None + self.provisioning_state = None + self.actions = actions + + +class ScopeMapUpdateParameters(Model): + """The properties for updating the scope map. + + :param description: The user friendly description of the scope map. + :type description: str + :param actions: The list of scope permissions for registry artifacts. + E.g. repositories/repository-name/pull, + repositories/repository-name/delete + :type actions: list[str] + """ + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'actions': {'key': 'properties.actions', 'type': '[str]'}, + } + + def __init__(self, *, description: str=None, actions=None, **kwargs) -> None: + super(ScopeMapUpdateParameters, self).__init__(**kwargs) + self.description = description + self.actions = actions + + +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.v2019_05_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.v2019_05_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 + + +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 + + +class Status1(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(Status1, self).__init__(**kwargs) + self.display_status = None + self.message = None + self.timestamp = None + + +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 + + +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 + :param name: The name of the artifact. + :type name: str + :param version: The version of the artifact. + :type version: 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'}, + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', '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, name: str=None, version: 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 + self.name = name + self.version = version + + +class Token(ProxyResource): + """An object that represents a token for a container registry. + + 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 + :ivar creation_date: The creation date of scope map. + :vartype creation_date: datetime + :ivar provisioning_state: Provisioning state of the resource. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ProvisioningState + :param scope_map_id: The resource ID of the scope map to which the token + will be associated with. + :type scope_map_id: str + :param object_id: The user/group/application object ID for which the token + has to be created. + :type object_id: str + :param credentials: The credentials that can be used for authenticating + the token. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCredentialsProperties + :param status: The status of the token example enabled or disabled. + Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'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'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'scope_map_id': {'key': 'properties.scopeMapId', 'type': 'str'}, + 'object_id': {'key': 'properties.objectId', 'type': 'str'}, + 'credentials': {'key': 'properties.credentials', 'type': 'TokenCredentialsProperties'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, *, scope_map_id: str=None, object_id: str=None, credentials=None, status=None, **kwargs) -> None: + super(Token, self).__init__(**kwargs) + self.creation_date = None + self.provisioning_state = None + self.scope_map_id = scope_map_id + self.object_id = object_id + self.credentials = credentials + self.status = status + + +class TokenCertificate(Model): + """The properties of a certificate used for authenticating a token. + + :param name: Possible values include: 'certificate1', 'certificate2' + :type name: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCertificateName + :param expiry: The expiry datetime of the certificate. + :type expiry: datetime + :param thumbprint: The thumbprint of the certificate. + :type thumbprint: str + :param encoded_pem_certificate: Base 64 encoded string of the public + certificate1 in PEM format that will be used for authenticating the token. + :type encoded_pem_certificate: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'encoded_pem_certificate': {'key': 'encodedPemCertificate', 'type': 'str'}, + } + + def __init__(self, *, name=None, expiry=None, thumbprint: str=None, encoded_pem_certificate: str=None, **kwargs) -> None: + super(TokenCertificate, self).__init__(**kwargs) + self.name = name + self.expiry = expiry + self.thumbprint = thumbprint + self.encoded_pem_certificate = encoded_pem_certificate + + +class TokenCredentialsProperties(Model): + """The properties of the credentials that can be used for authenticating the + token. + + :param certificates: + :type certificates: + list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCertificate] + :param passwords: + :type passwords: + list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPassword] + """ + + _attribute_map = { + 'certificates': {'key': 'certificates', 'type': '[TokenCertificate]'}, + 'passwords': {'key': 'passwords', 'type': '[TokenPassword]'}, + } + + def __init__(self, *, certificates=None, passwords=None, **kwargs) -> None: + super(TokenCredentialsProperties, self).__init__(**kwargs) + self.certificates = certificates + self.passwords = passwords + + +class TokenPassword(Model): + """The password that will be used for authenticating the token of a container + registry. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param creation_time: The password created datetime of the password. + :type creation_time: datetime + :param expiry: The expiry datetime of the password. + :type expiry: datetime + :param name: The password name "password" or "password2". Possible values + include: 'password1', 'password2' + :type name: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPasswordName + :ivar value: The password value. + :vartype value: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, creation_time=None, expiry=None, name=None, **kwargs) -> None: + super(TokenPassword, self).__init__(**kwargs) + self.creation_time = creation_time + self.expiry = expiry + self.name = name + self.value = None + + +class TokenUpdateParameters(Model): + """The parameters for updating a token. + + :param scope_map_id: The resource ID of the scope map to which the token + will be associated with. + :type scope_map_id: str + :param status: The status of the token example enabled or disabled. + Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status + :param credentials: The credentials that can be used for authenticating + the token. + :type credentials: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCredentialsProperties + """ + + _attribute_map = { + 'scope_map_id': {'key': 'properties.scopeMapId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'credentials': {'key': 'properties.credentials', 'type': 'TokenCredentialsProperties'}, + } + + def __init__(self, *, scope_map_id: str=None, status=None, credentials=None, **kwargs) -> None: + super(TokenUpdateParameters, self).__init__(**kwargs) + self.scope_map_id = scope_map_id + self.status = status + self.credentials = credentials + + +class TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, type=None, status=None, **kwargs) -> None: + super(TrustPolicy, self).__init__(**kwargs) + self.type = type + self.status = status + + +class VirtualNetworkRule(Model): + """Virtual network rule. + + All required parameters must be populated in order to send to Azure. + + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Action + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.action = action + self.virtual_network_resource_id = virtual_network_resource_id + + +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.v2019_05_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.v2019_05_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.v2019_05_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 + + +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.v2019_05_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.v2019_05_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 + + +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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/_paged_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..beedac3a833a --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/_paged_models.py @@ -0,0 +1,105 @@ +# 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) +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) +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) +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) +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) +class ScopeMapPaged(Paged): + """ + A paging container for iterating over a list of :class:`ScopeMap ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ScopeMap]'} + } + + def __init__(self, *args, **kwargs): + + super(ScopeMapPaged, self).__init__(*args, **kwargs) +class TokenPaged(Paged): + """ + A paging container for iterating over a list of :class:`Token ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Token]'} + } + + def __init__(self, *args, **kwargs): + + super(TokenPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/actor.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/actor.py deleted file mode 100644 index a662f9008a31..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/actor.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/actor_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/actor_py3.py deleted file mode 100644 index fdd8b96dda52..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/actor_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/callback_config.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/callback_config.py deleted file mode 100644 index 8ad43a9f785a..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/callback_config.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/callback_config_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/callback_config_py3.py deleted file mode 100644 index 27ffc7825431..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/callback_config_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event.py deleted file mode 100644 index 89fb7554211e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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.v2019_05_01_preview.models.EventRequestMessage - :param event_response_message: The event response message received from - the service URI. - :type event_response_message: - ~azure.mgmt.containerregistry.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_content.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_content.py deleted file mode 100644 index 634301a643b6..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_content.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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.v2019_05_01_preview.models.Target - :param request: The request that generated the event. - :type request: - ~azure.mgmt.containerregistry.v2019_05_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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_content_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_content_py3.py deleted file mode 100644 index ab54c988936e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_content_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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.v2019_05_01_preview.models.Target - :param request: The request that generated the event. - :type request: - ~azure.mgmt.containerregistry.v2019_05_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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_info.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_info.py deleted file mode 100644 index 7199044b2e39..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_info.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_info_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_info_py3.py deleted file mode 100644 index 192990067407..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_info_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_paged.py deleted file mode 100644 index 15a96f8778f4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_py3.py deleted file mode 100644 index d4ced9ffc2af..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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_py3 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.v2019_05_01_preview.models.EventRequestMessage - :param event_response_message: The event response message received from - the service URI. - :type event_response_message: - ~azure.mgmt.containerregistry.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_request_message.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_request_message.py deleted file mode 100644 index eb5f8eee7de3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_request_message.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_request_message_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_request_message_py3.py deleted file mode 100644 index d4e552535527..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_request_message_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_response_message.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_response_message.py deleted file mode 100644 index ffb8feb12a1e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_response_message.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_response_message_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_response_message_py3.py deleted file mode 100644 index 4b1351377b4b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/event_response_message_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_parameters.py deleted file mode 100644 index 70752b0c8171..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_parameters.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 GenerateCredentialsParameters(Model): - """The parameters used to generate credentials for a specified token or user - of a container registry. - - :param token_id: The resource ID of the token for which credentials have - to be generated. - :type token_id: str - :param expiry: The expiry date of the generated credentials after which - the credentials become invalid. Default value: - "9999-12-31T15:59:59.9999999-08:00" . - :type expiry: datetime - :param name: Specifies name of the password which should be regenerated if - any -- password or password2. Possible values include: 'password1', - 'password2' - :type name: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPasswordName - """ - - _attribute_map = { - 'token_id': {'key': 'tokenId', 'type': 'str'}, - 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(GenerateCredentialsParameters, self).__init__(**kwargs) - self.token_id = kwargs.get('token_id', None) - self.expiry = kwargs.get('expiry', "9999-12-31T15:59:59.9999999-08:00") - self.name = kwargs.get('name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_parameters_py3.py deleted file mode 100644 index 05c2e161db0e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_parameters_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 GenerateCredentialsParameters(Model): - """The parameters used to generate credentials for a specified token or user - of a container registry. - - :param token_id: The resource ID of the token for which credentials have - to be generated. - :type token_id: str - :param expiry: The expiry date of the generated credentials after which - the credentials become invalid. Default value: - "9999-12-31T15:59:59.9999999-08:00" . - :type expiry: datetime - :param name: Specifies name of the password which should be regenerated if - any -- password or password2. Possible values include: 'password1', - 'password2' - :type name: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPasswordName - """ - - _attribute_map = { - 'token_id': {'key': 'tokenId', 'type': 'str'}, - 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__(self, *, token_id: str=None, expiry="9999-12-31T15:59:59.9999999-08:00", name=None, **kwargs) -> None: - super(GenerateCredentialsParameters, self).__init__(**kwargs) - self.token_id = token_id - self.expiry = expiry - self.name = name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_result.py deleted file mode 100644 index 077522d70268..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_result.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 GenerateCredentialsResult(Model): - """The response from the GenerateCredentials 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.v2019_05_01_preview.models.TokenPassword] - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[TokenPassword]'}, - } - - def __init__(self, **kwargs): - super(GenerateCredentialsResult, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.passwords = kwargs.get('passwords', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_result_py3.py deleted file mode 100644 index 2186dcdaa814..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/generate_credentials_result_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 GenerateCredentialsResult(Model): - """The response from the GenerateCredentials 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.v2019_05_01_preview.models.TokenPassword] - """ - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'passwords': {'key': 'passwords', 'type': '[TokenPassword]'}, - } - - def __init__(self, *, username: str=None, passwords=None, **kwargs) -> None: - super(GenerateCredentialsResult, self).__init__(**kwargs) - self.username = username - self.passwords = passwords diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_image_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_image_parameters.py deleted file mode 100644 index f5732a2b7662..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_image_parameters.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportImageParameters(Model): - """ImportImageParameters. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. The source of the image. - :type source: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportSource - :param target_tags: List of strings of the form repo[:tag]. When tag is - omitted the source will be used (or 'latest' if source tag is also - omitted). - :type target_tags: list[str] - :param untagged_target_repositories: List of strings of repository names - to do a manifest only copy. No tag will be created. - :type untagged_target_repositories: list[str] - :param mode: When Force, any existing target tags will be overwritten. - When NoForce, any existing target tags will fail the operation before any - copying begins. Possible values include: 'NoForce', 'Force'. Default - value: "NoForce" . - :type mode: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportMode - """ - - _validation = { - 'source': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ImportSource'}, - 'target_tags': {'key': 'targetTags', 'type': '[str]'}, - 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportImageParameters, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.target_tags = kwargs.get('target_tags', None) - self.untagged_target_repositories = kwargs.get('untagged_target_repositories', None) - self.mode = kwargs.get('mode', "NoForce") diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_image_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_image_parameters_py3.py deleted file mode 100644 index ee3fc0a82945..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_image_parameters_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportImageParameters(Model): - """ImportImageParameters. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. The source of the image. - :type source: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportSource - :param target_tags: List of strings of the form repo[:tag]. When tag is - omitted the source will be used (or 'latest' if source tag is also - omitted). - :type target_tags: list[str] - :param untagged_target_repositories: List of strings of repository names - to do a manifest only copy. No tag will be created. - :type untagged_target_repositories: list[str] - :param mode: When Force, any existing target tags will be overwritten. - When NoForce, any existing target tags will fail the operation before any - copying begins. Possible values include: 'NoForce', 'Force'. Default - value: "NoForce" . - :type mode: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportMode - """ - - _validation = { - 'source': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ImportSource'}, - 'target_tags': {'key': 'targetTags', 'type': '[str]'}, - 'untagged_target_repositories': {'key': 'untaggedTargetRepositories', 'type': '[str]'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__(self, *, source, target_tags=None, untagged_target_repositories=None, mode="NoForce", **kwargs) -> None: - super(ImportImageParameters, self).__init__(**kwargs) - self.source = source - self.target_tags = target_tags - self.untagged_target_repositories = untagged_target_repositories - self.mode = mode diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_source.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_source.py deleted file mode 100644 index e91828b7b94e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_source.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportSource(Model): - """ImportSource. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource identifier of the source Azure Container - Registry. - :type resource_id: str - :param registry_uri: The address of the source registry (e.g. - 'mcr.microsoft.com'). - :type registry_uri: str - :param credentials: Credentials used when importing from a registry uri. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportSourceCredentials - :param source_image: Required. Repository name of the source image. - Specify an image by repository ('hello-world'). This will use the 'latest' - tag. - Specify an image by tag ('hello-world:latest'). - Specify an image by sha256-based manifest digest - ('hello-world@sha256:abc123'). - :type source_image: str - """ - - _validation = { - 'source_image': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'registry_uri': {'key': 'registryUri', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, - 'source_image': {'key': 'sourceImage', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportSource, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.registry_uri = kwargs.get('registry_uri', None) - self.credentials = kwargs.get('credentials', None) - self.source_image = kwargs.get('source_image', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_source_credentials.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_source_credentials.py deleted file mode 100644 index b31e5f7e8405..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_source_credentials.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ImportSourceCredentials(Model): - """ImportSourceCredentials. - - All required parameters must be populated in order to send to Azure. - - :param username: The username to authenticate with the source registry. - :type username: str - :param password: Required. The password used to authenticate with the - source registry. - :type password: str - """ - - _validation = { - 'password': {'required': True}, - } - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImportSourceCredentials, self).__init__(**kwargs) - self.username = kwargs.get('username', None) - self.password = kwargs.get('password', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_source_credentials_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_source_credentials_py3.py deleted file mode 100644 index 4a610e022f88..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_source_credentials_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 ImportSourceCredentials(Model): - """ImportSourceCredentials. - - All required parameters must be populated in order to send to Azure. - - :param username: The username to authenticate with the source registry. - :type username: str - :param password: Required. The password used to authenticate with the - source registry. - :type password: str - """ - - _validation = { - 'password': {'required': True}, - } - - _attribute_map = { - 'username': {'key': 'username', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - } - - def __init__(self, *, password: str, username: str=None, **kwargs) -> None: - super(ImportSourceCredentials, self).__init__(**kwargs) - self.username = username - self.password = password diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_source_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_source_py3.py deleted file mode 100644 index 3a62c9c1f6de..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/import_source_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 ImportSource(Model): - """ImportSource. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: The resource identifier of the source Azure Container - Registry. - :type resource_id: str - :param registry_uri: The address of the source registry (e.g. - 'mcr.microsoft.com'). - :type registry_uri: str - :param credentials: Credentials used when importing from a registry uri. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportSourceCredentials - :param source_image: Required. Repository name of the source image. - Specify an image by repository ('hello-world'). This will use the 'latest' - tag. - Specify an image by tag ('hello-world:latest'). - Specify an image by sha256-based manifest digest - ('hello-world@sha256:abc123'). - :type source_image: str - """ - - _validation = { - 'source_image': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'registry_uri': {'key': 'registryUri', 'type': 'str'}, - 'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'}, - 'source_image': {'key': 'sourceImage', 'type': 'str'}, - } - - def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None: - super(ImportSource, self).__init__(**kwargs) - self.resource_id = resource_id - self.registry_uri = registry_uri - self.credentials = credentials - self.source_image = source_image diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/ip_rule.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/ip_rule.py deleted file mode 100644 index d0fcb8ed04a0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/ip_rule.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Action - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.action = kwargs.get('action', "Allow") - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/ip_rule_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/ip_rule_py3.py deleted file mode 100644 index 8efb28482c8c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/ip_rule_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Action - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.action = action - self.ip_address_or_range = ip_address_or_range diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/network_rule_set.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/network_rule_set.py deleted file mode 100644 index 718d507572b3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/network_rule_set.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 NetworkRuleSet(Model): - """The network rule set for a container registry. - - All required parameters must be populated in order to send to Azure. - - :param default_action: Required. The default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . - :type default_action: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.DefaultAction - :param virtual_network_rules: The virtual network rules. - :type virtual_network_rules: - list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.VirtualNetworkRule] - :param ip_rules: The IP ACL rules. - :type ip_rules: - list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.IPRule] - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.default_action = kwargs.get('default_action', "Allow") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/network_rule_set_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/network_rule_set_py3.py deleted file mode 100644 index 1929bbc83384..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/network_rule_set_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 NetworkRuleSet(Model): - """The network rule set for a container registry. - - All required parameters must be populated in order to send to Azure. - - :param default_action: Required. The default action of allow or deny when - no other rules match. Possible values include: 'Allow', 'Deny'. Default - value: "Allow" . - :type default_action: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.DefaultAction - :param virtual_network_rules: The virtual network rules. - :type virtual_network_rules: - list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.VirtualNetworkRule] - :param ip_rules: The IP ACL rules. - :type ip_rules: - list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.IPRule] - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'default_action': {'key': 'defaultAction', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - } - - def __init__(self, *, default_action="Allow", virtual_network_rules=None, ip_rules=None, **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.default_action = default_action - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_definition.py deleted file mode 100644 index 4fba3c5a8794..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_definition.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 origin: The origin information of the container registry operation. - :type origin: str - :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.v2019_05_01_preview.models.OperationDisplayDefinition - :param service_specification: The definition of Azure Monitoring service. - :type service_specification: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.OperationServiceSpecificationDefinition - """ - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, - } - - def __init__(self, **kwargs): - super(OperationDefinition, self).__init__(**kwargs) - self.origin = kwargs.get('origin', None) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_definition_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_definition_paged.py deleted file mode 100644 index 9904ccd661ee..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_definition_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_definition_py3.py deleted file mode 100644 index e341abacfd15..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_definition_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 origin: The origin information of the container registry operation. - :type origin: str - :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.v2019_05_01_preview.models.OperationDisplayDefinition - :param service_specification: The definition of Azure Monitoring service. - :type service_specification: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.OperationServiceSpecificationDefinition - """ - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, - } - - def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: - super(OperationDefinition, self).__init__(**kwargs) - self.origin = origin - self.name = name - self.display = display - self.service_specification = service_specification diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_display_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_display_definition.py deleted file mode 100644 index 6cb8463b21fc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_display_definition.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_display_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_display_definition_py3.py deleted file mode 100644 index 98abb699335c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_display_definition_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_metric_specification_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_metric_specification_definition.py deleted file mode 100644 index 8b40b3b4d6f1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_metric_specification_definition.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 OperationMetricSpecificationDefinition(Model): - """The definition of Azure Monitoring metric. - - :param name: Metric name. - :type name: str - :param display_name: Metric display name. - :type display_name: str - :param display_description: Metric description. - :type display_description: str - :param unit: Metric unit. - :type unit: str - :param aggregation_type: Metric aggregation type. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.internal_metric_name = kwargs.get('internal_metric_name', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_metric_specification_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_metric_specification_definition_py3.py deleted file mode 100644 index db4f31c14a17..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_metric_specification_definition_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 OperationMetricSpecificationDefinition(Model): - """The definition of Azure Monitoring metric. - - :param name: Metric name. - :type name: str - :param display_name: Metric display name. - :type display_name: str - :param display_description: Metric description. - :type display_description: str - :param unit: Metric unit. - :type unit: str - :param aggregation_type: Metric aggregation type. - :type aggregation_type: str - :param internal_metric_name: Internal metric name. - :type internal_metric_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: - super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.internal_metric_name = internal_metric_name diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_service_specification_definition.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_service_specification_definition.py deleted file mode 100644 index ebaf4b3fbb12..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_service_specification_definition.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 OperationServiceSpecificationDefinition(Model): - """The definition of Azure Monitoring metrics list. - - :param metric_specifications: A list of Azure Monitoring metrics - definition. - :type metric_specifications: - list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.OperationMetricSpecificationDefinition] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, - } - - def __init__(self, **kwargs): - super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_service_specification_definition_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_service_specification_definition_py3.py deleted file mode 100644 index 82693aae7810..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/operation_service_specification_definition_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 OperationServiceSpecificationDefinition(Model): - """The definition of Azure Monitoring metrics list. - - :param metric_specifications: A list of Azure Monitoring metrics - definition. - :type metric_specifications: - list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.OperationMetricSpecificationDefinition] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/proxy_resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/proxy_resource.py deleted file mode 100644 index 5c52aad9de10..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/proxy_resource.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/proxy_resource_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/proxy_resource_py3.py deleted file mode 100644 index d310c7cbf9b1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/proxy_resource_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/quarantine_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/quarantine_policy.py deleted file mode 100644 index 808e025e2149..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/quarantine_policy.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 QuarantinePolicy(Model): - """An object that represents quarantine policy for a container registry. - - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.PolicyStatus - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(QuarantinePolicy, self).__init__(**kwargs) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/quarantine_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/quarantine_policy_py3.py deleted file mode 100644 index 028fe75ebb80..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/quarantine_policy_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 QuarantinePolicy(Model): - """An object that represents quarantine policy for a container registry. - - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.PolicyStatus - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, status=None, **kwargs) -> None: - super(QuarantinePolicy, self).__init__(**kwargs) - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/regenerate_credential_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/regenerate_credential_parameters.py deleted file mode 100644 index 6bae809c76dd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/regenerate_credential_parameters.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/regenerate_credential_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/regenerate_credential_parameters_py3.py deleted file mode 100644 index f51aaa39e51e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/regenerate_credential_parameters_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry.py deleted file mode 100644 index 6a431a1481e7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry.py +++ /dev/null @@ -1,100 +0,0 @@ -# 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.v2019_05_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.v2019_05_01_preview.models.ProvisioningState - :ivar status: The status of the container registry at the time the - operation was called. - :vartype status: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status1 - :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.v2019_05_01_preview.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.NetworkRuleSet - """ - - _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': 'Status1'}, - 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - 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) - self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_list_credentials_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_list_credentials_result.py deleted file mode 100644 index b7350e4ff365..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_list_credentials_result.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_list_credentials_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_list_credentials_result_py3.py deleted file mode 100644 index 41505949248f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_list_credentials_result_py3.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_name_check_request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_name_check_request.py deleted file mode 100644 index 9d4a575eac04..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_name_check_request.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_name_check_request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_name_check_request_py3.py deleted file mode 100644 index 67f5ff9be671..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_name_check_request_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_name_status.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_name_status.py deleted file mode 100644 index 94345ba6d549..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_name_status.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_name_status_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_name_status_py3.py deleted file mode 100644 index 8b7b264c2d0d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_name_status_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_paged.py deleted file mode 100644 index 25cbd5fcf440..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_password.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_password.py deleted file mode 100644 index 5294be23f29e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_password.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_password_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_password_py3.py deleted file mode 100644 index ff3001afb9cb..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_password_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_policies.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_policies.py deleted file mode 100644 index 78fd1917340c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_policies.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 RegistryPolicies(Model): - """An object that represents policies for a container registry. - - :param quarantine_policy: An object that represents quarantine policy for - a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy for a - container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TrustPolicy - """ - - _attribute_map = { - 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, - 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, - } - - def __init__(self, **kwargs): - super(RegistryPolicies, self).__init__(**kwargs) - self.quarantine_policy = kwargs.get('quarantine_policy', None) - self.trust_policy = kwargs.get('trust_policy', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_policies_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_policies_py3.py deleted file mode 100644 index 2fdcb7079a46..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_policies_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 RegistryPolicies(Model): - """An object that represents policies for a container registry. - - :param quarantine_policy: An object that represents quarantine policy for - a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy for a - container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TrustPolicy - """ - - _attribute_map = { - 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, - 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, - } - - def __init__(self, *, quarantine_policy=None, trust_policy=None, **kwargs) -> None: - super(RegistryPolicies, self).__init__(**kwargs) - self.quarantine_policy = quarantine_policy - self.trust_policy = trust_policy diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_py3.py deleted file mode 100644 index 92aedc8672bc..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_py3.py +++ /dev/null @@ -1,100 +0,0 @@ -# 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_py3 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.v2019_05_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.v2019_05_01_preview.models.ProvisioningState - :ivar status: The status of the container registry at the time the - operation was called. - :vartype status: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status1 - :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.v2019_05_01_preview.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.NetworkRuleSet - """ - - _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': 'Status1'}, - 'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, location: str, sku, tags=None, admin_user_enabled: bool=False, storage_account=None, network_rule_set=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 - self.network_rule_set = network_rule_set diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_update_parameters.py deleted file mode 100644 index adbac28b3b5f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_update_parameters.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.v2019_05_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.v2019_05_01_preview.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - 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) - self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_update_parameters_py3.py deleted file mode 100644 index c79d8f8cde53..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_update_parameters_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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.v2019_05_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.v2019_05_01_preview.models.StorageAccountProperties - :param network_rule_set: The network rule set for a container registry. - :type network_rule_set: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.NetworkRuleSet - """ - - _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'}, - 'network_rule_set': {'key': 'properties.networkRuleSet', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, network_rule_set=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 - self.network_rule_set = network_rule_set diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_usage.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_usage.py deleted file mode 100644 index 38db093be69d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_usage.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_usage_list_result.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_usage_list_result.py deleted file mode 100644 index a76e04c5bf75..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_usage_list_result.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_usage_list_result_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_usage_list_result_py3.py deleted file mode 100644 index fb0852747169..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_usage_list_result_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_usage_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_usage_py3.py deleted file mode 100644 index 238d273904c0..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/registry_usage_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication.py deleted file mode 100644 index 3ae17ef21278..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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.v2019_05_01_preview.models.ProvisioningState - :ivar status: The status of the replication at the time the operation was - called. - :vartype status: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status1 - """ - - _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': 'Status1'}, - } - - def __init__(self, **kwargs): - super(Replication, self).__init__(**kwargs) - self.provisioning_state = None - self.status = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication_paged.py deleted file mode 100644 index 58d21426e00e..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication_py3.py deleted file mode 100644 index b2eca71a9b6f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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_py3 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.v2019_05_01_preview.models.ProvisioningState - :ivar status: The status of the replication at the time the operation was - called. - :vartype status: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status1 - """ - - _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': 'Status1'}, - } - - 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication_update_parameters.py deleted file mode 100644 index 003b15583a55..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication_update_parameters.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication_update_parameters_py3.py deleted file mode 100644 index 5497bcdbc1f7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/replication_update_parameters_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/request.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/request.py deleted file mode 100644 index e08090f53205..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/request.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/request_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/request_py3.py deleted file mode 100644 index f42dae28c955..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/request_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/resource.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/resource.py deleted file mode 100644 index 3965a6f0cf40..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/resource.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/resource_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/resource_py3.py deleted file mode 100644 index 3a1d4bc4edd1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/resource_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map.py deleted file mode 100644 index ea75367b04e7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map.py +++ /dev/null @@ -1,74 +0,0 @@ -# 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 ScopeMap(ProxyResource): - """An object that represents a scope map 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 description: The user friendly description of the scope map. - :type description: str - :ivar scope_map_type: The type of the scope map. E.g. BuildIn scope map. - :vartype scope_map_type: str - :ivar creation_date: The creation date of scope map. - :vartype creation_date: datetime - :ivar provisioning_state: Provisioning state of the resource. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :vartype provisioning_state: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ProvisioningState - :param actions: Required. The list of scoped permissions for registry - artifacts. - E.g. repositories/repository-name/pull, - repositories/repository-name/delete - :type actions: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'scope_map_type': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'actions': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'scope_map_type': {'key': 'properties.type', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'actions': {'key': 'properties.actions', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(ScopeMap, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.scope_map_type = None - self.creation_date = None - self.provisioning_state = None - self.actions = kwargs.get('actions', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map_paged.py deleted file mode 100644 index 11061d7f53fa..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 ScopeMapPaged(Paged): - """ - A paging container for iterating over a list of :class:`ScopeMap ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ScopeMap]'} - } - - def __init__(self, *args, **kwargs): - - super(ScopeMapPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map_py3.py deleted file mode 100644 index c95f8b30a4b3..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map_py3.py +++ /dev/null @@ -1,74 +0,0 @@ -# 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_py3 import ProxyResource - - -class ScopeMap(ProxyResource): - """An object that represents a scope map 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 description: The user friendly description of the scope map. - :type description: str - :ivar scope_map_type: The type of the scope map. E.g. BuildIn scope map. - :vartype scope_map_type: str - :ivar creation_date: The creation date of scope map. - :vartype creation_date: datetime - :ivar provisioning_state: Provisioning state of the resource. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :vartype provisioning_state: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ProvisioningState - :param actions: Required. The list of scoped permissions for registry - artifacts. - E.g. repositories/repository-name/pull, - repositories/repository-name/delete - :type actions: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'scope_map_type': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'actions': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'scope_map_type': {'key': 'properties.type', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'actions': {'key': 'properties.actions', 'type': '[str]'}, - } - - def __init__(self, *, actions, description: str=None, **kwargs) -> None: - super(ScopeMap, self).__init__(**kwargs) - self.description = description - self.scope_map_type = None - self.creation_date = None - self.provisioning_state = None - self.actions = actions diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map_update_parameters.py deleted file mode 100644 index 71ffc3337a66..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map_update_parameters.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 ScopeMapUpdateParameters(Model): - """The properties for updating the scope map. - - :param description: The user friendly description of the scope map. - :type description: str - :param actions: The list of scope permissions for registry artifacts. - E.g. repositories/repository-name/pull, - repositories/repository-name/delete - :type actions: list[str] - """ - - _attribute_map = { - 'description': {'key': 'properties.description', 'type': 'str'}, - 'actions': {'key': 'properties.actions', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(ScopeMapUpdateParameters, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.actions = kwargs.get('actions', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map_update_parameters_py3.py deleted file mode 100644 index ac4e1f812d3f..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/scope_map_update_parameters_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 ScopeMapUpdateParameters(Model): - """The properties for updating the scope map. - - :param description: The user friendly description of the scope map. - :type description: str - :param actions: The list of scope permissions for registry artifacts. - E.g. repositories/repository-name/pull, - repositories/repository-name/delete - :type actions: list[str] - """ - - _attribute_map = { - 'description': {'key': 'properties.description', 'type': 'str'}, - 'actions': {'key': 'properties.actions', 'type': '[str]'}, - } - - def __init__(self, *, description: str=None, actions=None, **kwargs) -> None: - super(ScopeMapUpdateParameters, self).__init__(**kwargs) - self.description = description - self.actions = actions diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/sku.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/sku.py deleted file mode 100644 index f24e8d8364bb..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/sku.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/sku_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/sku_py3.py deleted file mode 100644 index 2465e0a005f7..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/sku_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/source.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/source.py deleted file mode 100644 index 132f4b2c1324..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/source.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/source_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/source_py3.py deleted file mode 100644 index 5aadcd407862..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/source_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/status1.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/status1.py deleted file mode 100644 index ac9bed9fa586..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/status1.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 Status1(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(Status1, self).__init__(**kwargs) - self.display_status = None - self.message = None - self.timestamp = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/status1_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/status1_py3.py deleted file mode 100644 index 02e37716a97b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/status1_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 Status1(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(Status1, self).__init__(**kwargs) - self.display_status = None - self.message = None - self.timestamp = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/storage_account_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/storage_account_properties.py deleted file mode 100644 index 0541b7651cbd..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/storage_account_properties.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/storage_account_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/storage_account_properties_py3.py deleted file mode 100644 index 5714fde0fcd2..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/storage_account_properties_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/target.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/target.py deleted file mode 100644 index 228df1d19f00..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/target.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', '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) - self.name = kwargs.get('name', None) - self.version = kwargs.get('version', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/target_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/target_py3.py deleted file mode 100644 index 3b312ee2c0da..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/target_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - :param name: The name of the artifact. - :type name: str - :param version: The version of the artifact. - :type version: 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'}, - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', '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, name: str=None, version: 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 - self.name = name - self.version = version diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token.py deleted file mode 100644 index 379d0865f0d9..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token.py +++ /dev/null @@ -1,77 +0,0 @@ -# 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 Token(ProxyResource): - """An object that represents a token for a container registry. - - 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 - :ivar creation_date: The creation date of scope map. - :vartype creation_date: datetime - :ivar provisioning_state: Provisioning state of the resource. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :vartype provisioning_state: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ProvisioningState - :param scope_map_id: The resource ID of the scope map to which the token - will be associated with. - :type scope_map_id: str - :param object_id: The user/group/application object ID for which the token - has to be created. - :type object_id: str - :param credentials: The credentials that can be used for authenticating - the token. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCredentialsProperties - :param status: The status of the token example enabled or disabled. - Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'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'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'scope_map_id': {'key': 'properties.scopeMapId', 'type': 'str'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'credentials': {'key': 'properties.credentials', 'type': 'TokenCredentialsProperties'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Token, self).__init__(**kwargs) - self.creation_date = None - self.provisioning_state = None - self.scope_map_id = kwargs.get('scope_map_id', None) - self.object_id = kwargs.get('object_id', None) - self.credentials = kwargs.get('credentials', None) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_certificate.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_certificate.py deleted file mode 100644 index fddb93a7a647..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_certificate.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 TokenCertificate(Model): - """The properties of a certificate used for authenticating a token. - - :param name: Possible values include: 'certificate1', 'certificate2' - :type name: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCertificateName - :param expiry: The expiry datetime of the certificate. - :type expiry: datetime - :param thumbprint: The thumbprint of the certificate. - :type thumbprint: str - :param encoded_pem_certificate: Base 64 encoded string of the public - certificate1 in PEM format that will be used for authenticating the token. - :type encoded_pem_certificate: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'encoded_pem_certificate': {'key': 'encodedPemCertificate', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TokenCertificate, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.expiry = kwargs.get('expiry', None) - self.thumbprint = kwargs.get('thumbprint', None) - self.encoded_pem_certificate = kwargs.get('encoded_pem_certificate', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_certificate_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_certificate_py3.py deleted file mode 100644 index a566ad34317c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_certificate_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 TokenCertificate(Model): - """The properties of a certificate used for authenticating a token. - - :param name: Possible values include: 'certificate1', 'certificate2' - :type name: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCertificateName - :param expiry: The expiry datetime of the certificate. - :type expiry: datetime - :param thumbprint: The thumbprint of the certificate. - :type thumbprint: str - :param encoded_pem_certificate: Base 64 encoded string of the public - certificate1 in PEM format that will be used for authenticating the token. - :type encoded_pem_certificate: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'encoded_pem_certificate': {'key': 'encodedPemCertificate', 'type': 'str'}, - } - - def __init__(self, *, name=None, expiry=None, thumbprint: str=None, encoded_pem_certificate: str=None, **kwargs) -> None: - super(TokenCertificate, self).__init__(**kwargs) - self.name = name - self.expiry = expiry - self.thumbprint = thumbprint - self.encoded_pem_certificate = encoded_pem_certificate diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_credentials_properties.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_credentials_properties.py deleted file mode 100644 index 55e770ee7d3c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_credentials_properties.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TokenCredentialsProperties(Model): - """The properties of the credentials that can be used for authenticating the - token. - - :param certificates: - :type certificates: - list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCertificate] - :param passwords: - :type passwords: - list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPassword] - """ - - _attribute_map = { - 'certificates': {'key': 'certificates', 'type': '[TokenCertificate]'}, - 'passwords': {'key': 'passwords', 'type': '[TokenPassword]'}, - } - - def __init__(self, **kwargs): - super(TokenCredentialsProperties, self).__init__(**kwargs) - self.certificates = kwargs.get('certificates', None) - self.passwords = kwargs.get('passwords', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_credentials_properties_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_credentials_properties_py3.py deleted file mode 100644 index 2d2f595d9763..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_credentials_properties_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TokenCredentialsProperties(Model): - """The properties of the credentials that can be used for authenticating the - token. - - :param certificates: - :type certificates: - list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCertificate] - :param passwords: - :type passwords: - list[~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPassword] - """ - - _attribute_map = { - 'certificates': {'key': 'certificates', 'type': '[TokenCertificate]'}, - 'passwords': {'key': 'passwords', 'type': '[TokenPassword]'}, - } - - def __init__(self, *, certificates=None, passwords=None, **kwargs) -> None: - super(TokenCredentialsProperties, self).__init__(**kwargs) - self.certificates = certificates - self.passwords = passwords diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_paged.py deleted file mode 100644 index 0dfd362835d8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 TokenPaged(Paged): - """ - A paging container for iterating over a list of :class:`Token ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Token]'} - } - - def __init__(self, *args, **kwargs): - - super(TokenPaged, self).__init__(*args, **kwargs) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_password.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_password.py deleted file mode 100644 index 2bdb0a746382..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_password.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 TokenPassword(Model): - """The password that will be used for authenticating the token of a container - registry. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param creation_time: The password created datetime of the password. - :type creation_time: datetime - :param expiry: The expiry datetime of the password. - :type expiry: datetime - :param name: The password name "password" or "password2". Possible values - include: 'password1', 'password2' - :type name: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPasswordName - :ivar value: The password value. - :vartype value: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TokenPassword, self).__init__(**kwargs) - self.creation_time = kwargs.get('creation_time', None) - self.expiry = kwargs.get('expiry', None) - self.name = kwargs.get('name', None) - self.value = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_password_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_password_py3.py deleted file mode 100644 index 38ab56367b17..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_password_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 TokenPassword(Model): - """The password that will be used for authenticating the token of a container - registry. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param creation_time: The password created datetime of the password. - :type creation_time: datetime - :param expiry: The expiry datetime of the password. - :type expiry: datetime - :param name: The password name "password" or "password2". Possible values - include: 'password1', 'password2' - :type name: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPasswordName - :ivar value: The password value. - :vartype value: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, creation_time=None, expiry=None, name=None, **kwargs) -> None: - super(TokenPassword, self).__init__(**kwargs) - self.creation_time = creation_time - self.expiry = expiry - self.name = name - self.value = None diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_py3.py deleted file mode 100644 index de349e2e0e45..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_py3.py +++ /dev/null @@ -1,77 +0,0 @@ -# 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_py3 import ProxyResource - - -class Token(ProxyResource): - """An object that represents a token for a container registry. - - 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 - :ivar creation_date: The creation date of scope map. - :vartype creation_date: datetime - :ivar provisioning_state: Provisioning state of the resource. Possible - values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - 'Canceled' - :vartype provisioning_state: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ProvisioningState - :param scope_map_id: The resource ID of the scope map to which the token - will be associated with. - :type scope_map_id: str - :param object_id: The user/group/application object ID for which the token - has to be created. - :type object_id: str - :param credentials: The credentials that can be used for authenticating - the token. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCredentialsProperties - :param status: The status of the token example enabled or disabled. - Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'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'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'scope_map_id': {'key': 'properties.scopeMapId', 'type': 'str'}, - 'object_id': {'key': 'properties.objectId', 'type': 'str'}, - 'credentials': {'key': 'properties.credentials', 'type': 'TokenCredentialsProperties'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__(self, *, scope_map_id: str=None, object_id: str=None, credentials=None, status=None, **kwargs) -> None: - super(Token, self).__init__(**kwargs) - self.creation_date = None - self.provisioning_state = None - self.scope_map_id = scope_map_id - self.object_id = object_id - self.credentials = credentials - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_update_parameters.py deleted file mode 100644 index 10548e4bb508..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_update_parameters.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 TokenUpdateParameters(Model): - """The parameters for updating a token. - - :param scope_map_id: The resource ID of the scope map to which the token - will be associated with. - :type scope_map_id: str - :param status: The status of the token example enabled or disabled. - Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status - :param credentials: The credentials that can be used for authenticating - the token. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCredentialsProperties - """ - - _attribute_map = { - 'scope_map_id': {'key': 'properties.scopeMapId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'credentials': {'key': 'properties.credentials', 'type': 'TokenCredentialsProperties'}, - } - - def __init__(self, **kwargs): - super(TokenUpdateParameters, self).__init__(**kwargs) - self.scope_map_id = kwargs.get('scope_map_id', None) - self.status = kwargs.get('status', None) - self.credentials = kwargs.get('credentials', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_update_parameters_py3.py deleted file mode 100644 index c1b302e34060..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/token_update_parameters_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 TokenUpdateParameters(Model): - """The parameters for updating a token. - - :param scope_map_id: The resource ID of the scope map to which the token - will be associated with. - :type scope_map_id: str - :param status: The status of the token example enabled or disabled. - Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Status - :param credentials: The credentials that can be used for authenticating - the token. - :type credentials: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenCredentialsProperties - """ - - _attribute_map = { - 'scope_map_id': {'key': 'properties.scopeMapId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'credentials': {'key': 'properties.credentials', 'type': 'TokenCredentialsProperties'}, - } - - def __init__(self, *, scope_map_id: str=None, status=None, credentials=None, **kwargs) -> None: - super(TokenUpdateParameters, self).__init__(**kwargs) - self.scope_map_id = scope_map_id - self.status = status - self.credentials = credentials diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/trust_policy.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/trust_policy.py deleted file mode 100644 index b97407963d79..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/trust_policy.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TrustPolicy(Model): - """An object that represents content trust policy for a container registry. - - :param type: The type of trust policy. Possible values include: 'Notary' - :type type: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TrustPolicyType - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.PolicyStatus - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrustPolicy, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.status = kwargs.get('status', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/trust_policy_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/trust_policy_py3.py deleted file mode 100644 index 9d583856ecf1..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/trust_policy_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 TrustPolicy(Model): - """An object that represents content trust policy for a container registry. - - :param type: The type of trust policy. Possible values include: 'Notary' - :type type: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TrustPolicyType - :param status: The value that indicates whether the policy is enabled or - not. Possible values include: 'enabled', 'disabled' - :type status: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.PolicyStatus - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__(self, *, type=None, status=None, **kwargs) -> None: - super(TrustPolicy, self).__init__(**kwargs) - self.type = type - self.status = status diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/virtual_network_rule.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/virtual_network_rule.py deleted file mode 100644 index cc46feb24045..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/virtual_network_rule.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual network rule. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Action - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.action = kwargs.get('action', "Allow") - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/virtual_network_rule_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/virtual_network_rule_py3.py deleted file mode 100644 index d75de903f64d..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual network rule. - - All required parameters must be populated in order to send to Azure. - - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Action - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.action = action - self.virtual_network_resource_id = virtual_network_resource_id diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook.py deleted file mode 100644 index c3801f9c0d8c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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.v2019_05_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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_create_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_create_parameters.py deleted file mode 100644 index 54e1f4a374a8..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_create_parameters.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_create_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_create_parameters_py3.py deleted file mode 100644 index d91e4f44fafe..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_create_parameters_py3.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_paged.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_paged.py deleted file mode 100644 index ffb37db96c26..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_py3.py deleted file mode 100644 index a9b3face3e21..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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_py3 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.v2019_05_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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_update_parameters.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_update_parameters.py deleted file mode 100644 index 36fec40b8009..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_update_parameters.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_update_parameters_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_update_parameters_py3.py deleted file mode 100644 index 74f6307d6a47..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/models/webhook_update_parameters_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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.v2019_05_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.v2019_05_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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/__init__.py index b322d1d80e38..6454c7c8bcba 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/__init__.py @@ -9,12 +9,12 @@ # regenerated. # -------------------------------------------------------------------------- -from .registries_operations import RegistriesOperations -from .operations import Operations -from .replications_operations import ReplicationsOperations -from .webhooks_operations import WebhooksOperations -from .scope_maps_operations import ScopeMapsOperations -from .tokens_operations import TokensOperations +from ._registries_operations import RegistriesOperations +from ._operations import Operations +from ._replications_operations import ReplicationsOperations +from ._webhooks_operations import WebhooksOperations +from ._scope_maps_operations import ScopeMapsOperations +from ._tokens_operations import TokensOperations __all__ = [ 'RegistriesOperations', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_operations.py new file mode 100644 index 000000000000..a50dcf10a61f --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_operations.py @@ -0,0 +1,103 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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.v2019_05_01_preview.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2019_05_01_preview.models.OperationDefinition] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.ContainerRegistry/operations'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_registries_operations.py new file mode 100644 index 000000000000..d1b815c583c7 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_registries_operations.py @@ -0,0 +1,1192 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 _import_image_initial( + self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2017-10-01" + + # Construct URL + url = self.import_image.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', min_length=1), + '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(parameters, 'ImportImageParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 import_image( + self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Copies an image to this container registry from 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 parameters: The parameters specifying the image to copy and the + source container registry. + :type parameters: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportImageParameters + :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._import_image_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + parameters=parameters, + 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) + import_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage'} + + 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.v2019_05_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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_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.v2019_05_01_preview.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_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.v2019_05_01_preview.models.Registry] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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.v2019_05_01_preview.models.RegistryPaged[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Registry] + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + def prepare_request(next_link=None): + 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', min_length=1) + } + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2019_05_01_preview.models.RegistryPaged[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Registry] + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.RegistryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2019_05_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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2019_05_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.v2019_05_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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 list_policies( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists the policies 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: RegistryPolicies or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.RegistryPolicies + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + # Construct URL + url = self.list_policies.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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'} + + + def _update_policies_initial( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, **operation_config): + registry_policies_update_parameters = models.RegistryPolicies(quarantine_policy=quarantine_policy, trust_policy=trust_policy) + + api_version = "2017-10-01" + + # Construct URL + url = self.update_policies.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', min_length=1), + '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['Accept'] = 'application/json' + 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_policies_update_parameters, 'RegistryPolicies') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_policies( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the policies 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 quarantine_policy: An object that represents quarantine policy + for a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy + for a container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TrustPolicy + :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 RegistryPolicies or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01_preview.models.RegistryPolicies] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01_preview.models.RegistryPolicies]] + :raises: :class:`CloudError` + """ + raw_result = self._update_policies_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + quarantine_policy=quarantine_policy, + trust_policy=trust_policy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RegistryPolicies', 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_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'} + + + def _generate_credentials_initial( + self, resource_group_name, registry_name, generate_credentials_parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2019-05-01-preview" + + # Construct URL + url = self.generate_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', min_length=1), + '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['Accept'] = 'application/json' + 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(generate_credentials_parameters, 'GenerateCredentialsParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('GenerateCredentialsResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def generate_credentials( + self, resource_group_name, registry_name, generate_credentials_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Generate keys for a token of 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 generate_credentials_parameters: The parameters for generating + credentials. + :type generate_credentials_parameters: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.GenerateCredentialsParameters + :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 + GenerateCredentialsResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01_preview.models.GenerateCredentialsResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01_preview.models.GenerateCredentialsResult]] + :raises: :class:`CloudError` + """ + raw_result = self._generate_credentials_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + generate_credentials_parameters=generate_credentials_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GenerateCredentialsResult', 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) + generate_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/generateCredentials'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_replications_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_replications_operations.py new file mode 100644 index 000000000000..a42a4e5344b8 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_replications_operations.py @@ -0,0 +1,489 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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.v2019_05_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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_01_preview.models.Replication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_01_preview.models.Replication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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.v2019_05_01_preview.models.ReplicationPaged[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Replication] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.ReplicationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_scope_maps_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_scope_maps_operations.py new file mode 100644 index 000000000000..26e3e45ec9dd --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_scope_maps_operations.py @@ -0,0 +1,494 @@ +# 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 ScopeMapsOperations(object): + """ScopeMapsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2019-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-05-01-preview" + + self.config = config + + def get( + self, resource_group_name, registry_name, scope_map_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of the specified scope map. + + :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 scope_map_name: The name of the scope map. + :type scope_map_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: ScopeMap or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMap 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'scopeMapName': self._serialize.url("scope_map_name", scope_map_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('ScopeMap', 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}/scopeMaps/{scopeMapName}'} + + + def _create_initial( + self, resource_group_name, registry_name, scope_map_name, actions, description=None, custom_headers=None, raw=False, **operation_config): + scope_map_create_parameters = models.ScopeMap(description=description, actions=actions) + + # 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'scopeMapName': self._serialize.url("scope_map_name", scope_map_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['Accept'] = 'application/json' + 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(scope_map_create_parameters, 'ScopeMap') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ScopeMap', response) + if response.status_code == 201: + deserialized = self._deserialize('ScopeMap', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, scope_map_name, actions, description=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a scope map 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 scope_map_name: The name of the scope map. + :type scope_map_name: str + :param actions: The list of scoped permissions for registry artifacts. + E.g. repositories/repository-name/pull, + repositories/repository-name/delete + :type actions: list[str] + :param description: The user friendly description of the scope map. + :type description: 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 ScopeMap or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMap] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMap]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + scope_map_name=scope_map_name, + actions=actions, + description=description, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ScopeMap', 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}/scopeMaps/{scopeMapName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, scope_map_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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'scopeMapName': self._serialize.url("scope_map_name", scope_map_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 = {} + 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, header_parameters) + response = self._client.send(request, 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, scope_map_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a scope map 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 scope_map_name: The name of the scope map. + :type scope_map_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, + scope_map_name=scope_map_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}/scopeMaps/{scopeMapName}'} + + + def _update_initial( + self, resource_group_name, registry_name, scope_map_name, description=None, actions=None, custom_headers=None, raw=False, **operation_config): + scope_map_update_parameters = models.ScopeMapUpdateParameters(description=description, actions=actions) + + # 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'scopeMapName': self._serialize.url("scope_map_name", scope_map_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['Accept'] = 'application/json' + 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(scope_map_update_parameters, 'ScopeMapUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ScopeMap', response) + if response.status_code == 201: + deserialized = self._deserialize('ScopeMap', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, scope_map_name, description=None, actions=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a scope map 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 scope_map_name: The name of the scope map. + :type scope_map_name: str + :param description: The user friendly description of the scope map. + :type description: str + :param actions: The list of scope permissions for registry artifacts. + E.g. repositories/repository-name/pull, + repositories/repository-name/delete + :type actions: list[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 ScopeMap or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMap] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMap]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + scope_map_name=scope_map_name, + description=description, + actions=actions, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ScopeMap', 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}/scopeMaps/{scopeMapName}'} + + def list( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists all the scope maps 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 ScopeMap + :rtype: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMapPaged[~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMap] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.ScopeMapPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_tokens_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_tokens_operations.py new file mode 100644 index 000000000000..cb34580c6f38 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_tokens_operations.py @@ -0,0 +1,480 @@ +# 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 TokensOperations(object): + """TokensOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2019-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-05-01-preview" + + self.config = config + + def get( + self, resource_group_name, registry_name, token_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of the specified token. + + :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 token_name: The name of the token. + :type token_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: Token or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token + 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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'tokenName': self._serialize.url("token_name", token_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Token', 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}/tokens/{tokenName}'} + + + def _create_initial( + self, resource_group_name, registry_name, token_name, token_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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'tokenName': self._serialize.url("token_name", token_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['Accept'] = 'application/json' + 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(token_create_parameters, 'Token') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Token', response) + if response.status_code == 201: + deserialized = self._deserialize('Token', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, token_name, token_create_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a token 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 token_name: The name of the token. + :type token_name: str + :param token_create_parameters: The parameters for creating a token. + :type token_create_parameters: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token + :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 Token or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + token_name=token_name, + token_create_parameters=token_create_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Token', 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}/tokens/{tokenName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, token_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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'tokenName': self._serialize.url("token_name", token_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 = {} + 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, header_parameters) + response = self._client.send(request, 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, token_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a token 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 token_name: The name of the token. + :type token_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, + token_name=token_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}/tokens/{tokenName}'} + + + def _update_initial( + self, resource_group_name, registry_name, token_name, token_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', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'tokenName': self._serialize.url("token_name", token_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['Accept'] = 'application/json' + 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(token_update_parameters, 'TokenUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Token', response) + if response.status_code == 201: + deserialized = self._deserialize('Token', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, token_name, token_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a token 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 token_name: The name of the token. + :type token_name: str + :param token_update_parameters: The parameters for updating a token. + :type token_update_parameters: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenUpdateParameters + :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 Token or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + token_name=token_name, + token_update_parameters=token_update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Token', 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}/tokens/{tokenName}'} + + def list( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists all the tokens 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 Token + :rtype: + ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPaged[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.TokenPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_webhooks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_webhooks_operations.py new file mode 100644 index 000000000000..ffa2be8400da --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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.v2019_05_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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_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.v2019_05_01_preview.models.Webhook] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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', min_length=1), + '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 = {} + 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, header_parameters) + response = self._client.send(request, 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters, body_content) + response = self._client.send(request, 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.v2019_05_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.v2019_05_01_preview.models.Webhook] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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.v2019_05_01_preview.models.WebhookPaged[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Webhook] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.WebhookPaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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.v2019_05_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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2019_05_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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.v2019_05_01_preview.models.EventPaged[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Event] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + '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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.EventPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_events.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/operations.py deleted file mode 100644 index f6c7458934a4..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# 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.v2019_05_01_preview.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2019_05_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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/registries_operations.py deleted file mode 100644 index 614becb0cc4b..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/registries_operations.py +++ /dev/null @@ -1,1192 +0,0 @@ -# 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 _import_image_initial( - self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2017-10-01" - - # Construct URL - url = self.import_image.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', min_length=1), - '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(parameters, 'ImportImageParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 import_image( - self, resource_group_name, registry_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Copies an image to this container registry from 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 parameters: The parameters specifying the image to copy and the - source container registry. - :type parameters: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ImportImageParameters - :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._import_image_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - parameters=parameters, - 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) - import_image.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage'} - - 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.v2019_05_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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_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.v2019_05_01_preview.models.Registry] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_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.v2019_05_01_preview.models.Registry] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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.v2019_05_01_preview.models.RegistryPaged[~azure.mgmt.containerregistry.v2019_05_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', min_length=1) - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_05_01_preview.models.RegistryPaged[~azure.mgmt.containerregistry.v2019_05_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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_05_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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_05_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.v2019_05_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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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 list_policies( - self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): - """Lists the policies 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: RegistryPolicies or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.RegistryPolicies - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2017-10-01" - - # Construct URL - url = self.list_policies.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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('RegistryPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'} - - - def _update_policies_initial( - self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, **operation_config): - registry_policies_update_parameters = models.RegistryPolicies(quarantine_policy=quarantine_policy, trust_policy=trust_policy) - - api_version = "2017-10-01" - - # Construct URL - url = self.update_policies.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', min_length=1), - '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['Accept'] = 'application/json' - 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_policies_update_parameters, 'RegistryPolicies') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('RegistryPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update_policies( - self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates the policies 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 quarantine_policy: An object that represents quarantine policy - for a container registry. - :type quarantine_policy: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.QuarantinePolicy - :param trust_policy: An object that represents content trust policy - for a container registry. - :type trust_policy: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TrustPolicy - :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 RegistryPolicies or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01_preview.models.RegistryPolicies] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01_preview.models.RegistryPolicies]] - :raises: :class:`CloudError` - """ - raw_result = self._update_policies_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - quarantine_policy=quarantine_policy, - trust_policy=trust_policy, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('RegistryPolicies', 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_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'} - - - def _generate_credentials_initial( - self, resource_group_name, registry_name, generate_credentials_parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2019-05-01-preview" - - # Construct URL - url = self.generate_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', min_length=1), - '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['Accept'] = 'application/json' - 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(generate_credentials_parameters, 'GenerateCredentialsParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('GenerateCredentialsResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def generate_credentials( - self, resource_group_name, registry_name, generate_credentials_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Generate keys for a token of 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 generate_credentials_parameters: The parameters for generating - credentials. - :type generate_credentials_parameters: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.GenerateCredentialsParameters - :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 - GenerateCredentialsResult or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01_preview.models.GenerateCredentialsResult] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01_preview.models.GenerateCredentialsResult]] - :raises: :class:`CloudError` - """ - raw_result = self._generate_credentials_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - generate_credentials_parameters=generate_credentials_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('GenerateCredentialsResult', 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) - generate_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/generateCredentials'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/replications_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/replications_operations.py deleted file mode 100644 index 538f4f5f9567..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/replications_operations.py +++ /dev/null @@ -1,486 +0,0 @@ -# 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.v2019_05_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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_01_preview.models.Replication] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_01_preview.models.Replication] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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.v2019_05_01_preview.models.ReplicationPaged[~azure.mgmt.containerregistry.v2019_05_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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/scope_maps_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/scope_maps_operations.py deleted file mode 100644 index a127385ccc3c..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/scope_maps_operations.py +++ /dev/null @@ -1,491 +0,0 @@ -# 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 ScopeMapsOperations(object): - """ScopeMapsOperations 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: "2019-05-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-05-01-preview" - - self.config = config - - def get( - self, resource_group_name, registry_name, scope_map_name, custom_headers=None, raw=False, **operation_config): - """Gets the properties of the specified scope map. - - :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 scope_map_name: The name of the scope map. - :type scope_map_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: ScopeMap or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMap 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'scopeMapName': self._serialize.url("scope_map_name", scope_map_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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('ScopeMap', 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}/scopeMaps/{scopeMapName}'} - - - def _create_initial( - self, resource_group_name, registry_name, scope_map_name, actions, description=None, custom_headers=None, raw=False, **operation_config): - scope_map_create_parameters = models.ScopeMap(description=description, actions=actions) - - # 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'scopeMapName': self._serialize.url("scope_map_name", scope_map_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['Accept'] = 'application/json' - 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(scope_map_create_parameters, 'ScopeMap') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ScopeMap', response) - if response.status_code == 201: - deserialized = self._deserialize('ScopeMap', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, registry_name, scope_map_name, actions, description=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates a scope map 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 scope_map_name: The name of the scope map. - :type scope_map_name: str - :param actions: The list of scoped permissions for registry artifacts. - E.g. repositories/repository-name/pull, - repositories/repository-name/delete - :type actions: list[str] - :param description: The user friendly description of the scope map. - :type description: 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 ScopeMap or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMap] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMap]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - scope_map_name=scope_map_name, - actions=actions, - description=description, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ScopeMap', 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}/scopeMaps/{scopeMapName}'} - - - def _delete_initial( - self, resource_group_name, registry_name, scope_map_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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'scopeMapName': self._serialize.url("scope_map_name", scope_map_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 = {} - 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, header_parameters) - response = self._client.send(request, 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, scope_map_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes a scope map 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 scope_map_name: The name of the scope map. - :type scope_map_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, - scope_map_name=scope_map_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}/scopeMaps/{scopeMapName}'} - - - def _update_initial( - self, resource_group_name, registry_name, scope_map_name, description=None, actions=None, custom_headers=None, raw=False, **operation_config): - scope_map_update_parameters = models.ScopeMapUpdateParameters(description=description, actions=actions) - - # 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'scopeMapName': self._serialize.url("scope_map_name", scope_map_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['Accept'] = 'application/json' - 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(scope_map_update_parameters, 'ScopeMapUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ScopeMap', response) - if response.status_code == 201: - deserialized = self._deserialize('ScopeMap', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, registry_name, scope_map_name, description=None, actions=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates a scope map 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 scope_map_name: The name of the scope map. - :type scope_map_name: str - :param description: The user friendly description of the scope map. - :type description: str - :param actions: The list of scope permissions for registry artifacts. - E.g. repositories/repository-name/pull, - repositories/repository-name/delete - :type actions: list[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 ScopeMap or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMap] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMap]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - scope_map_name=scope_map_name, - description=description, - actions=actions, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ScopeMap', 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}/scopeMaps/{scopeMapName}'} - - def list( - self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): - """Lists all the scope maps 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 ScopeMap - :rtype: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMapPaged[~azure.mgmt.containerregistry.v2019_05_01_preview.models.ScopeMap] - :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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.ScopeMapPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ScopeMapPaged(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}/scopeMaps'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/tokens_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/tokens_operations.py deleted file mode 100644 index b19ad6381a25..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/tokens_operations.py +++ /dev/null @@ -1,477 +0,0 @@ -# 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 TokensOperations(object): - """TokensOperations 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: "2019-05-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-05-01-preview" - - self.config = config - - def get( - self, resource_group_name, registry_name, token_name, custom_headers=None, raw=False, **operation_config): - """Gets the properties of the specified token. - - :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 token_name: The name of the token. - :type token_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: Token or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token - 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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'tokenName': self._serialize.url("token_name", token_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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('Token', 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}/tokens/{tokenName}'} - - - def _create_initial( - self, resource_group_name, registry_name, token_name, token_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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'tokenName': self._serialize.url("token_name", token_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['Accept'] = 'application/json' - 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(token_create_parameters, 'Token') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Token', response) - if response.status_code == 201: - deserialized = self._deserialize('Token', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, registry_name, token_name, token_create_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates a token 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 token_name: The name of the token. - :type token_name: str - :param token_create_parameters: The parameters for creating a token. - :type token_create_parameters: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token - :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 Token or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - token_name=token_name, - token_create_parameters=token_create_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Token', 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}/tokens/{tokenName}'} - - - def _delete_initial( - self, resource_group_name, registry_name, token_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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'tokenName': self._serialize.url("token_name", token_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 = {} - 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, header_parameters) - response = self._client.send(request, 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, token_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes a token 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 token_name: The name of the token. - :type token_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, - token_name=token_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}/tokens/{tokenName}'} - - - def _update_initial( - self, resource_group_name, registry_name, token_name, token_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', min_length=1), - 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), - 'tokenName': self._serialize.url("token_name", token_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['Accept'] = 'application/json' - 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(token_update_parameters, 'TokenUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('Token', response) - if response.status_code == 201: - deserialized = self._deserialize('Token', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, registry_name, token_name, token_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates a token 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 token_name: The name of the token. - :type token_name: str - :param token_update_parameters: The parameters for updating a token. - :type token_update_parameters: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenUpdateParameters - :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 Token or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - registry_name=registry_name, - token_name=token_name, - token_update_parameters=token_update_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Token', 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}/tokens/{tokenName}'} - - def list( - self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): - """Lists all the tokens 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 Token - :rtype: - ~azure.mgmt.containerregistry.v2019_05_01_preview.models.TokenPaged[~azure.mgmt.containerregistry.v2019_05_01_preview.models.Token] - :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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.TokenPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.TokenPaged(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}/tokens'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/webhooks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/webhooks_operations.py deleted file mode 100644 index dce775f25310..000000000000 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/webhooks_operations.py +++ /dev/null @@ -1,690 +0,0 @@ -# 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.v2019_05_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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_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.v2019_05_01_preview.models.Webhook] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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', min_length=1), - '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 = {} - 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, header_parameters) - response = self._client.send(request, 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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters, body_content) - response = self._client.send(request, 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.v2019_05_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.v2019_05_01_preview.models.Webhook] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_05_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.v2019_05_01_preview.models.WebhookPaged[~azure.mgmt.containerregistry.v2019_05_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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_05_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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_05_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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.v2019_05_01_preview.models.EventPaged[~azure.mgmt.containerregistry.v2019_05_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', min_length=1), - '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/version.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/version.py index 4732fdfc6726..3a65e38d32c2 100755 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/version.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/version.py @@ -9,4 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0rc1" +VERSION = "3.0.0rc2" diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/dev_requirements.txt b/sdk/containerregistry/azure-mgmt-containerregistry/dev_requirements.txt index fe6f543ba71c..b31282865c30 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/dev_requirements.txt +++ b/sdk/containerregistry/azure-mgmt-containerregistry/dev_requirements.txt @@ -1,2 +1,2 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools -e ../../storage/azure-mgmt-storage diff --git a/sdk/containerservice/azure-mgmt-containerservice/dev_requirements.txt b/sdk/containerservice/azure-mgmt-containerservice/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/dev_requirements.txt +++ b/sdk/containerservice/azure-mgmt-containerservice/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/core/azure-common/HISTORY.rst b/sdk/core/azure-common/HISTORY.rst index a9b3fea43c20..b81ec4774c1b 100644 --- a/sdk/core/azure-common/HISTORY.rst +++ b/sdk/core/azure-common/HISTORY.rst @@ -3,6 +3,11 @@ Release History =============== +1.1.22 (2019-06-06) ++++++++++++++++++++ + +- Fix KeyVaultClient support for get_client_from_auth_file + 1.1.21 (2019-05-21) +++++++++++++++++++ diff --git a/sdk/core/azure-common/azure/common/_version.py b/sdk/core/azure-common/azure/common/_version.py index 5e59067ce1d5..35cfcd913163 100644 --- a/sdk/core/azure-common/azure/common/_version.py +++ b/sdk/core/azure-common/azure/common/_version.py @@ -4,4 +4,4 @@ # license information. #-------------------------------------------------------------------------- -VERSION = "1.1.21" +VERSION = "1.1.22" diff --git a/sdk/core/azure-common/azure/common/client_factory.py b/sdk/core/azure-common/azure/common/client_factory.py index b69cd83d238d..f61220ed6c63 100644 --- a/sdk/core/azure-common/azure/common/client_factory.py +++ b/sdk/core/azure-common/azure/common/client_factory.py @@ -22,10 +22,10 @@ def _instantiate_client(client_class, **kwargs): - """Instantiate a client from kwargs, removing the subscription_id/tenant_id argument if unsupported. + """Instantiate a client from kwargs, removing the subscription_id/tenant_id/base_url argument if unsupported. """ args = get_arg_spec(client_class.__init__).args - for key in ['subscription_id', 'tenant_id']: + for key in ['subscription_id', 'tenant_id', 'base_url']: if key not in kwargs: continue if key not in args: @@ -144,6 +144,7 @@ def get_client_from_json_dict(client_class, config_dict, **kwargs): :return: An instantiated client """ is_graphrbac = client_class.__name__ == 'GraphRbacManagementClient' + is_keyvault = client_class.__name__ == 'KeyVaultClient' parameters = { 'subscription_id': config_dict.get('subscriptionId'), 'base_url': config_dict.get('resourceManagerEndpointUrl'), @@ -156,6 +157,8 @@ def get_client_from_json_dict(client_class, config_dict, **kwargs): # Get the right resource for Credentials if is_graphrbac: resource = config_dict['activeDirectoryGraphResourceId'] + elif is_keyvault: + resource = "https://vault.azure.net" else: if "activeDirectoryResourceId" not in config_dict and 'resourceManagerEndpointUrl' not in config_dict: raise ValueError("Need activeDirectoryResourceId or resourceManagerEndpointUrl key") diff --git a/sdk/core/azure-common/dev_requirements.txt b/sdk/core/azure-common/dev_requirements.txt index 8ffd9e3035d1..f6457a93d5e8 100644 --- a/sdk/core/azure-common/dev_requirements.txt +++ b/sdk/core/azure-common/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/core/azure-common/tests/test_client_factory.py b/sdk/core/azure-common/tests/test_client_factory.py index 01705df55d21..59e14ef82056 100644 --- a/sdk/core/azure-common/tests/test_client_factory.py +++ b/sdk/core/azure-common/tests/test_client_factory.py @@ -148,6 +148,13 @@ def __init__(self, credentials, tenant_id, base_url): self.tenant_id = tenant_id self.base_url = base_url + class KeyVaultClient(object): + def __init__(self, credentials): + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + + self.credentials = credentials + for encoding in ['utf-8', 'utf-8-sig', 'ascii']: temp_auth_file = tempfile.NamedTemporaryFile(delete=False) @@ -195,6 +202,13 @@ def __init__(self, credentials, tenant_id, base_url): 'password' ) + client = get_client_from_auth_file(KeyVaultClient, temp_auth_file.name) + assert client.credentials._args == ( + "https://vault.azure.net", + 'a2ab11af-01aa-4759-8345-7803287dbd39', + 'password' + ) + os.unlink(temp_auth_file.name) diff --git a/sdk/core/azure-core/HISTORY.md b/sdk/core/azure-core/HISTORY.md index d8a7199ae654..7e2f9250864e 100644 --- a/sdk/core/azure-core/HISTORY.md +++ b/sdk/core/azure-core/HISTORY.md @@ -1,5 +1,8 @@ -v0.0.1 (unreleased) +# Release History + ------------------- -- New pipeline \ No newline at end of file +2019-06-07 Version 0.0.1 + +- Preview release diff --git a/sdk/core/azure-core/README.md b/sdk/core/azure-core/README.md index 32db2cd340bc..2421a0b13aa5 100644 --- a/sdk/core/azure-core/README.md +++ b/sdk/core/azure-core/README.md @@ -4,12 +4,12 @@ ## Pipeline -The Azure Core pipeline is a re-strucuting of the msrest pipeline introduced in msrest 0.6.0. +The Azure Core pipeline is a re-structuring of the msrest pipeline introduced in msrest 0.6.0. Further discussions on the msrest implementation can be found in the [msrest wiki](https://github.com/Azure/msrest-for-python/wiki/msrest-0.6.0---Pipeline). The Azure Core Pipeline is an implementation of chained policies as described in the [Azure SDK guidelines](https://github.com/Azure/azure-sdk/tree/master/docs/design). -The Python implementation of the pipeline has some mechanisms specific to Python. This is due to the fact that both synchronous and asynchronous implementations of the pipeline must be supported indepedently. +The Python implementation of the pipeline has some mechanisms specific to Python. This is due to the fact that both synchronous and asynchronous implementations of the pipeline must be supported independently. When constructing an SDK, a developer may consume the pipeline like so: @@ -22,26 +22,28 @@ from azure.core.pipeline.policies import ( RetryPolicy, RedirectPolicy, BearerTokenCredentialPolicy, - ContentDecodePolicy + ContentDecodePolicy, + NetworkTraceLoggingPolicy, + ProxyPolicy ) class FooServiceClient(): @staticmethod - def create_config(**kwargs): + def create_config(credential, scopes, **kwargs): # Here the SDK developer would define the default # config to interact with the service config = Configuration(**kwargs) config.headers_policy = HeadersPolicy({"CustomHeader": "Value"}, **kwargs) config.user_agent_policy = UserAgentPolicy("ServiceUserAgentValue", **kwargs) - config.authentication_policy = BearerTokenCredentialPolicy(credential, **kwargs) + config.authentication_policy = BearerTokenCredentialPolicy(credential, scopes, **kwargs) config.retry_policy = RetryPolicy(**kwargs) config.redirect_policy = RedirectPolicy(**kwargs) config.logging_policy = NetworkTraceLoggingPolicy(**kwargs) config.proxy_policy = ProxyPolicy(**kwargs) config.transport = kwargs.get('transport', RequestsTransport) - def __init__(self, endpoint=None, credentials=None, configuration=None, **kwargs): + def __init__(self, transport=None, configuration=None, **kwargs): config = configuration or FooServiceClient.create_config(**kwargs) transport = config.get_transport(**kwargs) policies = [ @@ -92,7 +94,7 @@ response = client.get_foo_properties(redirects_max=0) # Scenario where user wishes to fully customize the policies. # We expose the SDK-developer defined configuration to allow it to be tweaked # or entire policies replaced or patched. -foo_config = FooserviceClient.create_config() +foo_config = FooServiceClient.create_config() foo_config.retry_policy = CustomRetryPolicy() foo_config.redirect_policy.max_redirects = 5 @@ -120,7 +122,7 @@ transport = RequestsTransport(config) policies = [ config.headers_policy, config.user_agent_policy, - config.authentication_policy, # Credentials policy needs to be inserted after all request mutation to accomodate signing. + config.authentication_policy, # Authentication policy needs to be inserted after all request mutation to accommodate signing. ContentDecodePolicy(), config.redirect_policy, config.retry_policy, @@ -137,6 +139,8 @@ The policies that should currently be defined on the Configuration object are as - Configuration.user_agent_policy # UserAgentPolicy - Configuration.connection # The is a ConnectionConfiguration, used to provide common transport parameters. - Configuration.proxy_policy # While this is a ProxyPolicy object, current implementation is transport configuration. +- Configuration.authentication_policy # BearerTokenCredentialPolicy + ``` ### Transport @@ -151,15 +155,15 @@ synchronous_transport = RequestsTransport() ``` For asynchronous pipelines a couple of transport options are available. Each of these transports are interchangable depending on whether the user has installed various 3rd party dependencies (i.e. aiohttp or trio), and the user -should easily be able to specify their chosen transport. SDK developers should use the `aiohttp` transport as the default for asynchronous pipelines where the user has not specified as alternative. +should easily be able to specify their chosen transport. SDK developers should use the `aiohttp` transport as the default for asynchronous pipelines where the user has not specified an alternative. ``` from azure.foo.aio import FooServiceClient from azure.core.pipeline.transport import ( - # Identical implementation as the synchronous RequestsTrasport wrapped in an asynchronous using the + # Identical implementation as the synchronous RequestsTransport wrapped in an asynchronous using the # built-in asyncio event loop. AsyncioRequestsTransport, - # Identical implementation as the synchronous RequestsTrasport wrapped in an asynchronous using the + # Identical implementation as the synchronous RequestsTransport wrapped in an asynchronous using the # third party trio event loop. TrioRequestsTransport, @@ -176,16 +180,19 @@ Some common properties can be configured on all transports, and can be set on th class ConnectionConfiguration(object): """Configuration of HTTP transport. - :param connection_timeout: The connect and read timeout value, in seconds. Default value is 100. - :param verify: SSL certificate verification. Enabled by default. Set to False to disable, alternatively - can be set to the path to a CA_BUNDLE file or directory with certificates of trusted CAs. - :param cert: Client-side certificates. You can specify a local cert to use as client side certificate, as a single file (containing the private key and the certificate) or as a tuple of both files’ paths. + :param int connection_timeout: The connect and read timeout value. Defaults to 100 seconds. + :param bool connection_verify: SSL certificate verification. Enabled by default. Set to False to disable, + alternatively can be set to the path to a CA_BUNDLE file or directory with certificates of trusted CAs. + :param str connection_cert: Client-side certificates. You can specify a local cert to use as client side + certificate, as a single file (containing the private key and the certificate) or as a tuple of both files' paths. + :param int connection_data_block_size: The block size of data sent over the connection. Defaults to 4096 bytes. """ def __init__(self, **kwargs): self.timeout = kwargs.pop('connection_timeout', 100) self.verify = kwargs.pop('connection_verify', True) self.cert = kwargs.pop('connection_cert', None) + self.data_block_size = kwargs.pop('connection_data_block_size', 4096) ``` ### HttpRequest and HttpResponse @@ -283,7 +290,7 @@ While the SDK developer will not construct the PipelineRequest explicitly, they object that is returned from `pipeline.run()` These objects are universal for all transports, both synchronous and asynchronous. -The pipeline request and response containers are also responsable for carrying a `context` object. This is +The pipeline request and response containers are also responsible for carrying a `context` object. This is transport specific and can contain data persisted between pipeline requests (for example reusing an open connection pool or "session"), as well as used by the SDK developer to carry arbitrary data through the pipeline. @@ -372,7 +379,7 @@ Currently provided HTTP policies include: ```python from azure.core.pipeline.policies import ( RetryPolicy, - AsyncRetryPolicy. + AsyncRetryPolicy, RedirectPolicy, AsyncRedirectPolicy ) @@ -385,8 +392,8 @@ A pipeline can either be synchronous or asynchronous. The pipeline does not expose the policy chain, so individual policies cannot/should not be further configured once the pipeline has been instantiated. -The pipeline hasa single exposed operation: `run(request)` which will seen a new HttpRequest object down -the pipeline. This operation returns a `PipelineResonse` object. +The pipeline has a single exposed operation: `run(request)` which will send a new HttpRequest object down +the pipeline. This operation returns a `PipelineResponse` object. ```python class Pipeline: diff --git a/sdk/core/azure-core/azure/core/__init__.py b/sdk/core/azure-core/azure/core/__init__.py index 428e625cfef7..a3a006a00e5d 100644 --- a/sdk/core/azure-core/azure/core/__init__.py +++ b/sdk/core/azure-core/azure/core/__init__.py @@ -24,7 +24,8 @@ # # -------------------------------------------------------------------------- -__version__ = "0.0.1" +from .version import VERSION +__version__ = VERSION from .configuration import Configuration from .pipeline_client import PipelineClient diff --git a/sdk/core/azure-core/azure/core/async_paging.py b/sdk/core/azure-core/azure/core/async_paging.py index dc7c62a0150d..4a4af4d28cc5 100644 --- a/sdk/core/azure-core/azure/core/async_paging.py +++ b/sdk/core/azure-core/azure/core/async_paging.py @@ -31,7 +31,9 @@ class AsyncPagedMixin(AsyncIterator): """Bring async to Paging. - :param async_command: Mandatory keyword argument for this mixin to work. + **Keyword argument:** + + *async_command* - Mandatory keyword argument for this mixin to work. """ def __init__(self, *args, **kwargs): # pylint: disable=unused-argument self._async_get_next = kwargs.get("async_command") diff --git a/sdk/core/azure-core/azure/core/configuration.py b/sdk/core/azure-core/azure/core/configuration.py index 88fda748dcc5..62b40bbae6cd 100644 --- a/sdk/core/azure-core/azure/core/configuration.py +++ b/sdk/core/azure-core/azure/core/configuration.py @@ -50,7 +50,7 @@ class Configuration(object): TrioRequestsTransport, AioHttpTransport. Example: - .. literalinclude:: ../../examples/examples_config.py + .. literalinclude:: ../examples/examples_config.py :start-after: [START configuration] :end-before: [END configuration] :language: python @@ -92,7 +92,7 @@ def __init__(self, transport=None, **kwargs): class ConnectionConfiguration(object): """HTTP transport connection configuration settings. - Common properies that can be configured on all transports. Found in the + Common properties that can be configured on all transports. Found in the Configuration object. :param int connection_timeout: The connect and read timeout value. Defaults to 100 seconds. @@ -103,7 +103,7 @@ class ConnectionConfiguration(object): :param int connection_data_block_size: The block size of data sent over the connection. Defaults to 4096 bytes. Example: - .. literalinclude:: ../../examples/examples_config.py + .. literalinclude:: ../examples/examples_config.py :start-after: [START connection_configuration] :end-before: [END connection_configuration] :language: python diff --git a/sdk/core/azure-core/azure/core/credentials.py b/sdk/core/azure-core/azure/core/credentials.py index ee9e1e42953a..8a2dfab3dec1 100644 --- a/sdk/core/azure-core/azure/core/credentials.py +++ b/sdk/core/azure-core/azure/core/credentials.py @@ -3,16 +3,15 @@ # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- -from typing import Iterable # pylint:disable=unused-import from typing_extensions import Protocol -class SupportsGetToken(Protocol): +class TokenCredential(Protocol): """Protocol for classes able to provide OAuth tokens. :param str scopes: Lets you specify the type of access needed. """ # pylint:disable=too-few-public-methods - def get_token(self, scopes): - # type: (Iterable[str]) -> str + def get_token(self, *scopes): + # type: (*str) -> str pass diff --git a/sdk/core/azure-core/azure/core/exceptions.py b/sdk/core/azure-core/azure/core/exceptions.py index e09a301ce446..66b0b00ab1ff 100644 --- a/sdk/core/azure-core/azure/core/exceptions.py +++ b/sdk/core/azure-core/azure/core/exceptions.py @@ -36,11 +36,14 @@ def raise_with_traceback(exception, *args, **kwargs): # type: (Callable, Any, Any) -> None """Raise exception with a specified traceback. This MUST be called inside a "except" clause. + :param Exception exception: Error type to be raised. :param args: Any additional args to be included with exception. :param kwargs: Keyword arguments to include with the exception. - Keyword arguments: - message Message to be associated with the exception. If omitted, defaults to an empty string. + + **Keyword argument:** + + *message (str)* - Message to be associated with the exception. If omitted, defaults to an empty string. """ message = kwargs.pop('message', '') exc_type, exc_value, exc_traceback = sys.exc_info() @@ -95,8 +98,9 @@ class ServiceResponseError(AzureError): class HttpResponseError(AzureError): """A request was made, and a non-success status code was received from the service. - :ivar status_code: HttpResponse's status code - :ivar response: The response that triggered the exception. + + :param status_code: HttpResponse's status code + :param response: The response that triggered the exception. """ def __init__(self, message=None, response=None, **kwargs): diff --git a/sdk/core/azure-core/azure/core/paging.py b/sdk/core/azure-core/azure/core/paging.py index 871730360e92..9a04250dc932 100644 --- a/sdk/core/azure-core/azure/core/paging.py +++ b/sdk/core/azure-core/azure/core/paging.py @@ -46,7 +46,8 @@ class AsyncPagedMixin(object): # type: ignore class Paged(AsyncPagedMixin, Iterator): """A container for paged REST responses. - :param HttpResponse response: server response object. + :param response: server response object. + :type response: ~azure.core.pipeline.transport.HttpResponse :param callable command: Function to retrieve the next page of items. :param Deserializer deserializer: a Deserializer instance to use """ diff --git a/sdk/core/azure-core/azure/core/pipeline/__init__.py b/sdk/core/azure-core/azure/core/pipeline/__init__.py index e004df81fbd0..2df1fbfea898 100644 --- a/sdk/core/azure-core/azure/core/pipeline/__init__.py +++ b/sdk/core/azure-core/azure/core/pipeline/__init__.py @@ -50,8 +50,7 @@ def __exit__(self, exc_type, exc_value, traceback): class PipelineContext(dict): - """A context object carried by the pipeline request and - response containers. + """A context object carried by the pipeline request and response containers. This is transport specific and can contain data persisted between pipeline requests (for example reusing an open connection pool or "session"), @@ -77,12 +76,22 @@ def __delitem__(self, key): return super(PipelineContext, self).__delitem__(key) def clear(self): + """Context objects cannot be cleared. + + :raises: TypeError + """ raise TypeError("Context objects cannot be cleared.") def update(self, *args, **kwargs): + """Context objects cannot be updated. + + :raises: TypeError + """ raise TypeError("Context objects cannot be updated.") def pop(self, *args): + """Removes specified key and returns the value. + """ if args and args[0] in self._protected: raise ValueError('Context value {} cannot be popped.'.format(args[0])) return super(PipelineContext, self).pop(*args) diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/__init__.py b/sdk/core/azure-core/azure/core/pipeline/policies/__init__.py index ecf999a66aba..6f8a456d2b82 100644 --- a/sdk/core/azure-core/azure/core/pipeline/policies/__init__.py +++ b/sdk/core/azure-core/azure/core/pipeline/policies/__init__.py @@ -25,7 +25,7 @@ # -------------------------------------------------------------------------- from .base import HTTPPolicy, SansIOHTTPPolicy -from .credentials import BearerTokenCredentialPolicy +from .authentication import BearerTokenCredentialPolicy from .custom_hook import CustomHookPolicy from .redirect import RedirectPolicy from .retry import RetryPolicy @@ -55,7 +55,7 @@ try: from .base_async import AsyncHTTPPolicy - from .credentials_async import AsyncBearerTokenCredentialPolicy + from .authentication_async import AsyncBearerTokenCredentialPolicy from .redirect_async import AsyncRedirectPolicy from .retry_async import AsyncRetryPolicy __all__.extend([ diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/authentication.py b/sdk/core/azure-core/azure/core/pipeline/policies/authentication.py new file mode 100644 index 000000000000..433613746fec --- /dev/null +++ b/sdk/core/azure-core/azure/core/pipeline/policies/authentication.py @@ -0,0 +1,65 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from . import HTTPPolicy + +try: + from typing import TYPE_CHECKING # pylint:disable=unused-import +except ImportError: + TYPE_CHECKING = False + +if TYPE_CHECKING: + # pylint:disable=unused-import + from typing import Any, Dict, Iterable, Mapping + from azure.core.credentials import TokenCredential + from azure.core.pipeline import PipelineRequest, PipelineResponse + + +# pylint:disable=too-few-public-methods +class _BearerTokenCredentialPolicyBase(object): + """Base class for a Bearer Token Credential Policy. + + :param credential: The credential. + :type credential: ~azure.core.credentials.TokenCredential + :param str scopes: Lets you specify the type of access needed. + """ + + def __init__(self, credential, *scopes, **kwargs): # pylint:disable=unused-argument + # type: (TokenCredential, *str, Mapping[str, Any]) -> None + super(_BearerTokenCredentialPolicyBase, self).__init__() + self._scopes = scopes + self._credential = credential + + @staticmethod + def _update_headers(headers, token): + # type: (Dict[str, str], str) -> None + """Updates the Authorization header with the bearer token. + + :param dict headers: The HTTP Request headers + :param str token: The OAuth token. + """ + headers["Authorization"] = "Bearer {}".format(token) + + +class BearerTokenCredentialPolicy(_BearerTokenCredentialPolicyBase, HTTPPolicy): + """Adds a bearer token Authorization header to requests. + + :param credential: The credential. + :type credential: ~azure.core.TokenCredential + :param str scopes: Lets you specify the type of access needed. + """ + + def send(self, request): + # type: (PipelineRequest) -> PipelineResponse + """Adds a bearer token Authorization header to request and sends request to next policy. + + :param request: The pipeline request object + :type request: ~azure.core.pipeline.PipelineRequest + :return: The pipeline response object + :rtype: ~azure.core.pipeline.PipelineResponse + """ + token = self._credential.get_token(*self._scopes) + self._update_headers(request.http_request.headers, token) # type: ignore + return self.next.send(request) diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/authentication_async.py b/sdk/core/azure-core/azure/core/pipeline/policies/authentication_async.py new file mode 100644 index 000000000000..bea06171a91d --- /dev/null +++ b/sdk/core/azure-core/azure/core/pipeline/policies/authentication_async.py @@ -0,0 +1,30 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from azure.core.pipeline import PipelineRequest, PipelineResponse +from azure.core.pipeline.policies import AsyncHTTPPolicy +from azure.core.pipeline.policies.authentication import _BearerTokenCredentialPolicyBase + + +class AsyncBearerTokenCredentialPolicy(_BearerTokenCredentialPolicyBase, AsyncHTTPPolicy): + # pylint:disable=too-few-public-methods + """Adds a bearer token Authorization header to requests. + + :param credential: The credential. + :type credential: ~azure.core.credentials.TokenCredential + :param str scopes: Lets you specify the type of access needed. + """ + + async def send(self, request: PipelineRequest) -> PipelineResponse: + """Aync flavor that adds a bearer token Authorization header to request and sends request to next policy. + + :param request: The pipeline request object to be modified. + :type request: ~azure.core.pipeline.PipelineRequest + :return: The pipeline response object + :rtype: ~azure.core.pipeline.PipelineResponse + """ + token = await self._credential.get_token(*self._scopes) # type: ignore + self._update_headers(request.http_request.headers, token) # type: ignore + return await self.next.send(request) # type: ignore diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/base.py b/sdk/core/azure-core/azure/core/pipeline/policies/base.py index 8379aba001bc..bb017e9836b3 100644 --- a/sdk/core/azure-core/azure/core/pipeline/policies/base.py +++ b/sdk/core/azure-core/azure/core/pipeline/policies/base.py @@ -46,7 +46,7 @@ class HTTPPolicy(ABC, Generic[HTTPRequestType, HTTPResponseType]): # type: ignor :param next: Use to process the next policy in the pipeline. Set when pipeline is instantiated and all policies chained. - :type next: HTTPPolicy or HTTPTransport + :type next: ~azure.core.pipeline.policies.HTTPPolicy or ~azure.core.pipeline.transport.HTTPTransport """ def __init__(self): self.next = None @@ -108,7 +108,7 @@ def on_exception(self, _request, **kwargs): #pylint: disable=unused-argument :rtype: bool Example: - .. literalinclude:: ../../../../examples/examples_sansio.py + .. literalinclude:: ../examples/examples_sansio.py :start-after: [START on_exception] :end-before: [END on_exception] :language: python diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/base_async.py b/sdk/core/azure-core/azure/core/pipeline/policies/base_async.py index 85d2d3aac0a8..e77a76fd33d9 100644 --- a/sdk/core/azure-core/azure/core/pipeline/policies/base_async.py +++ b/sdk/core/azure-core/azure/core/pipeline/policies/base_async.py @@ -56,7 +56,7 @@ class AsyncHTTPPolicy(abc.ABC, Generic[HTTPRequestType, AsyncHTTPResponseType]): :param next: Use to process the next policy in the pipeline. Set when pipeline is instantiated and all policies chained. - :type next: AsyncHTTPPolicy or AsyncHttpTransport + :type next: ~azure.core.pipeline.policies.AsyncHTTPPolicy or ~azure.core.pipeline.transport.AsyncHttpTransport """ def __init__(self) -> None: # next will be set once in the pipeline diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/credentials.py b/sdk/core/azure-core/azure/core/pipeline/policies/credentials.py deleted file mode 100644 index 205872fb633d..000000000000 --- a/sdk/core/azure-core/azure/core/pipeline/policies/credentials.py +++ /dev/null @@ -1,65 +0,0 @@ -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See LICENSE.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -from . import HTTPPolicy - -try: - from typing import TYPE_CHECKING # pylint:disable=unused-import -except ImportError: - TYPE_CHECKING = False - -if TYPE_CHECKING: - # pylint:disable=unused-import - from typing import Any, Dict, Iterable, Mapping - from azure.core.credentials import SupportsGetToken - from azure.core.pipeline import PipelineRequest, PipelineResponse - - -# pylint:disable=too-few-public-methods -class _BearerTokenCredentialPolicyBase(object): - """Base class for a Bearer Token Credential Policy. - - :param credential: The credential. - :type credential: ~azure.core.SupportsGetToken - :param str scopes: Lets you specify the type of access needed. - """ - - def __init__(self, credential, scopes, **kwargs): # pylint:disable=unused-argument - # type: (SupportsGetToken, Iterable[str], Mapping[str, Any]) -> None - super(_BearerTokenCredentialPolicyBase, self).__init__() - self._scopes = scopes - self._credential = credential - - @staticmethod - def _update_headers(headers, token): - # type: (Dict[str, str], str) -> None - """Updates the Authorization header with the bearer token. - - :param dict headers: The HTTP Request headers - :param str token: The OAuth token. - """ - headers["Authorization"] = "Bearer {}".format(token) - - -class BearerTokenCredentialPolicy(_BearerTokenCredentialPolicyBase, HTTPPolicy): - """Adds a bearer token Authorization header to requests. - - :param credential: The credential. - :type credential: ~azure.core.SupportsGetToken - :param str scopes: Lets you specify the type of access needed. - """ - - def send(self, request): - # type: (PipelineRequest) -> PipelineResponse - """Adds a bearer token Authorization header to request and sends request to next policy. - - :param request: The pipeline request object - :type request: ~azure.core.pipeline.PipelineRequest - :return: The pipeline response object - :rtype: ~azure.core.pipeline.PipelineResponse - """ - token = self._credential.get_token(self._scopes) - self._update_headers(request.http_request.headers, token) # type: ignore - return self.next.send(request) diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/credentials_async.py b/sdk/core/azure-core/azure/core/pipeline/policies/credentials_async.py deleted file mode 100644 index 192f87db351b..000000000000 --- a/sdk/core/azure-core/azure/core/pipeline/policies/credentials_async.py +++ /dev/null @@ -1,30 +0,0 @@ -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See LICENSE.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -from azure.core.pipeline import PipelineRequest, PipelineResponse -from azure.core.pipeline.policies import AsyncHTTPPolicy -from azure.core.pipeline.policies.credentials import _BearerTokenCredentialPolicyBase - - -class AsyncBearerTokenCredentialPolicy(_BearerTokenCredentialPolicyBase, AsyncHTTPPolicy): - # pylint:disable=too-few-public-methods - """Adds a bearer token Authorization header to requests. - - :param credential: The credential. - :type credential: ~azure.core.SupportsGetToken - :param str scopes: Lets you specify the type of access needed. - """ - - async def send(self, request: PipelineRequest) -> PipelineResponse: - """Aync flavor that adds a bearer token Authorization header to request and sends request to next policy. - - :param request: The pipeline request object to be modified. - :type request: ~azure.core.pipeline.PipelineRequest - :return: The pipeline response object - :rtype: ~azure.core.pipeline.PipelineResponse - """ - token = await self._credential.get_token(self._scopes) # type: ignore - self._update_headers(request.http_request.headers, token) # type: ignore - return await self.next.send(request) # type: ignore diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/custom_hook.py b/sdk/core/azure-core/azure/core/pipeline/policies/custom_hook.py index 2874596fa520..6119d623cfbc 100644 --- a/sdk/core/azure-core/azure/core/pipeline/policies/custom_hook.py +++ b/sdk/core/azure-core/azure/core/pipeline/policies/custom_hook.py @@ -33,8 +33,9 @@ class CustomHookPolicy(SansIOHTTPPolicy): """A simple policy that enable the given callback with the response. - Keyword argument: - :param raw_response_hook: Callback function. Will be invoked on response. + **Keyword argument:** + + *raw_response_hook* - Callback function. Will be invoked on response. """ def __init__(self, **kwargs): # pylint: disable=unused-argument self._callback = None diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/redirect.py b/sdk/core/azure-core/azure/core/pipeline/policies/redirect.py index d0c5d1c2fa4a..126ae4adb340 100644 --- a/sdk/core/azure-core/azure/core/pipeline/policies/redirect.py +++ b/sdk/core/azure-core/azure/core/pipeline/policies/redirect.py @@ -47,12 +47,14 @@ class RedirectPolicy(HTTPPolicy): A redirect policy in the pipeline can be configured directly or per operation. - Keyword arguments: - :param redirects_allow: Whether the client allows redirects. Defaults to True. - :param redirect_max: The maximum allowed redirects. Defaults to 30. + **Keyword arguments:** + + *permit_redirects (bool)* - Whether the client allows redirects. Defaults to True. + + *redirect_max (int)* - The maximum allowed redirects. Defaults to 30. Example: - .. literalinclude:: ../../../../examples/examples_sync.py + .. literalinclude:: ../examples/examples_sync.py :start-after: [START redirect_policy] :end-before: [END redirect_policy] :language: python @@ -65,7 +67,7 @@ class RedirectPolicy(HTTPPolicy): REDIRECT_HEADERS_BLACKLIST = frozenset(['Authorization']) def __init__(self, **kwargs): - self.allow = kwargs.get('redirects_allow', True) + self.allow = kwargs.get('permit_redirects', True) self.max_redirects = kwargs.get('redirect_max', 30) remove_headers = set(kwargs.get('redirect_remove_headers', [])) @@ -78,7 +80,7 @@ def __init__(self, **kwargs): def no_redirects(cls): """Disable redirects. """ - return cls(redirects_allow=False) + return cls(permit_redirects=False) def configure_redirects(self, options): """Configures the redirect settings. @@ -88,7 +90,7 @@ def configure_redirects(self, options): :rtype: dict """ return { - 'allow': options.pop("redirects_allow", self.max_redirects), + 'allow': options.pop("permit_redirects", self.allow), 'redirects': options.pop("redirect_max", self.max_redirects), 'history': [] } @@ -139,11 +141,11 @@ def increment(self, settings, response, redirect_location): response.http_request.method = 'GET' for non_redirect_header in self._remove_headers_on_redirect: response.http_request.headers.pop(non_redirect_header, None) - return settings['redirects'] > 0 or not settings['allow'] + return settings['redirects'] > 0 def send(self, request): - """Sends the PipelineRequest object to the next policy. Uses redirect settings - to send request to redirect endpoint if necessary. + """Sends the PipelineRequest object to the next policy. + Uses redirect settings to send request to redirect endpoint if necessary. :param request: The PipelineRequest object :type request: ~azure.core.pipeline.PipelineRequest @@ -156,7 +158,7 @@ def send(self, request): while retryable: response = self.next.send(request) redirect_location = self.get_redirect_location(response) - if redirect_location: + if redirect_location and redirect_settings['allow']: retryable = self.increment(redirect_settings, response, redirect_location) request.http_request = response.http_request continue diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/redirect_async.py b/sdk/core/azure-core/azure/core/pipeline/policies/redirect_async.py index 6d2c742dbc0a..6bef60776ff7 100644 --- a/sdk/core/azure-core/azure/core/pipeline/policies/redirect_async.py +++ b/sdk/core/azure-core/azure/core/pipeline/policies/redirect_async.py @@ -35,12 +35,14 @@ class AsyncRedirectPolicy(RedirectPolicy, AsyncHTTPPolicy): # type: ignore An async redirect policy in the pipeline can be configured directly or per operation. - Keyword arguments: - :param redirects_allow: Whether the client allows redirects. Defaults to True. - :param redirect_max: The maximum allowed redirects. Defaults to 30. + **Keyword arguments:** + + *permit_redirects (bool)* - Whether the client allows redirects. Defaults to True. + + *redirect_max (int)* - The maximum allowed redirects. Defaults to 30. Example: - .. literalinclude:: ../../../../examples/examples_async.py + .. literalinclude:: ../examples/examples_async.py :start-after: [START async_redirect_policy] :end-before: [END async_redirect_policy] :language: python @@ -49,8 +51,8 @@ class AsyncRedirectPolicy(RedirectPolicy, AsyncHTTPPolicy): # type: ignore """ async def send(self, request): - """Sends the PipelineRequest object to the next policy. Uses redirect settings - to send the request to redirect endpoint if necessary. + """Sends the PipelineRequest object to the next policy. + Uses redirect settings to send the request to redirect endpoint if necessary. :param request: The PipelineRequest object :type request: ~azure.core.pipeline.PipelineRequest @@ -63,7 +65,7 @@ async def send(self, request): while redirects_remaining: response = await self.next.send(request) redirect_location = self.get_redirect_location(response) - if redirect_location: + if redirect_location and redirect_settings['allow']: redirects_remaining = self.increment(redirect_settings, response, redirect_location) request.http_request = response.http_request continue diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/retry.py b/sdk/core/azure-core/azure/core/pipeline/policies/retry.py index 51537782f6a1..fbed38de7fe4 100644 --- a/sdk/core/azure-core/azure/core/pipeline/policies/retry.py +++ b/sdk/core/azure-core/azure/core/pipeline/policies/retry.py @@ -32,7 +32,7 @@ import time import email from typing import TYPE_CHECKING, List, Callable, Iterator, Any, Union, Dict, Optional # pylint: disable=unused-import - +from azure.core.pipeline import PipelineResponse from azure.core.exceptions import ( AzureError, ServiceResponseError, @@ -50,25 +50,31 @@ class RetryPolicy(HTTPPolicy): The retry policy in the pipeline can be configured directly, or tweaked on a per-call basis. - Keyword arguments: - :param int retry_total: Total number of retries to allow. Takes precedence over other counts. - Default value is 10. - :param int retry_connect: How many connection-related errors to retry on. - These are errors raised before the request is sent to the remote server, - which we assume has not triggered the server to process the request. Default value is 3. - :param int retry_read: How many times to retry on read errors. - These errors are raised after the request was sent to the server, so the - request may have side-effects. Default value is 3. - :param int retry_status: How many times to retry on bad status codes. Default value is 3. - :param int retry_backoff_factor: A backoff factor to apply between attempts after the second try - (most errors are resolved immediately by a second try without a delay). - Retry policy will sleep for: `{backoff factor} * (2 ** ({number of total retries} - 1))` - seconds. If the backoff_factor is 0.1, then the retry will sleep - for [0.0s, 0.2s, 0.4s, ...] between retries. The default value is 0.8. - :param int retry_backoff_max: The maximum back off time. Default value is 120 seconds (2 minutes). + **Keyword arguments:** + + *retry_total (int)* - Total number of retries to allow. Takes precedence over other counts. + Default value is 10. + + *retry_connect (int)* - How many connection-related errors to retry on. + These are errors raised before the request is sent to the remote server, + which we assume has not triggered the server to process the request. Default value is 3. + + *retry_read (int)* - How many times to retry on read errors. + These errors are raised after the request was sent to the server, so the + request may have side-effects. Default value is 3. + + *retry_status (int)* - How many times to retry on bad status codes. Default value is 3. + + *retry_backoff_factor (float)* - A backoff factor to apply between attempts after the second try + (most errors are resolved immediately by a second try without a delay). + Retry policy will sleep for: `{backoff factor} * (2 ** ({number of total retries} - 1))` + seconds. If the backoff_factor is 0.1, then the retry will sleep + for [0.0s, 0.2s, 0.4s, ...] between retries. The default value is 0.8. + + *retry_backoff_max (int)* - The maximum back off time. Default value is 120 seconds (2 minutes). Example: - .. literalinclude:: ../../../../examples/examples_sync.py + .. literalinclude:: ../examples/examples_sync.py :start-after: [START retry_policy] :end-before: [END retry_policy] :language: python @@ -99,7 +105,7 @@ def __init__(self, **kwargs): def no_retries(cls): """Disable retries. """ - return cls(retry_count_total=0) + return cls(retry_total=0) def configure_retries(self, options): """Configures the retry settings. @@ -252,7 +258,7 @@ def is_retry(self, settings, response): :param dict settings: The retry settings. :param response: The PipelineResponse object - :type response: ~azure.core.pipeline.PipelineResponse. + :type response: ~azure.core.pipeline.PipelineResponse :return: True if method/status code is retryable. False if not retryable. :rtype: bool """ @@ -291,6 +297,9 @@ def increment(self, settings, response=None, error=None): """ settings['total'] -= 1 + if isinstance(response, PipelineResponse) and response.http_response.status_code == 202: + return False + if error and self._is_connection_error(error): # Connect retry? settings['connect'] -= 1 @@ -322,8 +331,7 @@ def update_context(self, context, retry_settings): context['history'] = retry_settings['history'] def send(self, request): - """Sends the PipelineRequest object to the next policy. - Uses retry settings if necessary. + """Sends the PipelineRequest object to the next policy. Uses retry settings if necessary. :param request: The PipelineRequest object :type request: ~azure.core.pipeline.PipelineRequest diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/retry_async.py b/sdk/core/azure-core/azure/core/pipeline/policies/retry_async.py index 2d95cb542a98..449ec67f1adf 100644 --- a/sdk/core/azure-core/azure/core/pipeline/policies/retry_async.py +++ b/sdk/core/azure-core/azure/core/pipeline/policies/retry_async.py @@ -44,25 +44,31 @@ class AsyncRetryPolicy(RetryPolicy, AsyncHTTPPolicy): # type: ignore The async retry policy in the pipeline can be configured directly, or tweaked on a per-call basis. - Keyword arguments: - :param int retry_total: Total number of retries to allow. Takes precedence over other counts. - Default value is 10. - :param int retry_connect: How many connection-related errors to retry on. - These are errors raised before the request is sent to the remote server, - which we assume has not triggered the server to process the request. Default value is 3. - :param int retry_read: How many times to retry on read errors. - These errors are raised after the request was sent to the server, so the - request may have side-effects. Default value is 3. - :param int retry_status: How many times to retry on bad status codes. Default value is 3. - :param int retry_backoff_factor: A backoff factor to apply between attempts after the second try - (most errors are resolved immediately by a second try without a delay). - Retry policy will sleep for: `{backoff factor} * (2 ** ({number of total retries} - 1))` - seconds. If the backoff_factor is 0.1, then the retry will sleep - for [0.0s, 0.2s, 0.4s, ...] between retries. The default value is 0.8. - :param int retry_backoff_max: The maximum back off time. Default value is 120 seconds (2 minutes). + **Keyword arguments:** + + *retry_total (int)* - Total number of retries to allow. Takes precedence over other counts. + Default value is 10. + + *retry_connect (int)* - How many connection-related errors to retry on. + These are errors raised before the request is sent to the remote server, + which we assume has not triggered the server to process the request. Default value is 3. + + *retry_read (int)* - How many times to retry on read errors. + These errors are raised after the request was sent to the server, so the + request may have side-effects. Default value is 3. + + *retry_status (int)* - How many times to retry on bad status codes. Default value is 3. + + *retry_backoff_factor (float)* - A backoff factor to apply between attempts after the second try + (most errors are resolved immediately by a second try without a delay). + Retry policy will sleep for: `{backoff factor} * (2 ** ({number of total retries} - 1))` + seconds. If the backoff_factor is 0.1, then the retry will sleep + for [0.0s, 0.2s, 0.4s, ...] between retries. The default value is 0.8. + + *retry_backoff_max (int)* - The maximum back off time. Default value is 120 seconds (2 minutes). Example: - .. literalinclude:: ../../../../examples/examples_async.py + .. literalinclude:: ../examples/examples_async.py :start-after: [START async_retry_policy] :end-before: [END async_retry_policy] :language: python @@ -114,14 +120,13 @@ async def sleep(self, settings, transport, response=None): await self._sleep_backoff(settings, transport) async def send(self, request): - """Uses the configured retry policy to send the request - to the next policy in the pipeline. + """Uses the configured retry policy to send the request to the next policy in the pipeline. :param request: The PipelineRequest object :type request: ~azure.core.pipeline.PipelineRequest :return: Returns the PipelineResponse or raises error if maximum retries exceeded. :rtype: ~azure.core.pipeline.PipelineResponse - :raises: ~azure.core.exceptions.AzureError if maximum retries exceeded. + :raise: ~azure.core.exceptions.AzureError if maximum retries exceeded. """ retry_active = True response = None diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/universal.py b/sdk/core/azure-core/azure/core/pipeline/policies/universal.py index ccf4520cab0c..bfead15a5526 100644 --- a/sdk/core/azure-core/azure/core/pipeline/policies/universal.py +++ b/sdk/core/azure-core/azure/core/pipeline/policies/universal.py @@ -61,7 +61,7 @@ class HeadersPolicy(SansIOHTTPPolicy): :param dict base_headers: Headers to send with the request. Example: - .. literalinclude:: ../../../../examples/examples_sansio.py + .. literalinclude:: ../examples/examples_sansio.py :start-after: [START headers_policy] :end-before: [END headers_policy] :language: python @@ -103,11 +103,15 @@ class UserAgentPolicy(SansIOHTTPPolicy): """User-Agent Policy. Allows custom values to be added to the User-Agent header. :param str base_user_agent: Sets the base user agent value. - :param bool user_agent_overwrite: Keyword argument that overwrites User-Agent when True. Defaults to False. - :param bool user_agent_use_env: Keyword argument that gets user-agent from environment. Defaults to True. + + **Keyword arguments:** + + *user_agent_overwrite (bool)* - Overwrites User-Agent when True. Defaults to False. + + *user_agent_use_env (bool)* - Gets user-agent from environment. Defaults to True. Example: - .. literalinclude:: ../../../../examples/examples_sansio.py + .. literalinclude:: ../examples/examples_sansio.py :start-after: [START user_agent_policy] :end-before: [END user_agent_policy] :language: python @@ -175,12 +179,9 @@ class NetworkTraceLoggingPolicy(SansIOHTTPPolicy): This accepts both global configuration, and per-request level with "enable_http_logger" :param bool logging_enable: Use to enable per operation. Defaults to False. - Keyword argument. - :param bool enable_http_logger: Enables network trace logging at DEBUG level. - Defaults to False. Example: - .. literalinclude:: ../../../../examples/examples_sansio.py + .. literalinclude:: ../examples/examples_sansio.py :start-after: [START network_trace_logging_policy] :end-before: [END network_trace_logging_policy] :language: python @@ -278,6 +279,7 @@ def deserialize_from_text(cls, response, content_type=None): """Decode response data according to content-type. Accept a stream of data as well, but will be load at once in memory for now. If no content-type, will return the string version (not bytes, not stream) + :param response: The HTTP response. :type response: ~azure.core.pipeline.transport.HttpResponse :param str content_type: The content type. @@ -385,11 +387,13 @@ class ProxyPolicy(SansIOHTTPPolicy): :param dict proxies: Maps protocol or protocol and hostname to the URL of the proxy. - :param bool proxies_use_env_settings: Keyword argument that uses proxy settings - from environment. Defaults to True. + + **Keyword argument:** + + *proxies_use_env_settings (bool)* - Uses proxy settings from environment. Defaults to True. Example: - .. literalinclude:: ../../../../examples/examples_sansio.py + .. literalinclude:: ../examples/examples_sansio.py :start-after: [START proxy_policy] :end-before: [END proxy_policy] :language: python diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/aiohttp.py b/sdk/core/azure-core/azure/core/pipeline/transport/aiohttp.py index 4ec352d6de20..08d6e4526f1c 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/aiohttp.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/aiohttp.py @@ -27,12 +27,16 @@ from collections.abc import AsyncIterator import logging +import asyncio import aiohttp from azure.core.configuration import Configuration -from azure.core.exceptions import ( - ServiceRequestError, - ServiceResponseError) +from azure.core.exceptions import ServiceRequestError +from azure.core.pipeline import Pipeline + +from requests.exceptions import ( + ChunkedEncodingError, + StreamConsumedError) from .base import HttpRequest from .base_async import ( @@ -117,7 +121,7 @@ async def send(self, request: HttpRequest, **config: Any) -> Optional[AsyncHttpR """Send the request using this HTTP sender. Will pre-load the body into memory to be available with a sync method. - pass stream=True to avoid this behavior. + Pass stream=True to avoid this behavior. :param request: The HttpRequest object :type request: ~azure.core.pipeline.transport.HttpRequest @@ -125,8 +129,9 @@ async def send(self, request: HttpRequest, **config: Any) -> Optional[AsyncHttpR :return: The AsyncHttpResponse :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse - Keyword arguments: - stream - Defaults to False. + **Keyword argument:** + + *stream (bool)* - Defaults to False. """ await self.open() error = None @@ -157,15 +162,21 @@ async def send(self, request: HttpRequest, **config: Any) -> Optional[AsyncHttpR class AioHttpStreamDownloadGenerator(AsyncIterator): """Streams the response body data. + :param pipeline: The pipeline object + :param request: The request object :param response: The client response object. :type response: aiohttp.ClientResponse :param block_size: block size of data sent over connection. :type block_size: int """ - def __init__(self, response: aiohttp.ClientResponse, block_size: int) -> None: + def __init__(self, pipeline: Pipeline, request: HttpRequest, + response: aiohttp.ClientResponse, block_size: int) -> None: + self.pipeline = pipeline + self.request = request self.response = response self.block_size = block_size self.content_length = int(response.headers.get('Content-Length', 0)) + self.downloaded = 0 def __len__(self): return self.content_length @@ -173,20 +184,35 @@ def __len__(self): async def __anext__(self): retry_active = True retry_total = 3 + retry_interval = 1000 while retry_active: try: chunk = await self.response.content.read(self.block_size) if not chunk: raise _ResponseStopIteration() + self.downloaded += self.block_size return chunk except _ResponseStopIteration: self.response.close() raise StopAsyncIteration() - except ServiceResponseError: + except (ChunkedEncodingError, ConnectionError): retry_total -= 1 if retry_total <= 0: retry_active = False + else: + await asyncio.sleep(retry_interval) + headers = {'range': 'bytes=' + self.downloaded + '-'} + resp = self.pipeline.run(self.request, stream=True, headers=headers) + if resp.status_code == 416: + raise + chunk = await self.response.content.read(self.block_size) + if not chunk: + raise StopIteration() + self.downloaded += chunk + return chunk continue + except StreamConsumedError: + raise except Exception as err: _LOGGER.warning("Unable to stream download: %s", err) self.response.close() @@ -222,7 +248,10 @@ async def load_body(self) -> None: """Load in memory the body, so it could be accessible from sync methods.""" self._body = await self.internal_response.read() - def stream_download(self) -> AsyncIteratorType[bytes]: + def stream_download(self, pipeline) -> AsyncIteratorType[bytes]: """Generator for streaming response body data. + + :param pipeline: The pipeline object + :type pipeline: azure.core.pipeline """ - return AioHttpStreamDownloadGenerator(self.internal_response, self.block_size) + return AioHttpStreamDownloadGenerator(pipeline, self.request, self.internal_response, self.block_size) diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/base.py b/sdk/core/azure-core/azure/core/pipeline/transport/base.py index 1ac9e5be9e97..0fb2b49ceb5f 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/base.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/base.py @@ -48,6 +48,7 @@ HTTPResponseType = TypeVar("HTTPResponseType") HTTPRequestType = TypeVar("HTTPRequestType") +PipelineType = TypeVar("PipelineType") _LOGGER = logging.getLogger(__name__) @@ -179,7 +180,7 @@ def set_xml_body(self, data): def set_json_body(self, data): """Set a JSON-friendly object as the body of the request. - + :param data: The request field data. """ if data is None: @@ -207,7 +208,7 @@ def set_formdata_body(self, data=None): def set_bytes_body(self, data): """Set generic bytes as the body of the request. - + :param data: The request field data. """ if data: @@ -259,8 +260,8 @@ def text(self, encoding=None): class HttpResponse(_HttpResponseBase): - def stream_download(self): - # type: () -> Iterator[bytes] + def stream_download(self, pipeline): + # type: (PipelineType) -> Iterator[bytes] """Generator for streaming request body data. Should be implemented by sub-classes if streaming download @@ -288,6 +289,7 @@ def _request( ): # type: (...) -> HttpRequest """Create HttpRequest object. + :param str method: HTTP method (GET, HEAD, etc.) :param str url: URL for the request. :param dict params: URL query parameters. @@ -336,6 +338,7 @@ def format_url(self, url_template, **kwargs): # type: (str, Any) -> str """Format request URL with the client base URL, unless the supplied URL is already absolute. + :param str url_template: The request URL to be formatted if necessary. """ url = self._format_url_section(url_template, **kwargs) @@ -358,6 +361,7 @@ def get( ): # type: (...) -> HttpRequest """Create a GET request object. + :param str url: The request URL. :param dict params: Request URL parameters. :param dict headers: Headers @@ -379,6 +383,7 @@ def put( ): # type: (...) -> HttpRequest """Create a PUT request object. + :param str url: The request URL. :param dict params: Request URL parameters. :param dict headers: Headers @@ -399,6 +404,7 @@ def post( ): # type: (...) -> HttpRequest """Create a POST request object. + :param str url: The request URL. :param dict params: Request URL parameters. :param dict headers: Headers @@ -419,6 +425,7 @@ def head( ): # type: (...) -> HttpRequest """Create a HEAD request object. + :param str url: The request URL. :param dict params: Request URL parameters. :param dict headers: Headers @@ -439,6 +446,7 @@ def patch( ): # type: (...) -> HttpRequest """Create a PATCH request object. + :param str url: The request URL. :param dict params: Request URL parameters. :param dict headers: Headers @@ -452,6 +460,7 @@ def patch( def delete(self, url, params=None, headers=None, content=None, form_content=None): # type: (str, Optional[Dict[str, str]], Optional[Dict[str, str]], Any, Optional[Dict[str, Any]]) -> HttpRequest """Create a DELETE request object. + :param str url: The request URL. :param dict params: Request URL parameters. :param dict headers: Headers @@ -465,6 +474,7 @@ def delete(self, url, params=None, headers=None, content=None, form_content=None def merge(self, url, params=None, headers=None, content=None, form_content=None): # type: (str, Optional[Dict[str, str]], Optional[Dict[str, str]], Any, Optional[Dict[str, Any]]) -> HttpRequest """Create a MERGE request object. + :param str url: The request URL. :param dict params: Request URL parameters. :param dict headers: Headers diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/base_async.py b/sdk/core/azure-core/azure/core/pipeline/transport/base_async.py index c9133177fd2f..8a3ed3a522f6 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/base_async.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/base_async.py @@ -70,11 +70,14 @@ class AsyncHttpResponse(_HttpResponseBase): Allows for the asynchronous streaming of data from the response. """ - def stream_download(self) -> AsyncIterator[bytes]: + def stream_download(self, pipeline) -> AsyncIterator[bytes]: """Generator for streaming response body data. Should be implemented by sub-classes if streaming download is supported. Will return an asynchronous generator. + + :param pipeline: The pipeline object + :type pipeline: azure.core.pipeline """ diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/requests_asyncio.py b/sdk/core/azure-core/azure/core/pipeline/transport/requests_asyncio.py index 996b3c98e3d2..287851cac4e8 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/requests_asyncio.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/requests_asyncio.py @@ -36,6 +36,7 @@ ServiceRequestError, ServiceResponseError ) +from azure.core.pipeline import Pipeline from .base import HttpRequest from .base_async import ( AsyncHttpTransport, @@ -121,16 +122,21 @@ async def send(self, request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: class AsyncioStreamDownloadGenerator(AsyncIterator): """Streams the response body data. + :param pipeline: The pipeline object + :param request: The request object :param response: The response object. :param int block_size: block size of data sent over connection. :param generator iter_content_func: Iterator for response data. :param int content_length: size of body in bytes. """ - def __init__(self, response: requests.Response, block_size: int) -> None: + def __init__(self, pipeline: Pipeline, request: HttpRequest, response: requests.Response, block_size: int) -> None: + self.pipeline = pipeline + self.request = request self.response = response self.block_size = block_size self.iter_content_func = self.response.iter_content(self.block_size) self.content_length = int(response.headers.get('Content-Length', 0)) + self.downloaded = 0 def __len__(self): return self.content_length @@ -139,6 +145,7 @@ async def __anext__(self): loop = _get_running_loop() retry_active = True retry_total = 3 + retry_interval = 1000 while retry_active: try: chunk = await loop.run_in_executor( @@ -148,15 +155,34 @@ async def __anext__(self): ) if not chunk: raise _ResponseStopIteration() + self.downloaded += self.block_size return chunk except _ResponseStopIteration: self.response.close() raise StopAsyncIteration() - except ServiceResponseError: + except (requests.exceptions.ChunkedEncodingError, + requests.exceptions.ConnectionError): retry_total -= 1 if retry_total <= 0: retry_active = False + else: + await asyncio.sleep(retry_interval) + headers = {'range': 'bytes=' + self.downloaded + '-'} + resp = self.pipeline.run(self.request, stream=True, headers=headers) + if resp.status_code == 416: + raise + chunk = await loop.run_in_executor( + None, + _iterate_response_content, + self.iter_content_func, + ) + if not chunk: + raise StopIteration() + self.downloaded += chunk + return chunk continue + except requests.exceptions.StreamConsumedError: + raise except Exception as err: _LOGGER.warning("Unable to stream download: %s", err) self.response.close() @@ -166,6 +192,7 @@ async def __anext__(self): class AsyncioRequestsTransportResponse(AsyncHttpResponse, RequestsTransportResponse): # type: ignore """Asynchronous streaming of data from the response. """ - def stream_download(self) -> AsyncIteratorType[bytes]: # type: ignore + def stream_download(self, pipeline) -> AsyncIteratorType[bytes]: # type: ignore """Generator for streaming request body data.""" - return AsyncioStreamDownloadGenerator(self.internal_response, self.block_size) # type: ignore + return AsyncioStreamDownloadGenerator(pipeline, self.request, + self.internal_response, self.block_size) # type: ignore diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/requests_basic.py b/sdk/core/azure-core/azure/core/pipeline/transport/requests_basic.py index 031b463583f7..8b820dee21bb 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/requests_basic.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/requests_basic.py @@ -25,17 +25,18 @@ # -------------------------------------------------------------------------- from __future__ import absolute_import import logging -from typing import Iterator, Optional, Any, Union +from typing import Iterator, Optional, Any, Union, TypeVar +import time import urllib3 # type: ignore from urllib3.util.retry import Retry # type: ignore import requests - from azure.core.configuration import Configuration from azure.core.exceptions import ( ServiceRequestError, ServiceResponseError ) +from azure.core.pipeline import Pipeline from . import HttpRequest # pylint: disable=unused-import from .base import ( @@ -44,6 +45,7 @@ _HttpResponseBase ) +PipelineType = TypeVar("PipelineType") _LOGGER = logging.getLogger(__name__) @@ -80,16 +82,21 @@ def text(self, encoding=None): class StreamDownloadGenerator(object): """Generator for streaming response data. + :param pipeline: The pipeline object + :param request: The request object :param response: The response object. :param int block_size: Number of bytes to read into memory. :param generator iter_content_func: Iterator for response data. :param int content_length: size of body in bytes. """ - def __init__(self, response, block_size): + def __init__(self, pipeline, request, response, block_size): + self.pipeline = pipeline + self.request = request self.response = response self.block_size = block_size self.iter_content_func = self.response.iter_content(self.block_size) self.content_length = int(response.headers.get('Content-Length', 0)) + self.downloaded = 0 def __len__(self): return self.content_length @@ -100,20 +107,36 @@ def __iter__(self): def __next__(self): retry_active = True retry_total = 3 + retry_interval = 1000 while retry_active: try: chunk = next(self.iter_content_func) if not chunk: raise StopIteration() + self.downloaded += self.block_size return chunk except StopIteration: self.response.close() raise StopIteration() - except ServiceResponseError: + except (requests.exceptions.ChunkedEncodingError, + requests.exceptions.ConnectionError): retry_total -= 1 if retry_total <= 0: retry_active = False + else: + time.sleep(retry_interval) + headers = {'range': 'bytes=' + self.downloaded + '-'} + resp = self.pipeline.run(self.request, stream=True, headers=headers) + if resp.status_code == 416: + raise + chunk = next(self.iter_content_func) + if not chunk: + raise StopIteration() + self.downloaded += chunk + return chunk continue + except requests.exceptions.StreamConsumedError: + raise except Exception as err: _LOGGER.warning("Unable to stream download: %s", err) self.response.close() @@ -124,10 +147,10 @@ def __next__(self): class RequestsTransportResponse(HttpResponse, _RequestsTransportResponseBase): """Streaming of data from the response. """ - def stream_download(self): - # type: () -> Iterator[bytes] + def stream_download(self, pipeline): + # type: (PipelineType) -> Iterator[bytes] """Generator for streaming request body data.""" - return StreamDownloadGenerator(self.internal_response, self.block_size) + return StreamDownloadGenerator(pipeline, self.request, self.internal_response, self.block_size) class RequestsTransport(HttpTransport): @@ -192,14 +215,15 @@ def send(self, request, **kwargs): # type: ignore # type: (HttpRequest, Any) -> HttpResponse """Send request object according to configuration. - Allowed kwargs are: - - session : will override the driver session and use yours. Should NOT be done unless really required. - - anything else is sent straight to requests. - :param request: The request object to be sent. :type request: ~azure.core.pipeline.transport.HttpRequest :return: An HTTPResponse object. :rtype: ~azure.core.pipeline.transport.HttpResponse + + **Keyword arguments:** + + *session* - will override the driver session and use yours. Should NOT be done unless really required. + Anything else is sent straight to requests. """ self.open() response = None diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/requests_trio.py b/sdk/core/azure-core/azure/core/pipeline/transport/requests_trio.py index 91f28eff7e48..b72887502220 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/requests_trio.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/requests_trio.py @@ -36,6 +36,7 @@ ServiceRequestError, ServiceResponseError ) +from azure.core.pipeline import Pipeline from .base import HttpRequest from .base_async import ( AsyncHttpTransport, @@ -51,16 +52,21 @@ class TrioStreamDownloadGenerator(AsyncIterator): """Generator for streaming response data. + :param pipeline: The pipeline object + :param request: The request object :param response: The response object. :param int block_size: Number of bytes to read into memory. :param generator iter_content_func: Iterator for response data. :param int content_length: size of body in bytes. """ - def __init__(self, response: requests.Response, block_size: int) -> None: + def __init__(self, pipeline: Pipeline, request: HttpRequest, response: requests.Response, block_size: int) -> None: + self.pipeline = pipeline + self.request = request self.response = response self.block_size = block_size self.iter_content_func = self.response.iter_content(self.block_size) self.content_length = int(response.headers.get('Content-Length', 0)) + self.downloaded = 0 def __len__(self): return self.content_length @@ -76,15 +82,33 @@ async def __anext__(self): ) if not chunk: raise _ResponseStopIteration() + self.downloaded += self.block_size return chunk except _ResponseStopIteration: self.response.close() raise StopAsyncIteration() - except ServiceResponseError: + except (requests.exceptions.ChunkedEncodingError, + requests.exceptions.ConnectionError): retry_total -= 1 if retry_total <= 0: retry_active = False + else: + await trio.sleep(1000) + headers = {'range': 'bytes=' + self.downloaded + '-'} + resp = self.pipeline.run(self.request, stream=True, headers=headers) + if resp.status_code == 416: + raise + chunk = await trio.run_sync_in_worker_thread( + _iterate_response_content, + self.iter_content_func, + ) + if not chunk: + raise StopIteration() + self.downloaded += chunk + return chunk continue + except requests.exceptions.StreamConsumedError: + raise except Exception as err: _LOGGER.warning("Unable to stream download: %s", err) self.response.close() @@ -93,10 +117,11 @@ async def __anext__(self): class TrioRequestsTransportResponse(AsyncHttpResponse, RequestsTransportResponse): # type: ignore """Asynchronous streaming of data from the response. """ - def stream_download(self) -> AsyncIteratorType[bytes]: # type: ignore + def stream_download(self, pipeline) -> AsyncIteratorType[bytes]: # type: ignore """Generator for streaming response data. """ - return TrioStreamDownloadGenerator(self.internal_response, self.block_size) # type: ignore + return TrioStreamDownloadGenerator(pipeline, self.request, + self.internal_response, self.block_size) # type: ignore class TrioRequestsTransport(RequestsTransport, AsyncHttpTransport): # type: ignore diff --git a/sdk/core/azure-core/azure/core/pipeline_client.py b/sdk/core/azure-core/azure/core/pipeline_client.py index 4ac78f6b1f3f..a076e8671acc 100644 --- a/sdk/core/azure-core/azure/core/pipeline_client.py +++ b/sdk/core/azure-core/azure/core/pipeline_client.py @@ -48,14 +48,14 @@ class PipelineClient(PipelineClientBase): :return: A pipeline object. :rtype: ~azure.core.pipeline.Pipeline - Keyword arguments: - pipeline - A Pipeline object. If omitted, a Pipeline object is created - and returned. - transport - The HTTP Transport type. If omitted, RequestsTransport is used - for synchronous transport. + **Keyword arguments:** + + *pipeline* - A Pipeline object. If omitted, a Pipeline object is created and returned. + + *transport* - The HTTP Transport type. If omitted, RequestsTransport is used for synchronous transport. Example: - .. literalinclude:: ../../examples/examples_sync.py + .. literalinclude:: ../examples/examples_sync.py :start-after: [START build_pipeline_client] :end-before: [END build_pipeline_client] :language: python @@ -102,4 +102,3 @@ def _build_pipeline(self, config, transport): # pylint: disable=no-self-use transport, policies ) - diff --git a/sdk/core/azure-core/azure/core/pipeline_client_async.py b/sdk/core/azure-core/azure/core/pipeline_client_async.py index f24145ec5861..82ec943a10f4 100644 --- a/sdk/core/azure-core/azure/core/pipeline_client_async.py +++ b/sdk/core/azure-core/azure/core/pipeline_client_async.py @@ -48,14 +48,14 @@ class AsyncPipelineClient(PipelineClientBase): :return: An async pipeline object. :rtype: ~azure.core.pipeline.AsyncPipeline - Keyword arguments: - pipeline - A Pipeline object. If omitted, an AsyncPipeline is created - and returned. - transport - The HTTP Transport type. If omitted, AioHttpTransport is used - for asynchronous transport. + **Keyword arguments:** + + *pipeline* - A Pipeline object. If omitted, an AsyncPipeline is created and returned. + + *transport* - The HTTP Transport type. If omitted, AioHttpTransport is use for asynchronous transport. Example: - .. literalinclude:: ../../examples/examples_async.py + .. literalinclude:: ../examples/examples_async.py :start-after: [START build_async_pipeline_client] :end-before: [END build_async_pipeline_client] :language: python diff --git a/sdk/core/azure-core/azure/core/polling/async_poller.py b/sdk/core/azure-core/azure/core/polling/async_poller.py index de749f1abf86..17e89acb4fb3 100644 --- a/sdk/core/azure-core/azure/core/polling/async_poller.py +++ b/sdk/core/azure-core/azure/core/polling/async_poller.py @@ -55,15 +55,16 @@ async def run(self): async def async_poller(client, initial_response, deserialization_callback, polling_method): """Async Poller for long running operations. + :param client: A pipeline service client. - :type client: azure.core.pipeline.PipelineClient + :type client: ~azure.core.pipeline.PipelineClient :param initial_response: The initial call response - :type initial_response: azure.core.pipeline.HttpResponse + :type initial_response: ~azure.core.pipeline.HttpResponse :param deserialization_callback: A callback that takes a Response and return a deserialized object. If a subclass of Model is given, this passes "deserialize" as callback. :type deserialization_callback: callable or msrest.serialization.Model :param polling_method: The polling strategy to adopt - :type polling_method: msrest.polling.PollingMethod + :type polling_method: ~msrest.polling.PollingMethod """ # This implicit test avoids bringing in an explicit dependency on Model directly diff --git a/sdk/core/azure-core/azure/core/polling/poller.py b/sdk/core/azure-core/azure/core/polling/poller.py index 91dc9747c430..7c92d09f3fa5 100644 --- a/sdk/core/azure-core/azure/core/polling/poller.py +++ b/sdk/core/azure-core/azure/core/polling/poller.py @@ -82,6 +82,7 @@ def run(self): def status(self): # type: () -> str """Return the current status as a string. + :rtype: str """ return "succeeded" @@ -89,6 +90,7 @@ def status(self): def finished(self): # type: () -> bool """Is this polling finished? + :rtype: bool """ return True @@ -100,15 +102,16 @@ def resource(self): class LROPoller(object): """Poller for long running operations. + :param client: A pipeline service client - :type client: azure.core.pipeline.PipelineClient + :type client: ~azure.core.pipeline.PipelineClient :param initial_response: The initial call response - :type initial_response: azure.core.pipeline.HttpResponse + :type initial_response: ~azure.core.pipeline.HttpResponse :param deserialization_callback: A callback that takes a Response and return a deserialized object. If a subclass of Model is given, this passes "deserialize" as callback. :type deserialization_callback: callable or msrest.serialization.Model :param polling_method: The polling strategy to adopt - :type polling_method: msrest.polling.PollingMethod + :type polling_method: ~msrest.polling.PollingMethod """ def __init__(self, client, initial_response, deserialization_callback, polling_method): @@ -142,7 +145,8 @@ def __init__(self, client, initial_response, deserialization_callback, polling_m def _start(self): """Start the long running operation. On completion, runs any callbacks. - :param callable update_cmd: The API reuqest to check the status of + + :param callable update_cmd: The API request to check the status of the operation. """ try: @@ -162,6 +166,7 @@ def _start(self): def status(self): # type: () -> str """Returns the current status string. + :returns: The current status string :rtype: str """ @@ -171,6 +176,7 @@ def result(self, timeout=None): # type: (Optional[int]) -> Model """Return the result of the long running operation, or the result available after the specified timeout. + :returns: The deserialized resource of the long running operation, if one is available. :raises CloudError: Server problem with the query. @@ -183,6 +189,7 @@ def wait(self, timeout=None): """Wait on the long running operation for a specified length of time. You can check if this call as ended with timeout with the "done()" method. + :param int timeout: Period of time to wait for the long running operation to complete (in seconds). :raises CloudError: Server problem with the query. @@ -199,6 +206,7 @@ def wait(self, timeout=None): def done(self): # type: () -> bool """Check status of the long running operation. + :returns: 'True' if the process has completed, else 'False'. """ return self._thread is None or not self._thread.is_alive() @@ -207,6 +215,7 @@ def add_done_callback(self, func): # type: (Callable) -> None """Add callback function to be run once the long running operation has completed - regardless of the status of the operation. + :param callable func: Callback function that takes at least one argument, a completed LongRunningOperation. """ @@ -219,6 +228,7 @@ def add_done_callback(self, func): def remove_done_callback(self, func): # type: (Callable) -> None """Remove a callback from the long running operation. + :param callable func: The function to be removed from the callbacks. :raises: ValueError if the long running operation has already completed. diff --git a/sdk/core/azure-core/azure/core/version.py b/sdk/core/azure-core/azure/core/version.py index 9ed7b1240a1c..cc101f5bf6f3 100644 --- a/sdk/core/azure-core/azure/core/version.py +++ b/sdk/core/azure-core/azure/core/version.py @@ -9,4 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "0.0.1" diff --git a/sdk/core/azure-core/docs/exceptions.md b/sdk/core/azure-core/docs/exceptions.md new file mode 100644 index 000000000000..0d38daf9854e --- /dev/null +++ b/sdk/core/azure-core/docs/exceptions.md @@ -0,0 +1,93 @@ +# Azure Core Library Exceptions + +## AzureError +AzureError is the base exception for all errors. +```python +class AzureError(Exception): + def __init__(self, message, *args, **kwargs): + self.inner_exception = kwargs.get('error') + self.exc_type, self.exc_value, self.exc_traceback = sys.exc_info() + self.exc_type = self.exc_type.__name__ if self.exc_type else type(self.inner_exception) + self.exc_msg = "{}, {}: {}".format(message, self.exc_type, self.exc_value) # type: ignore + self.message = str(message) + super(AzureError, self).__init__(self.message, *args) +``` + +*message* is any message (str) to be associated with the exception. + +*args* are any additional args to be included with exception. + +*kwargs* are keyword arguments to include with the exception. Use the keyword *error* to pass in an internal exception. + + +**The following exceptions inherit from AzureError:** + +## ServiceRequestError +An error occurred while attempt to make a request to the service. No request was sent. + +## ServiceResponseError +The request was sent, but the client failed to understand the response. +The connection may have timed out. These errors can be retried for idempotent or safe operations. + + +## HttpResponseError +Error occurs when a request was made, and a non-success status code was received from the service. +```python +class HttpResponseError(AzureError): + def __init__(self, message=None, response=None, **kwargs): + self.reason = None + self.response = response + if response: + self.reason = response.reason + message = "Operation returned an invalid status code '{}'".format(self.reason) + try: + try: + if self.error.error.code or self.error.error.message: + message = "({}) {}".format( + self.error.error.code, + self.error.error.message) + except AttributeError: + if self.error.message: #pylint: disable=no-member + message = self.error.message #pylint: disable=no-member + except AttributeError: + pass + super(HttpResponseError, self).__init__(message=message, **kwargs) +``` + +*response* is the HTTP response (optional). + +*kwargs* are keyword arguments to include with the exception. + + +**The following exceptions inherit from HttpResponseError:** + +## DecodeError +An error raised during response deserialization. + +## ResourceExistsError +An error response with status code 4xx. This will not be raised directly by the Azure core pipeline. + +## ResourceNotFoundError +An error response, typically triggered by a 412 response (for update) or 404 (for get/post). + +## ClientAuthenticationError +An error response with status code 4xx. This will not be raised directly by the Azure core pipeline. + +## ResourceModifiedError +An error response with status code 4xx, typically 412 Conflict. This will not be raised directly by the Azure core pipeline. + +## TooManyRedirectsError +An error raised when the maximum number of redirect attempts is reached. The maximum amount of redirects can be configured in the RedirectPolicy. +```python +class TooManyRedirectsError(HttpResponseError): + def __init__(self, history, *args, **kwargs): + self.history = history + message = "Reached maximum redirect attempts." + super(TooManyRedirectsError, self).__init__(message, *args, **kwargs) +``` + +*history* is used to document the requests/responses that resulted in redirected requests. + +*args* are any additional args to be included with exception. + +*kwargs* are keyword arguments to include with the exception. \ No newline at end of file diff --git a/sdk/core/azure-core/examples/examples_async.py b/sdk/core/azure-core/examples/examples_async.py index 5a8d640a848c..18f3f4ceef3e 100644 --- a/sdk/core/azure-core/examples/examples_async.py +++ b/sdk/core/azure-core/examples/examples_async.py @@ -73,7 +73,7 @@ async def test_example_async_redirect_policy(): # It can also be overridden per operation. async with AsyncPipelineClient(base_url=url, config=config) as client: - response = await client._pipeline.run(request, redirect_max=5) + response = await client._pipeline.run(request, permit_redirects=True, redirect_max=5) # [END async_redirect_policy] diff --git a/sdk/core/azure-core/examples/examples_sync.py b/sdk/core/azure-core/examples/examples_sync.py index 0312c5839330..971500e6880a 100644 --- a/sdk/core/azure-core/examples/examples_sync.py +++ b/sdk/core/azure-core/examples/examples_sync.py @@ -69,12 +69,28 @@ def test_example_redirect_policy(): # It can also be overridden per operation. client = PipelineClient(base_url=url, config=config) request = client.get(url) - pipeline_response = client._pipeline.run(request, redirect_max=5) + pipeline_response = client._pipeline.run(request, permit_redirects=True, redirect_max=5) # [END redirect_policy] response = pipeline_response.http_response assert response.status_code == 200 + +def test_example_no_redirects(): + url = "https://bing.com" + + config = Configuration() + config.redirect_policy = RedirectPolicy.no_redirects() + + client = PipelineClient(base_url=url, config=config) + request = client.get(url) + pipeline_response = client._pipeline.run(request) + + response = pipeline_response.http_response + # bing returns 301 if not redirected + assert response.status_code == 301 + + def test_example_retry_policy(): url = "https://bing.com" @@ -135,3 +151,17 @@ def test_example_retry_policy(): response = pipeline_response.http_response assert response.status_code == 200 + +def test_example_no_retries(): + url = "https://bing.com" + + config = Configuration() + config.retry_policy = RetryPolicy.no_retries() + + client = PipelineClient(base_url=url, config=config) + request = client.get(url) + pipeline_response = client._pipeline.run(request) + + response = pipeline_response.http_response + # bing returns 301 if not retried + assert response.status_code == 301 diff --git a/sdk/core/azure-core/sdk_packaging.toml b/sdk/core/azure-core/sdk_packaging.toml index 1d353c366ee8..54b7bf3be3c7 100644 --- a/sdk/core/azure-core/sdk_packaging.toml +++ b/sdk/core/azure-core/sdk_packaging.toml @@ -1,9 +1,9 @@ [packaging] package_name = "azure-core" package_nspkg = "azure-nspkg" -package_pprint_name = "MyService Management" +package_pprint_name = "Core" package_doc_id = "" is_stable = false -is_arm = true -need_msrestazure = true +is_arm = false +need_msrestazure = false auto_update = false \ No newline at end of file diff --git a/sdk/core/azure-core/setup.py b/sdk/core/azure-core/setup.py index ede4e01a2966..c61e2cfdfe61 100644 --- a/sdk/core/azure-core/setup.py +++ b/sdk/core/azure-core/setup.py @@ -13,28 +13,13 @@ # Change the PACKAGE_NAME only to change folder and different name PACKAGE_NAME = "azure-core" -PACKAGE_PPRINT_NAME = "MyService Management" +PACKAGE_PPRINT_NAME = "Core" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') # a-b-c => a.b.c namespace_name = PACKAGE_NAME.replace('-', '.') -# azure v0.x is not compatible with this package -# azure v0.x used to have a __version__ attribute (newer versions don't) -try: - import azure - try: - ver = azure.__version__ # type: ignore - raise Exception( - 'This package is incompatible with azure=={}. '.format(ver) + - 'Uninstall it with "pip uninstall azure".' - ) - except AttributeError: - pass -except ImportError: - pass - # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', # type: ignore @@ -51,7 +36,7 @@ setup( name=PACKAGE_NAME, version=version, - description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + description='Microsoft Azure {} Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, long_description_content_type='text/markdown', license='MIT License', @@ -77,9 +62,7 @@ 'azure', ]), install_requires=[ - 'msrest>=0.5.0', - 'msrestazure>=0.4.32,<2.0.0', - 'azure-common~=1.1', + 'requests>=2.18.4', ], extras_require={ ":python_version<'3.0'": ['azure-nspkg'], diff --git a/sdk/core/azure-core/tests/azure_core_asynctests/test_authentication.py b/sdk/core/azure-core/tests/azure_core_asynctests/test_authentication.py new file mode 100644 index 000000000000..10e4067daf97 --- /dev/null +++ b/sdk/core/azure-core/tests/azure_core_asynctests/test_authentication.py @@ -0,0 +1,61 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from unittest.mock import Mock +from azure.core.pipeline import AsyncPipeline, PipelineResponse +from azure.core.pipeline.policies import AsyncBearerTokenCredentialPolicy, HTTPPolicy +from azure.core.pipeline.transport import HttpRequest, AsyncHttpTransport +import pytest + + +@pytest.mark.asyncio +async def test_bearer_policy_adds_header(): + """The bearer token policy should add a header containing a token from its credential""" + expected_token = "expected_token" + + async def verify_authorization_header(request): + assert request.http_request.headers["Authorization"] == "Bearer {}".format(expected_token) + + get_token_calls = 0 + + async def get_token(_): + nonlocal get_token_calls + get_token_calls += 1 + return expected_token + + fake_credential = Mock(get_token=get_token) + policies = [ + AsyncBearerTokenCredentialPolicy(fake_credential, "scope"), + Mock(spec=HTTPPolicy, send=verify_authorization_header), + ] + pipeline = AsyncPipeline(transport=Mock(spec=AsyncHttpTransport), policies=policies) + + await pipeline.run(HttpRequest("GET", "https://spam.eggs"), context=None) + assert get_token_calls == 1 + + +@pytest.mark.asyncio +async def test_bearer_policy_send(): + """The bearer token policy should invoke the next policy's send method and return the result""" + expected_request = HttpRequest("GET", "https://spam.eggs") + expected_response = Mock(spec=PipelineResponse) + + async def verify_request(request): + assert request.http_request is expected_request + return expected_response + + async def get_token(_): + return "" + + fake_credential = Mock(get_token=get_token) + policies = [ + AsyncBearerTokenCredentialPolicy(fake_credential, "scope"), + Mock(spec=HTTPPolicy, send=verify_request), + ] + pipeline = AsyncPipeline(transport=Mock(spec=AsyncHttpTransport), policies=policies) + + response = await pipeline.run(expected_request) + + assert response is expected_response diff --git a/sdk/core/azure-core/tests/azure_core_asynctests/test_credentials.py b/sdk/core/azure-core/tests/azure_core_asynctests/test_credentials.py deleted file mode 100644 index f998e9268084..000000000000 --- a/sdk/core/azure-core/tests/azure_core_asynctests/test_credentials.py +++ /dev/null @@ -1,62 +0,0 @@ -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See LICENSE.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -from unittest.mock import Mock -from azure.core.pipeline import AsyncPipeline, PipelineResponse -from azure.core.pipeline.policies import HTTPPolicy -from azure.core.pipeline.policies.credentials_async import AsyncBearerTokenCredentialPolicy -from azure.core.pipeline.transport import HttpRequest, AsyncHttpTransport -import pytest - - -@pytest.mark.asyncio -async def test_bearer_policy_adds_header(): - """The bearer token policy should add a header containing a token from its credential""" - expected_token = "expected_token" - - async def verify_authorization_header(request): - assert request.http_request.headers["Authorization"] == "Bearer {}".format(expected_token) - - get_token_calls = 0 - - async def get_token(_): - nonlocal get_token_calls - get_token_calls += 1 - return expected_token - - fake_credential = Mock(get_token=get_token) - policies = [ - AsyncBearerTokenCredentialPolicy(credential=fake_credential, scopes=("",)), - Mock(spec=HTTPPolicy, send=verify_authorization_header), - ] - pipeline = AsyncPipeline(transport=Mock(spec=AsyncHttpTransport), policies=policies) - - await pipeline.run(HttpRequest("GET", "https://spam.eggs"), context=None) - assert get_token_calls == 1 - - -@pytest.mark.asyncio -async def test_bearer_policy_send(): - """The bearer token policy should invoke the next policy's send method and return the result""" - expected_request = HttpRequest("GET", "https://spam.eggs") - expected_response = Mock(spec=PipelineResponse) - - async def verify_request(request): - assert request.http_request is expected_request - return expected_response - - async def get_token(_): - return "" - - fake_credential = Mock(get_token=get_token) - policies = [ - AsyncBearerTokenCredentialPolicy(credential=fake_credential, scopes=("",)), - Mock(spec=HTTPPolicy, send=verify_request), - ] - pipeline = AsyncPipeline(transport=Mock(spec=AsyncHttpTransport), policies=policies) - - response = await pipeline.run(expected_request) - - assert response is expected_response diff --git a/sdk/core/azure-core/tests/test_authentication.py b/sdk/core/azure-core/tests/test_authentication.py new file mode 100644 index 000000000000..aa74ae46ffd2 --- /dev/null +++ b/sdk/core/azure-core/tests/test_authentication.py @@ -0,0 +1,51 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from azure.core.pipeline import Pipeline, PipelineResponse +from azure.core.pipeline.policies import BearerTokenCredentialPolicy, HTTPPolicy +from azure.core.pipeline.transport import HttpRequest, HttpTransport + +try: + from unittest.mock import Mock +except ImportError: + # python < 3.3 + from mock import Mock + + +def test_bearer_policy_adds_header(): + """The bearer token policy should add a header containing a token from its credential""" + expected_token = "expected_token" + + def verify_authorization_header(request): + assert request.http_request.headers["Authorization"] == "Bearer {}".format(expected_token) + + fake_credential = Mock(get_token=Mock(return_value=expected_token)) + policies = [ + BearerTokenCredentialPolicy(fake_credential, "scope"), + Mock(spec=HTTPPolicy, send=verify_authorization_header), + ] + + Pipeline(transport=Mock(spec=HttpTransport), policies=policies).run(HttpRequest("GET", "https://spam.eggs")) + + assert fake_credential.get_token.call_count == 1 + + +def test_bearer_policy_send(): + """The bearer token policy should invoke the next policy's send method and return the result""" + expected_request = HttpRequest("GET", "https://spam.eggs") + expected_response = Mock(spec=PipelineResponse) + + def verify_request(request): + assert request.http_request is expected_request + return expected_response + + fake_credential = Mock(get_token=lambda _: "") + policies = [ + BearerTokenCredentialPolicy(fake_credential, "scope"), + Mock(spec=HTTPPolicy, send=verify_request), + ] + response = Pipeline(transport=Mock(spec=HttpTransport), policies=policies).run(expected_request) + + assert response is expected_response diff --git a/sdk/core/azure-core/tests/test_credentials.py b/sdk/core/azure-core/tests/test_credentials.py deleted file mode 100644 index 032c179d6ca2..000000000000 --- a/sdk/core/azure-core/tests/test_credentials.py +++ /dev/null @@ -1,51 +0,0 @@ -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See LICENSE.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -from azure.core.pipeline import Pipeline, PipelineResponse -from azure.core.pipeline.policies import BearerTokenCredentialPolicy, HTTPPolicy -from azure.core.pipeline.transport import HttpRequest, HttpTransport - -try: - from unittest.mock import Mock -except ImportError: - # python < 3.3 - from mock import Mock - - -def test_bearer_policy_adds_header(): - """The bearer token policy should add a header containing a token from its credential""" - expected_token = "expected_token" - - def verify_authorization_header(request): - assert request.http_request.headers["Authorization"] == "Bearer {}".format(expected_token) - - fake_credential = Mock(get_token=Mock(return_value=expected_token)) - policies = [ - BearerTokenCredentialPolicy(credential=fake_credential, scopes=("",)), - Mock(spec=HTTPPolicy, send=verify_authorization_header), - ] - - Pipeline(transport=Mock(spec=HttpTransport), policies=policies).run(HttpRequest("GET", "https://spam.eggs")) - - assert fake_credential.get_token.call_count == 1 - - -def test_bearer_policy_send(): - """The bearer token policy should invoke the next policy's send method and return the result""" - expected_request = HttpRequest("GET", "https://spam.eggs") - expected_response = Mock(spec=PipelineResponse) - - def verify_request(request): - assert request.http_request is expected_request - return expected_response - - fake_credential = Mock(get_token=lambda _: "") - policies = [ - BearerTokenCredentialPolicy(credential=fake_credential, scopes=("",)), - Mock(spec=HTTPPolicy, send=verify_request), - ] - response = Pipeline(transport=Mock(spec=HttpTransport), policies=policies).run(expected_request) - - assert response is expected_response diff --git a/sdk/core/azure-servicemanagement-legacy/dev_requirements.txt b/sdk/core/azure-servicemanagement-legacy/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/core/azure-servicemanagement-legacy/dev_requirements.txt +++ b/sdk/core/azure-servicemanagement-legacy/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/cosmos/.azure-pipelines/cosmos.test.nightly-emulator.yml b/sdk/cosmos/.azure-pipelines/cosmos.test.nightly-emulator.yml deleted file mode 100644 index 63a201b96888..000000000000 --- a/sdk/cosmos/.azure-pipelines/cosmos.test.nightly-emulator.yml +++ /dev/null @@ -1,50 +0,0 @@ -jobs: - - job: 'NightlyEmulator' - - timeoutInMinutes: 120 - continueOnError: false - strategy: - matrix: - Windows_Python34: - OSVmImage: 'vs2017-win2016' - PythonVersion: '3.4' - Windows_Python27: - OSVmImage: 'vs2017-win2016' - PythonVersion: '2.7' - - pool: - vmImage: $(OSVmImage) - - steps: - - task: UsePythonVersion@0 - displayName: 'Use Python $(PythonVersion)' - inputs: - versionSpec: $(PythonVersion) - - - script: | - python -m pip install --upgrade pip - python scripts/dev_setup.py --packageList azure-cosmos - displayName: 'Set up Environment' - - - task: azure-cosmosdb.emulator-internal-preview.run-cosmosdbemulatorcontainer.CosmosDbEmulator@2 - displayName: "Run Azure Cosmos DB Preview Emulator Container" - inputs: - username: '$(cosmos-cosmosdb-azurecr-io-username)' - password: '$(cosmos-cosmosdb-azurecr-io-password)' - defaultPartitionCount: 25 - - - task: PowerShell@1 - displayName: 'Run Python Tests' - inputs: - scriptType: inlineScript - inlineScript: | - $env:ACCOUNT_HOST="$(CosmosDBEmulator.Endpoint)" - cmd /c 'pytest --junitxml=sdk/cosmos/azure-cosmos/Test-junit-nightly.xml --verbose sdk/cosmos/azure-cosmos/test -k "not globaldb"' - - condition: succeededOrFailed() - - - task: PublishTestResults@2 - displayName: 'Publish Python Test Results' - inputs: - testResultsFiles: '**\TEST-*.xml' - testRunTitle: 'Cosmos $(OSName) Node $(PythonVersion) - Python' diff --git a/sdk/cosmos/.azure-pipelines/cosmos.test.yml b/sdk/cosmos/.azure-pipelines/cosmos.test.yml index db7bdc528d96..7eb61876023e 100644 --- a/sdk/cosmos/.azure-pipelines/cosmos.test.yml +++ b/sdk/cosmos/.azure-pipelines/cosmos.test.yml @@ -26,6 +26,51 @@ jobs: vmImage: $(OSVmImage) steps: + - task: PowerShell@1 + displayName: 'Download Public Cosmos Emulator' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Downloading Cosmos Emulator - $(EmulatorMsiUrl)" + wget "$(EmulatorMsiUrl)" -outfile "$env:temp\azure-cosmosdb-emulator.msi" + Write-Host "Finished Downloading Cosmos Emulator - $env:temp\azure-cosmosdb-emulator.msi" + dir "$env:temp" + + - task: CmdLine@2 + displayName: 'Cleanup already installed Azure Cosmos DB Emulator' + inputs: + script: | + echo "Deleting Azure Cosmos DB Emulator directory" + dir "%ProgramFiles%\" + rmdir /Q /S "%ProgramFiles%\Azure Cosmos DB Emulator" + echo "Directory after deleting" + dir "%ProgramFiles%\" + + - task: CmdLine@2 + displayName: 'Install Public Cosmos DB Emulator' + inputs: + script: | + choco install lessmsi + choco upgrade lessmsi + echo "Checking directory" + dir "%ProgramFiles%" + mkdir "%TEMP%\Azure Cosmos DB Emulator" + lessmsi x "%TEMP%\azure-cosmosdb-emulator.msi" "%TEMP%\Azure Cosmos DB Emulator\" + dir "%TEMP%" + dir "%Temp%\Azure Cosmos DB Emulator\" + + - task: PowerShell@1 + displayName: 'Run Public Cosmos DB Emulator' + inputs: + scriptType: inlineScript + inlineScript: | + dir "$env:Temp\" + dir "$env:Temp\Azure Cosmos DB Emulator" + dir "$env:Temp\Azure Cosmos DB Emulator\SourceDir\" + dir "$env:Temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator" + Write-Host "Starting Comsos DB Emulator" + Start-Process "$env:Temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" "/NoExplorer /NoUI" -Verb RunAs + - task: UsePythonVersion@0 displayName: 'Use Python $(PythonVersion)' inputs: @@ -36,17 +81,12 @@ jobs: python scripts/dev_setup.py --packageList azure-cosmos displayName: 'Set up Environment' - - task: azure-cosmosdb.emulator-public-preview.run-cosmosdbemulatorcontainer.CosmosDbEmulator@2 - displayName: "Run Azure Cosmos DB Emulator container" - inputs: - defaultPartitionCount: 25 - - task: PowerShell@1 displayName: 'Run Python Tests' inputs: scriptType: inlineScript inlineScript: | - $env:ACCOUNT_HOST="$(CosmosDBEmulator.Endpoint)" + $env:ACCOUNT_HOST="https://localhost:8081/" cmd /c 'pytest --junitxml=sdk/cosmos/azure-cosmos/Test-junit.xml --verbose sdk/cosmos/azure-cosmos/test -k "not globaldb"' condition: succeededOrFailed() diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/cosmos_client.py b/sdk/cosmos/azure-cosmos/azure/cosmos/cosmos_client.py index a8f2617d8e86..728668b5036b 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/cosmos_client.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/cosmos_client.py @@ -37,6 +37,7 @@ import azure.cosmos.routing.routing_map_provider as routing_map_provider import azure.cosmos.session as session import azure.cosmos.utils as utils +import os class CosmosClient(object): """Represents a document client. @@ -80,12 +81,15 @@ def __init__(self, :param documents.ConsistencyLevel consistency_level: The default consistency policy for client operations. + if url_connection and auth are not provided, + COSMOS_ENDPOINT and COSMOS_KEY environment variables will be used. """ - self.url_connection = url_connection + + self.url_connection = url_connection or os.environ.get('COSMOS_ENDPOINT') self.master_key = None self.resource_tokens = None - if auth != None: + if auth is not None: self.master_key = auth.get('masterKey') self.resource_tokens = auth.get('resourceTokens') @@ -95,6 +99,8 @@ def __init__(self, resource_parts = permission_feed['resource'].split('/') id = resource_parts[-1] self.resource_tokens[id] = permission_feed['_token'] + else: + self.master_key = os.environ.get('COSMOS_KEY') self.connection_policy = (connection_policy or documents.ConnectionPolicy()) diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/execution_context/document_producer.py b/sdk/cosmos/azure-cosmos/azure/cosmos/execution_context/document_producer.py index e0f79674fed4..c74a60e3bade 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/execution_context/document_producer.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/execution_context/document_producer.py @@ -108,6 +108,8 @@ def __lt__(self, other): return self._doc_producer_comp.compare(self, other) < 0 def _compare_helper(a, b): + if a is None and b is None: + return 0 return (a > b) - (a < b) class _PartitionKeyRangeDocumentProduerComparator(object): diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/http_constants.py b/sdk/cosmos/azure-cosmos/azure/cosmos/http_constants.py index 2131d3038f60..b9ceb6471349 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/http_constants.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/http_constants.py @@ -257,7 +257,7 @@ class Versions: """ CurrentVersion = '2018-09-17' SDKName = 'azure-cosmos' - SDKVersion = '3.0.3-SNAPSHOT' + SDKVersion = '3.1.0' class Delimiters: diff --git a/sdk/cosmos/azure-cosmos/doc/conf.py b/sdk/cosmos/azure-cosmos/doc/conf.py index 1b7b5dbd2bd7..c15c2f3b32ec 100644 --- a/sdk/cosmos/azure-cosmos/doc/conf.py +++ b/sdk/cosmos/azure-cosmos/doc/conf.py @@ -52,9 +52,9 @@ # built documents. # # The short X.Y version. -version = '3.0.3-SNAPSHOT' +version = '3.1.0' # The full version, including alpha/beta/rc tags. -release = '3.0.3-SNAPSHOT' +release = '3.1.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/sdk/cosmos/azure-cosmos/samples/CollectionManagement/Program.py b/sdk/cosmos/azure-cosmos/samples/CollectionManagement/Program.py index 2361d0096cb5..485de1f5b286 100644 --- a/sdk/cosmos/azure-cosmos/samples/CollectionManagement/Program.py +++ b/sdk/cosmos/azure-cosmos/samples/CollectionManagement/Program.py @@ -22,6 +22,8 @@ # 2.2 - Create collection with custom IndexPolicy # 2.3 - Create collection with offer throughput set # 2.4 - Create collection with unique key +# 2.5 - Create Collection with partition key +# 2.6 - Create Collection with partition key V2 # # 3. Manage Collection Offer Throughput # 3.1 - Get Collection performance tier @@ -165,12 +167,37 @@ def create_Container(client, id): collection = client.CreateContainer(database_link, coll) print('Collection with id \'{0}\' created'.format(collection['id'])) + print('Partition Key - \'{0}\''.format(collection['partitionKey'])) except errors.CosmosError as e: if e.status_code == 409: print('A collection with id \'{0}\' already exists'.format(collection['id'])) else: - raise errors.HTTPFailure(e.status_code) + raise errors.HTTPFailure(e.status_code) + + print("\n2.6 Create Collection - With Partition key V2") + + try: + coll = { + "id": "collection_partition_key_v2", + "partitionKey": { + "paths": [ + "/field1" + ], + "kind": "Hash", + "version": 2 + } + } + + collection = client.CreateContainer(database_link, coll) + print('Collection with id \'{0}\' created'.format(collection['id'])) + print('Partition Key - \'{0}\''.format(collection['partitionKey'])) + + except errors.CosmosError as e: + if e.status_code == 409: + print('A collection with id \'{0}\' already exists'.format(collection['id'])) + else: + raise errors.HTTPFailure(e.status_code) @staticmethod def manage_offer_throughput(client, id): diff --git a/sdk/cosmos/azure-cosmos/samples/IndexManagement/Program.py b/sdk/cosmos/azure-cosmos/samples/IndexManagement/Program.py index f794b6424157..e4c3f4a6b08b 100644 --- a/sdk/cosmos/azure-cosmos/samples/IndexManagement/Program.py +++ b/sdk/cosmos/azure-cosmos/samples/IndexManagement/Program.py @@ -565,6 +565,102 @@ def PerformIndexTransformations(client, database_id): else: raise +def PerformMultiOrderbyQuery(client, database_id): + try: + DeleteContainerIfExists(client, database_id, COLLECTION_ID) + database_link = GetDatabaseLink(database_id) + + # Create a collection with composite indexes + indexingPolicy = { + "compositeIndexes": [ + [ + { + "path": "/numberField", + "order": "ascending" + }, + { + "path": "/stringField", + "order": "descending" + } + ], + [ + { + "path": "/numberField", + "order": "descending" + }, + { + "path": "/stringField", + "order": "ascending" + }, + { + "path": "/numberField2", + "order": "descending" + }, + { + "path": "/stringField2", + "order": "ascending" + } + ] + ] + } + + container_definition = { + 'id': COLLECTION_ID, + 'indexingPolicy': indexingPolicy + } + + created_container = client.CreateContainer(database_link, container_definition) + + print(created_container) + + print("\n" + "-" * 25 + "\n8. Collection created with index policy") + print_dictionary_items(created_container["indexingPolicy"]) + + # Insert some documents + collection_link = GetContainerLink(database_id, COLLECTION_ID) + doc1 = client.CreateItem(collection_link, {"id": "doc1", "numberField": 1, "stringField": "1", "numberField2": 1, "stringField2": "1"}) + doc2 = client.CreateItem(collection_link, {"id": "doc2", "numberField": 1, "stringField": "1", "numberField2": 1, "stringField2": "2"}) + doc3 = client.CreateItem(collection_link, {"id": "doc3", "numberField": 1, "stringField": "1", "numberField2": 2, "stringField2": "1"}) + doc4 = client.CreateItem(collection_link, {"id": "doc4", "numberField": 1, "stringField": "1", "numberField2": 2, "stringField2": "2"}) + doc5 = client.CreateItem(collection_link, {"id": "doc5", "numberField": 1, "stringField": "2", "numberField2": 1, "stringField2": "1"}) + doc6 = client.CreateItem(collection_link, {"id": "doc6", "numberField": 1, "stringField": "2", "numberField2": 1, "stringField2": "2"}) + doc7 = client.CreateItem(collection_link, {"id": "doc7", "numberField": 1, "stringField": "2", "numberField2": 2, "stringField2": "1"}) + doc8 = client.CreateItem(collection_link, {"id": "doc8", "numberField": 1, "stringField": "2", "numberField2": 2, "stringField2": "2"}) + doc9 = client.CreateItem(collection_link, {"id": "doc9", "numberField": 2, "stringField": "1", "numberField2": 1, "stringField2": "1"}) + doc10 = client.CreateItem(collection_link, {"id": "doc10", "numberField": 2, "stringField": "1", "numberField2": 1, "stringField2": "2"}) + doc11 = client.CreateItem(collection_link, {"id": "doc11", "numberField": 2, "stringField": "1", "numberField2": 2, "stringField2": "1"}) + doc12 = client.CreateItem(collection_link, {"id": "doc12", "numberField": 2, "stringField": "1", "numberField2": 2, "stringField2": "2"}) + doc13 = client.CreateItem(collection_link, {"id": "doc13", "numberField": 2, "stringField": "2", "numberField2": 1, "stringField2": "1"}) + doc14 = client.CreateItem(collection_link, {"id": "doc14", "numberField": 2, "stringField": "2", "numberField2": 1, "stringField2": "2"}) + doc15 = client.CreateItem(collection_link, {"id": "doc15", "numberField": 2, "stringField": "2", "numberField2": 2, "stringField2": "1"}) + doc16 = client.CreateItem(collection_link, {"id": "doc16", "numberField": 2, "stringField": "2", "numberField2": 2, "stringField2": "2"}) + + print("Query documents and Order by 1st composite index: Ascending numberField and Descending stringField:") + + query = { + "query": "SELECT * FROM r ORDER BY r.numberField ASC, r.stringField DESC", + } + QueryDocumentsWithCustomQuery(client, collection_link, query) + + print("Query documents and Order by inverted 2nd composite index -") + print("Ascending numberField, Descending stringField, Ascending numberField2, Descending stringField2") + + query = { + "query": "SELECT * FROM r ORDER BY r.numberField ASC, r.stringField DESC, r.numberField2 ASC, r.stringField2 DESC", + } + QueryDocumentsWithCustomQuery(client, collection_link, query) + + # Cleanup + client.DeleteContainer(collection_link) + print("\n") + except errors.HTTPFailure as e: + if e.status_code == 409: + print("Entity already exists") + elif e.status_code == 404: + print("Entity doesn't exist") + else: + raise + def RunIndexDemo(): try: client = ObtainClient() @@ -592,6 +688,9 @@ def RunIndexDemo(): # 7. Perform an index transform PerformIndexTransformations(client, DATABASE_ID) + # 8. Perform Multi Orderby queries using composite indexes + PerformMultiOrderbyQuery(client, DATABASE_ID) + except errors.CosmosError as e: raise e diff --git a/sdk/cosmos/azure-cosmos/setup.py b/sdk/cosmos/azure-cosmos/setup.py index 995dc3ba68c8..aaa0880df181 100644 --- a/sdk/cosmos/azure-cosmos/setup.py +++ b/sdk/cosmos/azure-cosmos/setup.py @@ -4,7 +4,7 @@ import setuptools setup(name='azure-cosmos', - version='3.0.3-SNAPSHOT', + version='3.1.0', description='Azure Cosmos Python SDK', author="Microsoft", author_email="askdocdb@microsoft.com", diff --git a/sdk/cosmos/azure-cosmos/test/aggregate_tests.py b/sdk/cosmos/azure-cosmos/test/aggregate_tests.py index 60e3aecc6da5..7ba31202d8f8 100644 --- a/sdk/cosmos/azure-cosmos/test/aggregate_tests.py +++ b/sdk/cosmos/azure-cosmos/test/aggregate_tests.py @@ -33,6 +33,8 @@ import test_config from azure.cosmos.errors import HTTPFailure +pytestmark = pytest.mark.cosmosEmulator + class _config: host = test_config._test_config.host master_key = test_config._test_config.masterKey @@ -199,15 +201,18 @@ def _get_collection_link(database, document_collection, is_name_based=True): _all_tests = [] - _setup() - _generate_test_configs() - _run_all() - return type.__new__(mcs, name, bases, dict) @pytest.mark.usefixtures("teardown") class AggregationQueryTest(with_metaclass(AggregateQueryTestSequenceMeta, unittest.TestCase)): + + @classmethod + def setUpClass(cls): + cls._setup() + cls._generate_test_configs() + cls._run_all() + def _execute_query_and_validate_results(self, client, collection_link, query, expected): print('Running test with query: ' + query) diff --git a/sdk/cosmos/azure-cosmos/test/base_unit_tests.py b/sdk/cosmos/azure-cosmos/test/base_unit_tests.py index be418e03e854..2dd41a646231 100644 --- a/sdk/cosmos/azure-cosmos/test/base_unit_tests.py +++ b/sdk/cosmos/azure-cosmos/test/base_unit_tests.py @@ -2,6 +2,8 @@ import pytest import azure.cosmos.base as base +pytestmark = pytest.mark.cosmosEmulator + @pytest.mark.usefixtures("teardown") class BaseUnitTests(unittest.TestCase): def test_is_name_based(self): diff --git a/sdk/cosmos/azure-cosmos/test/crud_tests.py b/sdk/cosmos/azure-cosmos/test/crud_tests.py index 4e5598074d40..579064f42ba9 100644 --- a/sdk/cosmos/azure-cosmos/test/crud_tests.py +++ b/sdk/cosmos/azure-cosmos/test/crud_tests.py @@ -52,6 +52,7 @@ import test_partition_resolver import azure.cosmos.base as base +pytestmark = pytest.mark.cosmosEmulator #IMPORTANT NOTES: @@ -70,8 +71,6 @@ class CRUDTests(unittest.TestCase): host = configs.host masterKey = configs.masterKey connectionPolicy = configs.connectionPolicy - client = cosmos_client.CosmosClient(host, {'masterKey': masterKey}, connectionPolicy) - databseForTest = configs.create_database_if_not_exist(client) def __AssertHTTPFailureWithStatus(self, status_code, func, *args, **kwargs): """Assert HTTP failure with status. @@ -94,6 +93,9 @@ def setUpClass(cls): "You must specify your Azure Cosmos account values for " "'masterKey' and 'host' at the top of this class to run the " "tests.") + cls.client = cosmos_client.CosmosClient(cls.host, {'masterKey': cls.masterKey}, cls.connectionPolicy) + cls.databseForTest = cls.configs.create_database_if_not_exist(cls.client) + def setUp(self): self.client = cosmos_client.CosmosClient(self.host, {'masterKey': self.masterKey}, self.connectionPolicy) @@ -3116,6 +3118,75 @@ def _test_create_default_indexing_policy(self, is_name_based): self._check_default_indexing_policy_paths(collection['indexingPolicy']) self.client.DeleteContainer(collection['_self']) + def test_create_indexing_policy_with_composite_and_spatial_indexes_self_link(self): + self._test_create_indexing_policy_with_composite_and_spatial_indexes(False) + + def test_create_indexing_policy_with_composite_and_spatial_indexes_name_based(self): + self._test_create_indexing_policy_with_composite_and_spatial_indexes(True) + + def _test_create_indexing_policy_with_composite_and_spatial_indexes(self, is_name_based): + # create database + db = self.databseForTest + + indexing_policy = { + "spatialIndexes": [ + { + "path": "/path0/*", + "types": [ + "Point", + "LineString", + "Polygon" + ] + }, + { + "path": "/path1/*", + "types": [ + "LineString", + "Polygon", + "MultiPolygon" + ] + } + ], + "compositeIndexes": [ + [ + { + "path": "/path1", + "order": "ascending" + }, + { + "path": "/path2", + "order": "descending" + }, + { + "path": "/path3", + "order": "ascending" + } + ], + [ + { + "path": "/path4", + "order": "ascending" + }, + { + "path": "/path5", + "order": "descending" + }, + { + "path": "/path6", + "order": "ascending" + } + ] + ] + } + + container_id = 'composite_index_spatial_index' + str(uuid.uuid4()) + container_definition = {'id': container_id, 'indexingPolicy': indexing_policy} + created_container = self.client.CreateContainer(self.GetDatabaseLink(db, is_name_based), container_definition) + read_indexing_policy = created_container['indexingPolicy'] + self.assertListEqual(indexing_policy['spatialIndexes'], read_indexing_policy['spatialIndexes']) + self.assertListEqual(indexing_policy['compositeIndexes'], read_indexing_policy['compositeIndexes']) + self.client.DeleteContainer(created_container['_self']) + def _check_default_indexing_policy_paths(self, indexing_policy): def __get_first(array): if array: @@ -3135,8 +3206,8 @@ def __get_first(array): def test_client_request_timeout(self): connection_policy = documents.ConnectionPolicy() - # making timeout 1 ms to make sure it will throw - connection_policy.RequestTimeout = 1 + # making timeout 0 ms to make sure it will throw + connection_policy.RequestTimeout = 0 with self.assertRaises(Exception): # client does a getDatabaseAccount on initialization, which will time out cosmos_client.CosmosClient(CRUDTests.host, diff --git a/sdk/cosmos/azure-cosmos/test/encoding_tests.py b/sdk/cosmos/azure-cosmos/test/encoding_tests.py index 25592611bdbe..8bd61a267098 100644 --- a/sdk/cosmos/azure-cosmos/test/encoding_tests.py +++ b/sdk/cosmos/azure-cosmos/test/encoding_tests.py @@ -7,6 +7,8 @@ import azure.cosmos.documents as documents import test_config +pytestmark = pytest.mark.cosmosEmulator + @pytest.mark.usefixtures("teardown") class EncodingTest(unittest.TestCase): """Test to ensure escaping of non-ascii characters from partition key""" @@ -14,8 +16,19 @@ class EncodingTest(unittest.TestCase): host = test_config._test_config.host masterKey = test_config._test_config.masterKey connectionPolicy = test_config._test_config.connectionPolicy - client = cosmos_client.CosmosClient(host, {'masterKey': masterKey}, connectionPolicy) - created_collection = test_config._test_config.create_multi_partition_collection_with_custom_pk_if_not_exist(client) + + @classmethod + def setUpClass(cls): + if (cls.masterKey == '[YOUR_KEY_HERE]' or + cls.host == '[YOUR_ENDPOINT_HERE]'): + raise Exception( + "You must specify your Azure Cosmos account values for " + "'masterKey' and 'host' at the top of this class to run the " + "tests.") + + cls.client = cosmos_client.CosmosClient(cls.host, {'masterKey': cls.masterKey}, cls.connectionPolicy) + cls.created_collection = test_config._test_config.create_multi_partition_collection_with_custom_pk_if_not_exist(cls.client) + def test_unicode_characters_in_partition_key (self): test_string = u'€€ کلید پارتیشن विभाजन कुंजी 123' diff --git a/sdk/cosmos/azure-cosmos/test/env_test.py b/sdk/cosmos/azure-cosmos/test/env_test.py new file mode 100644 index 000000000000..3f9a0d957c20 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/test/env_test.py @@ -0,0 +1,109 @@ +#The MIT License (MIT) +#Copyright (c) 2019 Microsoft Corporation + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +import unittest +import uuid +import pytest +import azure.cosmos.documents as documents +import azure.cosmos.cosmos_client as cosmos_client +import test_config +import os + +pytestmark = pytest.mark.cosmosEmulator + +#IMPORTANT NOTES: + +# Most test cases in this file create collections in your Azure Cosmos account. +# Collections are billing entities. By running these test cases, you may incur monetary costs on your account. + +# To Run the test, replace the two member fields (masterKey and host) with values +# associated with your Azure Cosmos account. + +@pytest.mark.usefixtures("teardown") +class EnvTest(unittest.TestCase): + """Env Tests. + """ + + host = test_config._test_config.host + masterKey = test_config._test_config.masterKey + connectionPolicy = test_config._test_config.connectionPolicy + + @classmethod + def setUpClass(cls): + # creates the database, collection, and insert all the documents + # we will gain some speed up in running the tests by creating the database, collection and inserting all the docs only once + + if (cls.masterKey == '[YOUR_KEY_HERE]' or + cls.host == '[YOUR_ENDPOINT_HERE]'): + raise Exception( + "You must specify your Azure Cosmos account values for " + "'masterKey' and 'host' at the top of this class to run the " + "tests.") + + os.environ["COSMOS_ENDPOINT"] = cls.host + os.environ["COSMOS_KEY"] = cls.masterKey + cls.client = cosmos_client.CosmosClient(None, None, cls.connectionPolicy) + cls.created_db = test_config._test_config.create_database_if_not_exist(cls.client) + cls.created_collection = test_config._test_config.create_single_partition_collection_if_not_exist(cls.client) + cls.collection_link = cls.GetDocumentCollectionLink(cls.created_db, cls.created_collection) + + @classmethod + def tearDownClass(cls): + del os.environ['COSMOS_ENDPOINT'] + del os.environ['COSMOS_KEY'] + + def test_insert(self): + # create a document using the document definition + d = {'id': '1', + 'name': 'sample document', + 'spam': 'eggs', + 'cnt': '1', + 'key': 'value', + 'spam2': 'eggs', + } + + self.client.CreateItem(self.collection_link, d) + + @classmethod + def GetDatabaseLink(cls, database, is_name_based=True): + if is_name_based: + return 'dbs/' + database['id'] + else: + return database['_self'] + + @classmethod + def GetDocumentCollectionLink(cls, database, document_collection, is_name_based=True): + if is_name_based: + return cls.GetDatabaseLink(database) + '/colls/' + document_collection['id'] + else: + return document_collection['_self'] + + @classmethod + def GetDocumentLink(cls, database, document_collection, document, is_name_based=True): + if is_name_based: + return cls.GetDocumentCollectionLink(database, document_collection) + '/docs/' + document['id'] + else: + return document['_self'] + + +if __name__ == "__main__": + #import sys;sys.argv = ['', 'Test.testName'] + unittest.main() \ No newline at end of file diff --git a/sdk/cosmos/azure-cosmos/test/globaldb_mock_tests.py b/sdk/cosmos/azure-cosmos/test/globaldb_mock_tests.py index 8f4647453b2b..1de31c8405c6 100644 --- a/sdk/cosmos/azure-cosmos/test/globaldb_mock_tests.py +++ b/sdk/cosmos/azure-cosmos/test/globaldb_mock_tests.py @@ -32,6 +32,8 @@ import azure.cosmos.retry_utility as retry_utility import test_config +pytestmark = pytest.mark.cosmosEmulator + location_changed = False class MockGlobalEndpointManager: diff --git a/sdk/cosmos/azure-cosmos/test/globaldb_tests.py b/sdk/cosmos/azure-cosmos/test/globaldb_tests.py index a0c43c959b2b..a0114516fd21 100644 --- a/sdk/cosmos/azure-cosmos/test/globaldb_tests.py +++ b/sdk/cosmos/azure-cosmos/test/globaldb_tests.py @@ -35,6 +35,8 @@ from azure.cosmos.http_constants import HttpHeaders, StatusCodes, SubStatusCodes import test_config +pytestmark = pytest.mark.cosmosEmulator + #IMPORTANT NOTES: # Most test cases in this file create collections in your Azure Cosmos account. diff --git a/sdk/cosmos/azure-cosmos/test/location_cache_tests.py b/sdk/cosmos/azure-cosmos/test/location_cache_tests.py index 72926671db0e..c341b63776f9 100644 --- a/sdk/cosmos/azure-cosmos/test/location_cache_tests.py +++ b/sdk/cosmos/azure-cosmos/test/location_cache_tests.py @@ -15,6 +15,8 @@ import azure.cosmos.retry_utility as retry_utility import six +pytestmark = pytest.mark.cosmosEmulator + class RefreshThread(threading.Thread): def __init__(self, group=None, target=None, name=None, args=(), kwargs=None, verbose=None): diff --git a/sdk/cosmos/azure-cosmos/test/multiOrderbyTests.py b/sdk/cosmos/azure-cosmos/test/multiOrderbyTests.py new file mode 100644 index 000000000000..778a26f8a4f4 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/test/multiOrderbyTests.py @@ -0,0 +1,305 @@ +# The MIT License (MIT) +# Copyright (c) 2014 Microsoft Corporation + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import unittest +import uuid +import pytest +import random +import azure.cosmos.cosmos_client as cosmos_client +import test_config + +pytestmark = pytest.mark.cosmosEmulator + +# IMPORTANT NOTES: + +# Most test cases in this file create collections in your Azure Cosmos account. +# Collections are billing entities. By running these test cases, you may incur monetary costs on your account. + +# To Run the test, replace the two member fields (masterKey and host) with values +# associated with your Azure Cosmos account. + +@pytest.mark.usefixtures("teardown") +class MultiOrderbyTests(unittest.TestCase): + """Multi Orderby and Composite Indexes Tests. + """ + + NUMBER_FIELD = "numberField" + STRING_FIELD = "stringField" + NUMBER_FIELD_2 = "numberField2" + STRING_FIELD_2 = "stringField2" + BOOL_FIELD = "boolField" + NULL_FIELD = "nullField" + OBJECT_FIELD = "objectField" + ARRAY_FIELD = "arrayField" + SHORT_STRING_FIELD = "shortStringField" + MEDIUM_STRING_FIELD = "mediumStringField" + LONG_STRING_FIELD = "longStringField" + PARTITION_KEY = "pk" + documents = [] + host = test_config._test_config.host + masterKey = test_config._test_config.masterKey + connectionPolicy = test_config._test_config.connectionPolicy + + @classmethod + def setUpClass(cls): + if (cls.masterKey == '[YOUR_KEY_HERE]' or + cls.host == '[YOUR_ENDPOINT_HERE]'): + raise Exception( + "You must specify your Azure Cosmos account values for " + "'masterKey' and 'host' at the top of this class to run the " + "tests.") + + cls.client = cosmos_client.CosmosClient(cls.host, {'masterKey': cls.masterKey}, cls.connectionPolicy) + cls.database = test_config._test_config.create_database_if_not_exist(cls.client) + + + def generate_multi_orderby_document(self): + document = {} + document['id'] = str(uuid.uuid4()) + document[self.NUMBER_FIELD] = random.randint(0, 5) + document[self.NUMBER_FIELD_2] = random.randint(0, 5) + document[self.BOOL_FIELD] = random.randint(0, 2) % 2 == 0 + document[self.STRING_FIELD] = str(random.randint(0, 5)) + document[self.STRING_FIELD_2] = str(random.randint(0, 5)) + document[self.NULL_FIELD] = None + document[self.OBJECT_FIELD] = "" + document[self.ARRAY_FIELD] = [] + document[self.SHORT_STRING_FIELD] = "a" + str(random.randint(0, 100)) + document[self.MEDIUM_STRING_FIELD] = "a" + str(random.randint(0, 128) + 100) + document[self.LONG_STRING_FIELD] = "a" + str(random.randint(0, 255) + 128) + document[self.PARTITION_KEY] = random.randint(0, 5) + return document + + def create_random_documents(self, container, number_of_documents, number_of_duplicates): + for i in range(0, number_of_documents): + multi_orderby_document = self.generate_multi_orderby_document() + for j in range(0, number_of_duplicates): + # Add the document itself for exact duplicates + clone = multi_orderby_document.copy() + clone['id'] = str(uuid.uuid4()) + self.documents.append(clone) + + # Permute all the fields so that there are duplicates with tie breaks + number_clone = multi_orderby_document.copy() + number_clone[self.NUMBER_FIELD] = random.randint(0, 5) + number_clone['id'] = str(uuid.uuid4()) + self.documents.append(number_clone) + + string_clone = multi_orderby_document.copy() + string_clone[self.STRING_FIELD] = str(random.randint(0, 5)) + string_clone['id'] = str(uuid.uuid4()) + self.documents.append(string_clone) + + bool_clone = multi_orderby_document.copy() + bool_clone[self.BOOL_FIELD] = random.randint(0, 2) % 2 == 0 + bool_clone['id'] = str(uuid.uuid4()) + self.documents.append(bool_clone) + + # Also fuzz what partition it goes to + partition_clone = multi_orderby_document.copy() + partition_clone[self.PARTITION_KEY] = random.randint(0, 5) + partition_clone['id'] = str(uuid.uuid4()) + self.documents.append(partition_clone) + + for document in self.documents: + self.client.CreateItem(container['_self'], document) + + def test_multi_orderby_queries(self): + indexingPolicy = { + "indexingMode": "consistent", + "automatic": True, + "includedPaths": [ + { + "path": "/*", + "indexes": [] + } + ], + "excludedPaths": [ + { + "path": "/\"_etag\"/?" + } + ], + "compositeIndexes": [ + [ + { + "path": "/numberField", + "order": "ascending" + }, + { + "path": "/stringField", + "order": "descending" + } + ], + [ + { + "path": "/numberField", + "order": "descending" + }, + { + "path": "/stringField", + "order": "ascending" + }, + { + "path": "/numberField2", + "order": "descending" + }, + { + "path": "/stringField2", + "order": "ascending" + } + ], + [ + { + "path": "/numberField", + "order": "descending" + }, + { + "path": "/stringField", + "order": "ascending" + }, + { + "path": "/boolField", + "order": "descending" + }, + { + "path": "/nullField", + "order": "ascending" + } + ], + [ + { + "path": "/stringField", + "order": "ascending" + }, + { + "path": "/shortStringField", + "order": "ascending" + }, + { + "path": "/mediumStringField", + "order": "ascending" + }, + { + "path": "/longStringField", + "order": "ascending" + } + ] + ] + } + partitionKey = { + "paths": [ + "/pk" + ], + "kind": "Hash" + } + container_id = 'multi_orderby_container' + str(uuid.uuid4()) + container_definition = { + 'id': container_id, + 'indexingPolicy': indexingPolicy, + 'partitionKey': partitionKey + } + options = { 'offerThroughput': 25100 } + created_container = self.client.CreateContainer(self.database['_self'], container_definition, options) + + number_of_documents = 4 + number_of_duplicates = 5 + self.create_random_documents(created_container, number_of_documents, number_of_duplicates) + + feed_options = { 'enableCrossPartitionQuery': True } + bool_vals = [True, False] + composite_indexes = indexingPolicy['compositeIndexes'] + for composite_index in composite_indexes: + # for every order + for invert in bool_vals: + # for normal and inverted order + for has_top in bool_vals: + # with and without top + for has_filter in bool_vals: + # with and without filter + # Generate a multi order by from that index + orderby_items = [] + select_items = [] + for composite_path in composite_index: + is_desc = True if composite_path['order'] == "descending" else False + if invert: + is_desc = not is_desc + + is_desc_string = "DESC" if is_desc else "ASC" + composite_path_name = composite_path['path'].replace("/", "") + orderby_items_string = "root." + composite_path_name + " " + is_desc_string + select_items_string = "root." + composite_path_name + orderby_items.append(orderby_items_string) + select_items.append(select_items_string) + + top_count = 10 + select_item_builder = "" + for select_item in select_items: + select_item_builder += select_item + "," + select_item_builder = select_item_builder[:-1] + + orderby_item_builder = "" + for orderby_item in orderby_items: + orderby_item_builder += orderby_item + "," + orderby_item_builder = orderby_item_builder[:-1] + + top_string = "TOP " + str(top_count) if has_top else "" + where_string = "WHERE root." + self.NUMBER_FIELD + " % 2 = 0" if has_filter else "" + query = "SELECT " + top_string + " [" + select_item_builder + "] " + \ + "FROM root " + where_string + " " + \ + "ORDER BY " + orderby_item_builder + + expected_ordered_list = self.top(self.sort(self.filter(self.documents, has_filter), composite_index, invert), has_top, top_count) + + result_ordered_list = list(self.client.QueryItems(created_container['_self'], query, feed_options)) + + self.validate_results(expected_ordered_list, result_ordered_list, composite_index) + + def top(self, documents, has_top, top_count): + return documents[0:top_count] if has_top else documents + + def sort(self, documents, composite_index, invert): + current_docs = documents + for composite_path in reversed(composite_index): + order = composite_path['order'] + if invert: + order = "ascending" if order == "descending" else "descending" + path = composite_path['path'].replace("/", "") + if self.NULL_FIELD not in path: + current_docs = sorted(current_docs, key=lambda x: x[path], reverse=True if order == "descending" else False) + return current_docs + + def filter(self, documents, has_filter): + return [x for x in documents if x[self.NUMBER_FIELD] % 2 == 0] if has_filter else documents + + def validate_results(self, expected_ordered_list, result_ordered_list, composite_index): + self.assertEquals(len(expected_ordered_list), len(result_ordered_list)) + + for i in range(0, len(expected_ordered_list)): + result_values = result_ordered_list[i]['$1'] + self.assertEquals(len(result_values), len(composite_index)) + + for j in range(0, len(composite_index)): + path = composite_index[j]['path'].replace("/", "") + if self.NULL_FIELD in path: + self.assertIsNone(expected_ordered_list[i][path]) + self.assertIsNone(result_values[j]) + else: + self.assertEquals(expected_ordered_list[i][path], result_values[j]) diff --git a/sdk/cosmos/azure-cosmos/test/multimaster_tests.py b/sdk/cosmos/azure-cosmos/test/multimaster_tests.py index 7967a760c0bb..6ad4c5949be1 100644 --- a/sdk/cosmos/azure-cosmos/test/multimaster_tests.py +++ b/sdk/cosmos/azure-cosmos/test/multimaster_tests.py @@ -13,6 +13,8 @@ import azure.cosmos.retry_utility as retry_utility import test_config +pytestmark = pytest.mark.cosmosEmulator + @pytest.mark.usefixtures("teardown") class MultiMasterTests(unittest.TestCase): diff --git a/sdk/cosmos/azure-cosmos/test/orderby_tests.py b/sdk/cosmos/azure-cosmos/test/orderby_tests.py index ae71e0bebc92..9548220ff0da 100644 --- a/sdk/cosmos/azure-cosmos/test/orderby_tests.py +++ b/sdk/cosmos/azure-cosmos/test/orderby_tests.py @@ -29,6 +29,8 @@ from six.moves import xrange import test_config +pytestmark = pytest.mark.cosmosEmulator + #IMPORTANT NOTES: # Most test cases in this file create collections in your Azure Cosmos account. diff --git a/sdk/cosmos/azure-cosmos/test/proxy_tests.py b/sdk/cosmos/azure-cosmos/test/proxy_tests.py index 28b61fd56612..86c797373ccc 100644 --- a/sdk/cosmos/azure-cosmos/test/proxy_tests.py +++ b/sdk/cosmos/azure-cosmos/test/proxy_tests.py @@ -32,6 +32,8 @@ from threading import Thread from requests.exceptions import ProxyError +pytestmark = pytest.mark.cosmosEmulator + @pytest.mark.usefixtures("teardown") class CustomRequestHandler(BaseHTTPRequestHandler): database_name = None diff --git a/sdk/cosmos/azure-cosmos/test/query_execution_context_tests.py b/sdk/cosmos/azure-cosmos/test/query_execution_context_tests.py index b890f4613935..0f8096a785f3 100644 --- a/sdk/cosmos/azure-cosmos/test/query_execution_context_tests.py +++ b/sdk/cosmos/azure-cosmos/test/query_execution_context_tests.py @@ -29,6 +29,8 @@ import azure.cosmos.base as base import test_config +pytestmark = pytest.mark.cosmosEmulator + #IMPORTANT NOTES: # Most test cases in this file create collections in your Azure Cosmos account. diff --git a/sdk/cosmos/azure-cosmos/test/query_tests.py b/sdk/cosmos/azure-cosmos/test/query_tests.py index c51fe5410be5..f5b5935f68a6 100644 --- a/sdk/cosmos/azure-cosmos/test/query_tests.py +++ b/sdk/cosmos/azure-cosmos/test/query_tests.py @@ -5,6 +5,8 @@ import azure.cosmos.documents as documents import test_config +pytestmark = pytest.mark.cosmosEmulator + @pytest.mark.usefixtures("teardown") class QueryTest(unittest.TestCase): """Test to ensure escaping of non-ascii characters from partition key""" @@ -13,8 +15,18 @@ class QueryTest(unittest.TestCase): host = config.host masterKey = config.masterKey connectionPolicy = config.connectionPolicy - client = cosmos_client.CosmosClient(host, {'masterKey': masterKey}, connectionPolicy) - created_db = config.create_database_if_not_exist(client) + + @classmethod + def setUpClass(cls): + if (cls.masterKey == '[YOUR_KEY_HERE]' or + cls.host == '[YOUR_ENDPOINT_HERE]'): + raise Exception( + "You must specify your Azure Cosmos account values for " + "'masterKey' and 'host' at the top of this class to run the " + "tests.") + + cls.client = cosmos_client.CosmosClient(cls.host, {'masterKey': cls.masterKey}, cls.connectionPolicy) + cls.created_db = cls.config.create_database_if_not_exist(cls.client) def test_first_and_last_slashes_trimmed_for_query_string (self): created_collection = self.config.create_multi_partition_collection_with_custom_pk_if_not_exist(self.client) diff --git a/sdk/cosmos/azure-cosmos/test/retry_policy_tests.py b/sdk/cosmos/azure-cosmos/test/retry_policy_tests.py index ad12b9ac2414..3d466bcc449d 100644 --- a/sdk/cosmos/azure-cosmos/test/retry_policy_tests.py +++ b/sdk/cosmos/azure-cosmos/test/retry_policy_tests.py @@ -30,6 +30,7 @@ import azure.cosmos.retry_utility as retry_utility import test_config +pytestmark = pytest.mark.cosmosEmulator #IMPORTANT NOTES: diff --git a/sdk/cosmos/azure-cosmos/test/routing/collection_routing_map_test.py b/sdk/cosmos/azure-cosmos/test/routing/collection_routing_map_test.py index bc86c28be036..ae5fa2c011af 100644 --- a/sdk/cosmos/azure-cosmos/test/routing/collection_routing_map_test.py +++ b/sdk/cosmos/azure-cosmos/test/routing/collection_routing_map_test.py @@ -25,6 +25,8 @@ import azure.cosmos.routing.routing_range as routing_range from azure.cosmos.routing.routing_map_provider import _PartitionKeyRangeCache +pytestmark = pytest.mark.cosmosEmulator + @pytest.mark.usefixtures("teardown") class CollectionRoutingMapTests(unittest.TestCase): diff --git a/sdk/cosmos/azure-cosmos/test/routing/routing_map_provider_tests.py b/sdk/cosmos/azure-cosmos/test/routing/routing_map_provider_tests.py index 66ff18840473..50c88892ba3a 100644 --- a/sdk/cosmos/azure-cosmos/test/routing/routing_map_provider_tests.py +++ b/sdk/cosmos/azure-cosmos/test/routing/routing_map_provider_tests.py @@ -25,6 +25,8 @@ from azure.cosmos.routing.routing_map_provider import _CollectionRoutingMap from azure.cosmos.routing import routing_range as routing_range +pytestmark = pytest.mark.cosmosEmulator + @pytest.mark.usefixtures("teardown") class RoutingMapProviderTests(unittest.TestCase): diff --git a/sdk/cosmos/azure-cosmos/test/routing_map_tests.py b/sdk/cosmos/azure-cosmos/test/routing_map_tests.py index 3c1b9843164c..4271db674461 100644 --- a/sdk/cosmos/azure-cosmos/test/routing_map_tests.py +++ b/sdk/cosmos/azure-cosmos/test/routing_map_tests.py @@ -27,6 +27,8 @@ from azure.cosmos.routing import routing_range as routing_range import test_config +pytestmark = pytest.mark.cosmosEmulator + #IMPORTANT NOTES: # Most test cases in this file create collections in your Azure Cosmos account. @@ -43,8 +45,6 @@ class RoutingMapEndToEndTests(unittest.TestCase): host = test_config._test_config.host masterKey = test_config._test_config.masterKey connectionPolicy = test_config._test_config.connectionPolicy - client = cosmos_client.CosmosClient(host, {'masterKey': masterKey}, connectionPolicy) - collection_link = test_config._test_config.create_multi_partition_collection_with_custom_pk_if_not_exist(client)['_self'] @classmethod def setUpClass(cls): @@ -54,6 +54,9 @@ def setUpClass(cls): "You must specify your Azure Cosmos account values for " "'masterKey' and 'host' at the top of this class to run the " "tests.") + + cls.client = cosmos_client.CosmosClient(cls.host, {'masterKey': cls.masterKey}, cls.connectionPolicy) + cls.collection_link = test_config._test_config.create_multi_partition_collection_with_custom_pk_if_not_exist(cls.client)['_self'] def test_read_partition_key_ranges(self): partition_key_ranges = list(self.client._ReadPartitionKeyRanges(self.collection_link)) diff --git a/sdk/cosmos/azure-cosmos/test/ru_per_min_tests.py b/sdk/cosmos/azure-cosmos/test/ru_per_min_tests.py index d7a89398dd75..3c076a2c0b4c 100644 --- a/sdk/cosmos/azure-cosmos/test/ru_per_min_tests.py +++ b/sdk/cosmos/azure-cosmos/test/ru_per_min_tests.py @@ -28,6 +28,8 @@ import azure.cosmos.base as base import test_config +pytestmark = pytest.mark.cosmosEmulator + # IMPORTANT NOTES: # Most test cases in this file create collections in your Azure Cosmos @@ -47,8 +49,6 @@ class RuPerMinTests(unittest.TestCase): host = test_config._test_config.host masterKey = test_config._test_config.masterKey connectionPolicy = test_config._test_config.connectionPolicy - client = cosmos_client.CosmosClient(host, {'masterKey': masterKey}, connectionPolicy) - created_db = test_config._test_config.create_database_if_not_exist(client) @classmethod def setUpClass(cls): @@ -61,6 +61,9 @@ def setUpClass(cls): "'masterKey' and 'host' at the top of this class to run the " "tests.") + cls.client = cosmos_client.CosmosClient(cls.host, {'masterKey': cls.masterKey}, cls.connectionPolicy) + cls.created_db = test_config._test_config.create_database_if_not_exist(cls.client) + def _query_offers(self, collection_self_link): offers = list(self.client.ReadOffers()) for o in offers: diff --git a/sdk/cosmos/azure-cosmos/test/session_container_tests.py b/sdk/cosmos/azure-cosmos/test/session_container_tests.py index 743bb2f372c5..e109d193f205 100644 --- a/sdk/cosmos/azure-cosmos/test/session_container_tests.py +++ b/sdk/cosmos/azure-cosmos/test/session_container_tests.py @@ -32,6 +32,8 @@ import azure.cosmos.session as session import test_config +pytestmark = pytest.mark.cosmosEmulator + @pytest.mark.usefixtures("teardown") class Test_session_container(unittest.TestCase): # this test doesn't need real credentials, or connection to server diff --git a/sdk/cosmos/azure-cosmos/test/session_tests.py b/sdk/cosmos/azure-cosmos/test/session_tests.py index 72ee0379b55c..13f8eefa8adf 100644 --- a/sdk/cosmos/azure-cosmos/test/session_tests.py +++ b/sdk/cosmos/azure-cosmos/test/session_tests.py @@ -12,6 +12,8 @@ import azure.cosmos.synchronized_request as synchronized_request import azure.cosmos.retry_utility as retry_utility +pytestmark = pytest.mark.cosmosEmulator + @pytest.mark.usefixtures("teardown") class SessionTests(unittest.TestCase): """Test to ensure escaping of non-ascii characters from partition key""" @@ -19,8 +21,20 @@ class SessionTests(unittest.TestCase): host = test_config._test_config.host masterKey = test_config._test_config.masterKey connectionPolicy = test_config._test_config.connectionPolicy - client = cosmos_client.CosmosClient(host, {'masterKey': masterKey}, connectionPolicy) - created_collection = test_config._test_config.create_multi_partition_collection_with_custom_pk_if_not_exist(client) + + @classmethod + def setUpClass(cls): + # creates the database, collection, and insert all the documents + # we will gain some speed up in running the tests by creating the + # database, collection and inserting all the docs only once + + if (cls.masterKey == '[YOUR_KEY_HERE]' or cls.host == '[YOUR_ENDPOINT_HERE]'): + raise Exception("You must specify your Azure Cosmos account values for " + "'masterKey' and 'host' at the top of this class to run the " + "tests.") + + cls.client = cosmos_client.CosmosClient(cls.host, {'masterKey': cls.masterKey}, cls.connectionPolicy) + cls.created_collection = test_config._test_config.create_multi_partition_collection_with_custom_pk_if_not_exist(cls.client) def _MockRequest(self, global_endpoint_manager, request, connection_policy, requests_session, path, request_options, request_body): if HttpHeaders.SessionToken in request_options['headers']: diff --git a/sdk/cosmos/azure-cosmos/test/session_token_unit_tests.py b/sdk/cosmos/azure-cosmos/test/session_token_unit_tests.py index 003fc0f5644b..0af36a475dda 100644 --- a/sdk/cosmos/azure-cosmos/test/session_token_unit_tests.py +++ b/sdk/cosmos/azure-cosmos/test/session_token_unit_tests.py @@ -5,6 +5,8 @@ from azure.cosmos.vector_session_token import VectorSessionToken from azure.cosmos.errors import CosmosError +pytestmark = pytest.mark.cosmosEmulator + @pytest.mark.usefixtures("teardown") class SessionTokenUnitTest(unittest.TestCase): """Test to ensure escaping of non-ascii characters from partition key""" diff --git a/sdk/cosmos/azure-cosmos/test/streaming_failover_test.py b/sdk/cosmos/azure-cosmos/test/streaming_failover_test.py index 65b1c45fff86..15c330cd417f 100644 --- a/sdk/cosmos/azure-cosmos/test/streaming_failover_test.py +++ b/sdk/cosmos/azure-cosmos/test/streaming_failover_test.py @@ -11,6 +11,8 @@ import azure.cosmos.global_endpoint_manager as global_endpoint_manager import azure.cosmos.http_constants as http_constants +pytestmark = pytest.mark.cosmosEmulator + @pytest.mark.usefixtures("teardown") class TestStreamingFailover(unittest.TestCase): diff --git a/sdk/cosmos/azure-cosmos/test/ttl_tests.py b/sdk/cosmos/azure-cosmos/test/ttl_tests.py index c0d07ebcc3b8..0890395e5197 100644 --- a/sdk/cosmos/azure-cosmos/test/ttl_tests.py +++ b/sdk/cosmos/azure-cosmos/test/ttl_tests.py @@ -29,6 +29,7 @@ from azure.cosmos.http_constants import StatusCodes import test_config +pytestmark = pytest.mark.cosmosEmulator #IMPORTANT NOTES: @@ -46,8 +47,6 @@ class Test_ttl_tests(unittest.TestCase): host = test_config._test_config.host masterKey = test_config._test_config.masterKey connectionPolicy = test_config._test_config.connectionPolicy - client = cosmos_client.CosmosClient(host, {'masterKey': masterKey}, connectionPolicy) - created_db = test_config._test_config.create_database_if_not_exist(client) def __AssertHTTPFailureWithStatus(self, status_code, func, *args, **kwargs): """Assert HTTP failure with status. @@ -70,6 +69,8 @@ def setUpClass(cls): "You must specify your Azure Cosmos account values for " "'masterKey' and 'host' at the top of this class to run the " "tests.") + cls.client = cosmos_client.CosmosClient(cls.host, {'masterKey': cls.masterKey}, cls.connectionPolicy) + cls.created_db = test_config._test_config.create_database_if_not_exist(cls.client) def test_collection_and_document_ttl_values(self): collection_definition = {'id' : 'test_collection_and_document_ttl_values1' + str(uuid.uuid4()), diff --git a/sdk/cosmos/azure-cosmos/test/utils_tests.py b/sdk/cosmos/azure-cosmos/test/utils_tests.py index 7332ae5c696c..0dc7d7b8315a 100644 --- a/sdk/cosmos/azure-cosmos/test/utils_tests.py +++ b/sdk/cosmos/azure-cosmos/test/utils_tests.py @@ -25,6 +25,8 @@ import platform import azure.cosmos.http_constants as http_constants +pytestmark = pytest.mark.cosmosEmulator + @pytest.mark.usefixtures("teardown") class UtilsTests(unittest.TestCase): """Utils Tests diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/HISTORY.rst b/sdk/cosmos/azure-mgmt-cosmosdb/HISTORY.rst index 22fbd73029cd..584cff5df350 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/HISTORY.rst +++ b/sdk/cosmos/azure-mgmt-cosmosdb/HISTORY.rst @@ -3,6 +3,30 @@ Release History =============== +0.7.0 (2019-06-07) +++++++++++++++++++ + +**Features** + +- Added operation DatabaseAccountsOperations.get_gremlin_graph_throughput +- Added operation DatabaseAccountsOperations.get_sql_database_throughput +- Added operation DatabaseAccountsOperations.update_gremlin_database_throughput +- Added operation DatabaseAccountsOperations.get_sql_container_throughput +- Added operation DatabaseAccountsOperations.update_sql_container_throughput +- Added operation DatabaseAccountsOperations.get_gremlin_database_throughput +- Added operation DatabaseAccountsOperations.get_cassandra_table_throughput +- Added operation DatabaseAccountsOperations.update_cassandra_keyspace_throughput +- Added operation DatabaseAccountsOperations.update_mongo_db_collection_throughput +- Added operation DatabaseAccountsOperations.update_cassandra_table_throughput +- Added operation DatabaseAccountsOperations.update_table_throughput +- Added operation DatabaseAccountsOperations.update_mongo_db_database_throughput +- Added operation DatabaseAccountsOperations.get_mongo_db_database_throughput +- Added operation DatabaseAccountsOperations.update_sql_database_throughput +- Added operation DatabaseAccountsOperations.get_table_throughput +- Added operation DatabaseAccountsOperations.get_mongo_db_collection_throughput +- Added operation DatabaseAccountsOperations.update_gremlin_graph_throughput +- Added operation DatabaseAccountsOperations.get_cassandra_keyspace_throughput + 0.6.1 (2019-05-31) ++++++++++++++++++ diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py index fdad0dbc2e3d..a3cc095a4f19 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py @@ -38,6 +38,7 @@ from .region_for_online_offline_py3 import RegionForOnlineOffline from .resource_py3 import Resource from .extended_resource_properties_py3 import ExtendedResourceProperties + from .throughput_py3 import Throughput from .database_account_create_update_parameters_py3 import DatabaseAccountCreateUpdateParameters from .database_account_patch_parameters_py3 import DatabaseAccountPatchParameters from .database_account_list_read_only_keys_result_py3 import DatabaseAccountListReadOnlyKeysResult @@ -45,6 +46,8 @@ from .database_account_connection_string_py3 import DatabaseAccountConnectionString from .database_account_list_connection_strings_result_py3 import DatabaseAccountListConnectionStringsResult from .database_account_regenerate_key_parameters_py3 import DatabaseAccountRegenerateKeyParameters + from .throughput_resource_py3 import ThroughputResource + from .throughput_update_parameters_py3 import ThroughputUpdateParameters from .sql_database_resource_py3 import SqlDatabaseResource from .sql_database_create_update_parameters_py3 import SqlDatabaseCreateUpdateParameters from .sql_container_resource_py3 import SqlContainerResource @@ -111,6 +114,7 @@ from .region_for_online_offline import RegionForOnlineOffline from .resource import Resource from .extended_resource_properties import ExtendedResourceProperties + from .throughput import Throughput from .database_account_create_update_parameters import DatabaseAccountCreateUpdateParameters from .database_account_patch_parameters import DatabaseAccountPatchParameters from .database_account_list_read_only_keys_result import DatabaseAccountListReadOnlyKeysResult @@ -118,6 +122,8 @@ from .database_account_connection_string import DatabaseAccountConnectionString from .database_account_list_connection_strings_result import DatabaseAccountListConnectionStringsResult from .database_account_regenerate_key_parameters import DatabaseAccountRegenerateKeyParameters + from .throughput_resource import ThroughputResource + from .throughput_update_parameters import ThroughputUpdateParameters from .sql_database_resource import SqlDatabaseResource from .sql_database_create_update_parameters import SqlDatabaseCreateUpdateParameters from .sql_container_resource import SqlContainerResource @@ -215,6 +221,7 @@ 'RegionForOnlineOffline', 'Resource', 'ExtendedResourceProperties', + 'Throughput', 'DatabaseAccountCreateUpdateParameters', 'DatabaseAccountPatchParameters', 'DatabaseAccountListReadOnlyKeysResult', @@ -222,6 +229,8 @@ 'DatabaseAccountConnectionString', 'DatabaseAccountListConnectionStringsResult', 'DatabaseAccountRegenerateKeyParameters', + 'ThroughputResource', + 'ThroughputUpdateParameters', 'SqlDatabaseResource', 'SqlDatabaseCreateUpdateParameters', 'SqlContainerResource', diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput.py new file mode 100644 index 000000000000..40aa89e8adce --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput.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 .resource import Resource + + +class Throughput(Resource): + """An Azure Cosmos DB resource throughput. + + 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 unique resource identifier of the database account. + :vartype id: str + :ivar name: The name of the database account. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param throughput: Required. Value of the Cosmos DB resource throughput + :type throughput: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'throughput': {'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}'}, + 'throughput': {'key': 'properties.throughput', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Throughput, self).__init__(**kwargs) + self.throughput = kwargs.get('throughput', None) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_py3.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_py3.py new file mode 100644 index 000000000000..6ed7d4252424 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_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 .resource_py3 import Resource + + +class Throughput(Resource): + """An Azure Cosmos DB resource throughput. + + 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 unique resource identifier of the database account. + :vartype id: str + :ivar name: The name of the database account. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource + belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param throughput: Required. Value of the Cosmos DB resource throughput + :type throughput: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'throughput': {'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}'}, + 'throughput': {'key': 'properties.throughput', 'type': 'int'}, + } + + def __init__(self, *, throughput: int, location: str=None, tags=None, **kwargs) -> None: + super(Throughput, self).__init__(location=location, tags=tags, **kwargs) + self.throughput = throughput diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_resource.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_resource.py new file mode 100644 index 000000000000..e3a44627755c --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_resource.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 ThroughputResource(Model): + """Cosmos DB resource throughput object. + + All required parameters must be populated in order to send to Azure. + + :param throughput: Required. Value of the Cosmos DB resource throughput + :type throughput: int + """ + + _validation = { + 'throughput': {'required': True}, + } + + _attribute_map = { + 'throughput': {'key': 'throughput', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ThroughputResource, self).__init__(**kwargs) + self.throughput = kwargs.get('throughput', None) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_resource_py3.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_resource_py3.py new file mode 100644 index 000000000000..e44bb9b13544 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_resource_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 ThroughputResource(Model): + """Cosmos DB resource throughput object. + + All required parameters must be populated in order to send to Azure. + + :param throughput: Required. Value of the Cosmos DB resource throughput + :type throughput: int + """ + + _validation = { + 'throughput': {'required': True}, + } + + _attribute_map = { + 'throughput': {'key': 'throughput', 'type': 'int'}, + } + + def __init__(self, *, throughput: int, **kwargs) -> None: + super(ThroughputResource, self).__init__(**kwargs) + self.throughput = throughput diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_update_parameters.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_update_parameters.py new file mode 100644 index 000000000000..8a1e3aa91df1 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_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 ThroughputUpdateParameters(Model): + """Parameters to update Cosmos DB resource throughput. + + All required parameters must be populated in order to send to Azure. + + :param resource: Required. The standard JSON format of a resource + throughput + :type resource: ~azure.mgmt.cosmosdb.models.ThroughputResource + """ + + _validation = { + 'resource': {'required': True}, + } + + _attribute_map = { + 'resource': {'key': 'properties.resource', 'type': 'ThroughputResource'}, + } + + def __init__(self, **kwargs): + super(ThroughputUpdateParameters, self).__init__(**kwargs) + self.resource = kwargs.get('resource', None) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_update_parameters_py3.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_update_parameters_py3.py new file mode 100644 index 000000000000..9a7f4f1f3f01 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/throughput_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 ThroughputUpdateParameters(Model): + """Parameters to update Cosmos DB resource throughput. + + All required parameters must be populated in order to send to Azure. + + :param resource: Required. The standard JSON format of a resource + throughput + :type resource: ~azure.mgmt.cosmosdb.models.ThroughputResource + """ + + _validation = { + 'resource': {'required': True}, + } + + _attribute_map = { + 'resource': {'key': 'properties.resource', 'type': 'ThroughputResource'}, + } + + def __init__(self, *, resource, **kwargs) -> None: + super(ThroughputUpdateParameters, self).__init__(**kwargs) + self.resource = resource diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_accounts_operations.py index b00dfdb99a2d..6c2b1f58d263 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_accounts_operations.py @@ -1491,7 +1491,7 @@ def internal_paging(next_link=None, raw=False): def get_sql_database( self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets the SQL databases under an existing Azure Cosmos DB database + """Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. :param resource_group_name: Name of an Azure resource group. @@ -1748,6 +1748,178 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete_sql_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}'} + def get_sql_database_throughput( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets the RUs per second of the SQL database under an existing Azure + Cosmos DB database account with the provided name. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_name: Cosmos DB database name. + :type database_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: Throughput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.Throughput or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_sql_database_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseName': self._serialize.url("database_name", database_name, '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Throughput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_sql_database_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/settings/throughput'} + + + def _update_sql_database_throughput_initial( + self, resource_group_name, account_name, database_name, resource, custom_headers=None, raw=False, **operation_config): + update_throughput_parameters = models.ThroughputUpdateParameters(resource=resource) + + # Construct URL + url = self.update_sql_database_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseName': self._serialize.url("database_name", database_name, '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['Accept'] = 'application/json' + 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(update_throughput_parameters, 'ThroughputUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Throughput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_sql_database_throughput( + self, resource_group_name, account_name, database_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Update RUs per second of an Azure Cosmos DB SQL database. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_name: Cosmos DB database name. + :type database_name: str + :param resource: The standard JSON format of a resource throughput + :type resource: ~azure.mgmt.cosmosdb.models.ThroughputResource + :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 Throughput or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.Throughput] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.Throughput]] + :raises: :class:`CloudError` + """ + raw_result = self._update_sql_database_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + resource=resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Throughput', 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_sql_database_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/settings/throughput'} + def list_sql_containers( self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): """Lists the SQL container under an existing Azure Cosmos DB database @@ -2092,81 +2264,10 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete_sql_container.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}'} - def list_mongo_db_databases( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the MongoDB databases under an existing Azure Cosmos DB database - account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. - :type account_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 MongoDBDatabase - :rtype: - ~azure.mgmt.cosmosdb.models.MongoDBDatabasePaged[~azure.mgmt.cosmosdb.models.MongoDBDatabase] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_mongo_db_databases.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.MongoDBDatabasePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.MongoDBDatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_mongo_db_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases'} - - def get_mongo_db_database( - self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets the MongoDB databases under an existing Azure Cosmos DB database - account with the provided name. + def get_sql_container_throughput( + self, resource_group_name, account_name, database_name, container_name, custom_headers=None, raw=False, **operation_config): + """Gets the RUs per second of the SQL container under an existing Azure + Cosmos DB database account. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str @@ -2174,23 +2275,26 @@ def get_mongo_db_database( :type account_name: str :param database_name: Cosmos DB database name. :type database_name: str + :param container_name: Cosmos DB container name. + :type container_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: MongoDBDatabase or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cosmosdb.models.MongoDBDatabase or + :return: Throughput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.Throughput or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_mongo_db_database.metadata['url'] + url = self.get_sql_container_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'databaseName': self._serialize.url("database_name", database_name, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2220,27 +2324,28 @@ def get_mongo_db_database( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('MongoDBDatabase', response) + deserialized = self._deserialize('Throughput', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_mongo_db_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}'} + get_sql_container_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}/settings/throughput'} - def _create_update_mongo_db_database_initial( - self, resource_group_name, account_name, database_name, resource, options, custom_headers=None, raw=False, **operation_config): - create_update_mongo_db_database_parameters = models.MongoDBDatabaseCreateUpdateParameters(resource=resource, options=options) + def _update_sql_container_throughput_initial( + self, resource_group_name, account_name, database_name, container_name, resource, custom_headers=None, raw=False, **operation_config): + update_throughput_parameters = models.ThroughputUpdateParameters(resource=resource) # Construct URL - url = self.create_update_mongo_db_database.metadata['url'] + url = self.update_sql_container_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'databaseName': self._serialize.url("database_name", database_name, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2260,7 +2365,7 @@ def _create_update_mongo_db_database_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(create_update_mongo_db_database_parameters, 'MongoDBDatabaseCreateUpdateParameters') + body_content = self._serialize.body(update_throughput_parameters, 'ThroughputUpdateParameters') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -2274,7 +2379,7 @@ def _create_update_mongo_db_database_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('MongoDBDatabase', response) + deserialized = self._deserialize('Throughput', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -2282,9 +2387,9 @@ def _create_update_mongo_db_database_initial( return deserialized - def create_update_mongo_db_database( - self, resource_group_name, account_name, database_name, resource, options, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or updates Azure Cosmos DB MongoDB database. + def update_sql_container_throughput( + self, resource_group_name, account_name, database_name, container_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str @@ -2292,37 +2397,36 @@ def create_update_mongo_db_database( :type account_name: str :param database_name: Cosmos DB database name. :type database_name: str - :param resource: The standard JSON format of a MongoDB database - :type resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseResource - :param options: A key-value pair of options to be applied for the - request. This corresponds to the headers sent with the request. - :type options: dict[str, str] + :param container_name: Cosmos DB container name. + :type container_name: str + :param resource: The standard JSON format of a resource throughput + :type resource: ~azure.mgmt.cosmosdb.models.ThroughputResource :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 MongoDBDatabase or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns Throughput or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.MongoDBDatabase] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.Throughput] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.MongoDBDatabase]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.Throughput]] :raises: :class:`CloudError` """ - raw_result = self._create_update_mongo_db_database_initial( + raw_result = self._update_sql_container_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, + container_name=container_name, resource=resource, - options=options, custom_headers=custom_headers, raw=True, **operation_config ) def get_long_running_output(response): - deserialized = self._deserialize('MongoDBDatabase', response) + deserialized = self._deserialize('Throughput', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -2337,122 +2441,36 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_update_mongo_db_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}'} - - - def _delete_mongo_db_database_initial( - self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete_mongo_db_database.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'databaseName': self._serialize.url("database_name", database_name, '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 = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [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_mongo_db_database( - self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes an existing Azure Cosmos DB MongoDB database. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. - :type account_name: str - :param database_name: Cosmos DB database name. - :type database_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_mongo_db_database_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_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_mongo_db_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}'} + update_sql_container_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}/settings/throughput'} - def list_mongo_db_collections( - self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): - """Lists the MongoDB collection under an existing Azure Cosmos DB database + def list_mongo_db_databases( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the MongoDB databases under an existing Azure Cosmos DB database account. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str :param account_name: Cosmos DB database account name. :type account_name: str - :param database_name: Cosmos DB database name. - :type database_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 MongoDBCollection + :return: An iterator like instance of MongoDBDatabase :rtype: - ~azure.mgmt.cosmosdb.models.MongoDBCollectionPaged[~azure.mgmt.cosmosdb.models.MongoDBCollection] + ~azure.mgmt.cosmosdb.models.MongoDBDatabasePaged[~azure.mgmt.cosmosdb.models.MongoDBDatabase] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_mongo_db_collections.metadata['url'] + url = self.list_mongo_db_databases.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'databaseName': self._serialize.url("database_name", database_name, 'str') + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) } url = self._client.format_url(url, **path_format_arguments) @@ -2486,20 +2504,20 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.MongoDBCollectionPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.MongoDBDatabasePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.MongoDBCollectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.MongoDBDatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_mongo_db_collections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections'} + list_mongo_db_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases'} - def get_mongo_db_collection( - self, resource_group_name, account_name, database_name, collection_name, custom_headers=None, raw=False, **operation_config): - """Gets the MongoDB collection under an existing Azure Cosmos DB database - account. + def get_mongo_db_database( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets the MongoDB databases under an existing Azure Cosmos DB database + account with the provided name. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str @@ -2507,26 +2525,23 @@ def get_mongo_db_collection( :type account_name: str :param database_name: Cosmos DB database name. :type database_name: str - :param collection_name: Cosmos DB collection name. - :type collection_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: MongoDBCollection or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cosmosdb.models.MongoDBCollection or + :return: MongoDBDatabase or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.MongoDBDatabase or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_mongo_db_collection.metadata['url'] + url = self.get_mongo_db_database.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'collectionName': self._serialize.url("collection_name", collection_name, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2556,28 +2571,27 @@ def get_mongo_db_collection( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('MongoDBCollection', response) + deserialized = self._deserialize('MongoDBDatabase', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_mongo_db_collection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}'} + get_mongo_db_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}'} - def _create_update_mongo_db_collection_initial( - self, resource_group_name, account_name, database_name, collection_name, resource, options, custom_headers=None, raw=False, **operation_config): - create_update_mongo_db_collection_parameters = models.MongoDBCollectionCreateUpdateParameters(resource=resource, options=options) + def _create_update_mongo_db_database_initial( + self, resource_group_name, account_name, database_name, resource, options, custom_headers=None, raw=False, **operation_config): + create_update_mongo_db_database_parameters = models.MongoDBDatabaseCreateUpdateParameters(resource=resource, options=options) # Construct URL - url = self.create_update_mongo_db_collection.metadata['url'] + url = self.create_update_mongo_db_database.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'collectionName': self._serialize.url("collection_name", collection_name, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2597,7 +2611,7 @@ def _create_update_mongo_db_collection_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(create_update_mongo_db_collection_parameters, 'MongoDBCollectionCreateUpdateParameters') + body_content = self._serialize.body(create_update_mongo_db_database_parameters, 'MongoDBDatabaseCreateUpdateParameters') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -2611,7 +2625,7 @@ def _create_update_mongo_db_collection_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('MongoDBCollection', response) + deserialized = self._deserialize('MongoDBDatabase', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -2619,9 +2633,9 @@ def _create_update_mongo_db_collection_initial( return deserialized - def create_update_mongo_db_collection( - self, resource_group_name, account_name, database_name, collection_name, resource, options, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update an Azure Cosmos DB MongoDB Collection. + def create_update_mongo_db_database( + self, resource_group_name, account_name, database_name, resource, options, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or updates Azure Cosmos DB MongoDB database. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str @@ -2629,10 +2643,8 @@ def create_update_mongo_db_collection( :type account_name: str :param database_name: Cosmos DB database name. :type database_name: str - :param collection_name: Cosmos DB collection name. - :type collection_name: str - :param resource: The standard JSON format of a MongoDB collection - :type resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionResource + :param resource: The standard JSON format of a MongoDB database + :type resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseResource :param options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :type options: dict[str, str] @@ -2641,19 +2653,18 @@ def create_update_mongo_db_collection( 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 MongoDBCollection or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns MongoDBDatabase or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.MongoDBCollection] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.MongoDBDatabase] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.MongoDBCollection]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.MongoDBDatabase]] :raises: :class:`CloudError` """ - raw_result = self._create_update_mongo_db_collection_initial( + raw_result = self._create_update_mongo_db_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - collection_name=collection_name, resource=resource, options=options, custom_headers=custom_headers, @@ -2662,7 +2673,7 @@ def create_update_mongo_db_collection( ) def get_long_running_output(response): - deserialized = self._deserialize('MongoDBCollection', response) + deserialized = self._deserialize('MongoDBDatabase', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -2677,19 +2688,18 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_update_mongo_db_collection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}'} + create_update_mongo_db_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}'} - def _delete_mongo_db_collection_initial( - self, resource_group_name, account_name, database_name, collection_name, custom_headers=None, raw=False, **operation_config): + def _delete_mongo_db_database_initial( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.delete_mongo_db_collection.metadata['url'] + url = self.delete_mongo_db_database.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'collectionName': self._serialize.url("collection_name", collection_name, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2719,9 +2729,9 @@ def _delete_mongo_db_collection_initial( client_raw_response = ClientRawResponse(None, response) return client_raw_response - def delete_mongo_db_collection( - self, resource_group_name, account_name, database_name, collection_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes an existing Azure Cosmos DB MongoDB Collection. + def delete_mongo_db_database( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing Azure Cosmos DB MongoDB database. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str @@ -2729,8 +2739,6 @@ def delete_mongo_db_collection( :type account_name: str :param database_name: Cosmos DB database name. :type database_name: str - :param collection_name: Cosmos DB collection name. - :type collection_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 @@ -2742,11 +2750,10 @@ def delete_mongo_db_collection( ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ - raw_result = self._delete_mongo_db_collection_initial( + raw_result = self._delete_mongo_db_database_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - collection_name=collection_name, custom_headers=custom_headers, raw=True, **operation_config @@ -2764,55 +2771,1757 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete_mongo_db_collection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}'} + delete_mongo_db_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}'} - def list_tables( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the Tables under an existing Azure Cosmos DB database account. + def get_mongo_db_database_throughput( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets the RUs per second of the MongoDB database under an existing Azure + Cosmos DB database account with the provided name. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str :param account_name: Cosmos DB database account name. :type account_name: str + :param database_name: Cosmos DB database name. + :type database_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 Table - :rtype: - ~azure.mgmt.cosmosdb.models.TablePaged[~azure.mgmt.cosmosdb.models.Table] + :return: Throughput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.Throughput or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_tables.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) - } - url = self._client.format_url(url, **path_format_arguments) + # Construct URL + url = self.get_mongo_db_database_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseName': self._serialize.url("database_name", database_name, '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 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['Accept'] = 'application/json' + 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 headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) + response = self._client.send(request, 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('Throughput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_mongo_db_database_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/settings/throughput'} + + + def _update_mongo_db_database_throughput_initial( + self, resource_group_name, account_name, database_name, resource, custom_headers=None, raw=False, **operation_config): + update_throughput_parameters = models.ThroughputUpdateParameters(resource=resource) + + # Construct URL + url = self.update_mongo_db_database_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseName': self._serialize.url("database_name", database_name, '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['Accept'] = 'application/json' + 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(update_throughput_parameters, 'ThroughputUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Throughput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_mongo_db_database_throughput( + self, resource_group_name, account_name, database_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Update RUs per second of the an Azure Cosmos DB MongoDB database. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_name: Cosmos DB database name. + :type database_name: str + :param resource: The standard JSON format of a resource throughput + :type resource: ~azure.mgmt.cosmosdb.models.ThroughputResource + :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 Throughput or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.Throughput] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.Throughput]] + :raises: :class:`CloudError` + """ + raw_result = self._update_mongo_db_database_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + resource=resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Throughput', 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_mongo_db_database_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/settings/throughput'} + + def list_mongo_db_collections( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): + """Lists the MongoDB collection under an existing Azure Cosmos DB database + account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_name: Cosmos DB database name. + :type database_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 MongoDBCollection + :rtype: + ~azure.mgmt.cosmosdb.models.MongoDBCollectionPaged[~azure.mgmt.cosmosdb.models.MongoDBCollection] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_mongo_db_collections.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseName': self._serialize.url("database_name", database_name, '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.MongoDBCollectionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MongoDBCollectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_mongo_db_collections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections'} + + def get_mongo_db_collection( + self, resource_group_name, account_name, database_name, collection_name, custom_headers=None, raw=False, **operation_config): + """Gets the MongoDB collection under an existing Azure Cosmos DB database + account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_name: Cosmos DB database name. + :type database_name: str + :param collection_name: Cosmos DB collection name. + :type collection_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: MongoDBCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.MongoDBCollection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_mongo_db_collection.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'collectionName': self._serialize.url("collection_name", collection_name, '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('MongoDBCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_mongo_db_collection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}'} + + + def _create_update_mongo_db_collection_initial( + self, resource_group_name, account_name, database_name, collection_name, resource, options, custom_headers=None, raw=False, **operation_config): + create_update_mongo_db_collection_parameters = models.MongoDBCollectionCreateUpdateParameters(resource=resource, options=options) + + # Construct URL + url = self.create_update_mongo_db_collection.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'collectionName': self._serialize.url("collection_name", collection_name, '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['Accept'] = 'application/json' + 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(create_update_mongo_db_collection_parameters, 'MongoDBCollectionCreateUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('MongoDBCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_update_mongo_db_collection( + self, resource_group_name, account_name, database_name, collection_name, resource, options, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update an Azure Cosmos DB MongoDB Collection. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_name: Cosmos DB database name. + :type database_name: str + :param collection_name: Cosmos DB collection name. + :type collection_name: str + :param resource: The standard JSON format of a MongoDB collection + :type resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionResource + :param options: A key-value pair of options to be applied for the + request. This corresponds to the headers sent with the request. + :type options: 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 MongoDBCollection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.MongoDBCollection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.MongoDBCollection]] + :raises: :class:`CloudError` + """ + raw_result = self._create_update_mongo_db_collection_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + collection_name=collection_name, + resource=resource, + options=options, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('MongoDBCollection', 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_update_mongo_db_collection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}'} + + + def _delete_mongo_db_collection_initial( + self, resource_group_name, account_name, database_name, collection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_mongo_db_collection.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'collectionName': self._serialize.url("collection_name", collection_name, '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 = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [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_mongo_db_collection( + self, resource_group_name, account_name, database_name, collection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing Azure Cosmos DB MongoDB Collection. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_name: Cosmos DB database name. + :type database_name: str + :param collection_name: Cosmos DB collection name. + :type collection_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_mongo_db_collection_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + collection_name=collection_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_mongo_db_collection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}'} + + def get_mongo_db_collection_throughput( + self, resource_group_name, account_name, database_name, collection_name, custom_headers=None, raw=False, **operation_config): + """Gets the RUs per second of the MongoDB collection under an existing + Azure Cosmos DB database account with the provided name. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_name: Cosmos DB database name. + :type database_name: str + :param collection_name: Cosmos DB collection name. + :type collection_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: Throughput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.Throughput or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_mongo_db_collection_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'collectionName': self._serialize.url("collection_name", collection_name, '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Throughput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_mongo_db_collection_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}/settings/throughput'} + + + def _update_mongo_db_collection_throughput_initial( + self, resource_group_name, account_name, database_name, collection_name, resource, custom_headers=None, raw=False, **operation_config): + update_throughput_parameters = models.ThroughputUpdateParameters(resource=resource) + + # Construct URL + url = self.update_mongo_db_collection_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'collectionName': self._serialize.url("collection_name", collection_name, '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['Accept'] = 'application/json' + 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(update_throughput_parameters, 'ThroughputUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Throughput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_mongo_db_collection_throughput( + self, resource_group_name, account_name, database_name, collection_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the RUs per second of an Azure Cosmos DB MongoDB collection. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_name: Cosmos DB database name. + :type database_name: str + :param collection_name: Cosmos DB collection name. + :type collection_name: str + :param resource: The standard JSON format of a resource throughput + :type resource: ~azure.mgmt.cosmosdb.models.ThroughputResource + :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 Throughput or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.Throughput] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.Throughput]] + :raises: :class:`CloudError` + """ + raw_result = self._update_mongo_db_collection_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + collection_name=collection_name, + resource=resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Throughput', 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_mongo_db_collection_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}/settings/throughput'} + + def list_tables( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the Tables under an existing Azure Cosmos DB database account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_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 Table + :rtype: + ~azure.mgmt.cosmosdb.models.TablePaged[~azure.mgmt.cosmosdb.models.Table] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_tables.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) + } + 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.TablePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TablePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_tables.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables'} + + def get_table( + self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, **operation_config): + """Gets the Tables under an existing Azure Cosmos DB database account with + the provided name. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param table_name: Cosmos DB table name. + :type table_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: Table or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.Table or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_table.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'tableName': self._serialize.url("table_name", table_name, '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Table', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}'} + + + def _create_update_table_initial( + self, resource_group_name, account_name, table_name, resource, options, custom_headers=None, raw=False, **operation_config): + create_update_table_parameters = models.TableCreateUpdateParameters(resource=resource, options=options) + + # Construct URL + url = self.create_update_table.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'tableName': self._serialize.url("table_name", table_name, '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['Accept'] = 'application/json' + 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(create_update_table_parameters, 'TableCreateUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Table', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_update_table( + self, resource_group_name, account_name, table_name, resource, options, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update an Azure Cosmos DB Table. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param table_name: Cosmos DB table name. + :type table_name: str + :param resource: The standard JSON format of a Table + :type resource: ~azure.mgmt.cosmosdb.models.TableResource + :param options: A key-value pair of options to be applied for the + request. This corresponds to the headers sent with the request. + :type options: 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 Table or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.Table] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.Table]] + :raises: :class:`CloudError` + """ + raw_result = self._create_update_table_initial( + resource_group_name=resource_group_name, + account_name=account_name, + table_name=table_name, + resource=resource, + options=options, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Table', 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_update_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}'} + + + def _delete_table_initial( + self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_table.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'tableName': self._serialize.url("table_name", table_name, '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 = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [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_table( + self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing Azure Cosmos DB Table. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param table_name: Cosmos DB table name. + :type table_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_table_initial( + resource_group_name=resource_group_name, + account_name=account_name, + table_name=table_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_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}'} + + def get_table_throughput( + self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, **operation_config): + """Gets the RUs per second of the Table under an existing Azure Cosmos DB + database account with the provided name. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param table_name: Cosmos DB table name. + :type table_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: Throughput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.Throughput or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_table_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'tableName': self._serialize.url("table_name", table_name, '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Throughput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_table_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}/settings/throughput'} + + + def _update_table_throughput_initial( + self, resource_group_name, account_name, table_name, resource, custom_headers=None, raw=False, **operation_config): + update_throughput_parameters = models.ThroughputUpdateParameters(resource=resource) + + # Construct URL + url = self.update_table_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'tableName': self._serialize.url("table_name", table_name, '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['Accept'] = 'application/json' + 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(update_throughput_parameters, 'ThroughputUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Throughput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_table_throughput( + self, resource_group_name, account_name, table_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Update RUs per second of an Azure Cosmos DB Table. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param table_name: Cosmos DB table name. + :type table_name: str + :param resource: The standard JSON format of a resource throughput + :type resource: ~azure.mgmt.cosmosdb.models.ThroughputResource + :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 Throughput or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.Throughput] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.Throughput]] + :raises: :class:`CloudError` + """ + raw_result = self._update_table_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + table_name=table_name, + resource=resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Throughput', 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_table_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}/settings/throughput'} + + def list_cassandra_keyspaces( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the Cassandra keyspaces under an existing Azure Cosmos DB + database account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_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 CassandraKeyspace + :rtype: + ~azure.mgmt.cosmosdb.models.CassandraKeyspacePaged[~azure.mgmt.cosmosdb.models.CassandraKeyspace] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_cassandra_keyspaces.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) + } + 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.CassandraKeyspacePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CassandraKeyspacePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_cassandra_keyspaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces'} + + def get_cassandra_keyspace( + self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, **operation_config): + """Gets the Cassandra keyspaces under an existing Azure Cosmos DB database + account with the provided name. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_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: CassandraKeyspace or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.CassandraKeyspace or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_cassandra_keyspace.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('CassandraKeyspace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_cassandra_keyspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}'} + + + def _create_update_cassandra_keyspace_initial( + self, resource_group_name, account_name, keyspace_name, resource, options, custom_headers=None, raw=False, **operation_config): + create_update_cassandra_keyspace_parameters = models.CassandraKeyspaceCreateUpdateParameters(resource=resource, options=options) + + # Construct URL + url = self.create_update_cassandra_keyspace.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, '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['Accept'] = 'application/json' + 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(create_update_cassandra_keyspace_parameters, 'CassandraKeyspaceCreateUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('CassandraKeyspace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_update_cassandra_keyspace( + self, resource_group_name, account_name, keyspace_name, resource, options, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update an Azure Cosmos DB Cassandra keyspace. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param resource: The standard JSON format of a Cassandra keyspace + :type resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceResource + :param options: A key-value pair of options to be applied for the + request. This corresponds to the headers sent with the request. + :type options: 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 CassandraKeyspace or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.CassandraKeyspace] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.CassandraKeyspace]] + :raises: :class:`CloudError` + """ + raw_result = self._create_update_cassandra_keyspace_initial( + resource_group_name=resource_group_name, + account_name=account_name, + keyspace_name=keyspace_name, + resource=resource, + options=options, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CassandraKeyspace', 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_update_cassandra_keyspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}'} + + + def _delete_cassandra_keyspace_initial( + self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_cassandra_keyspace.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, '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 = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [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_cassandra_keyspace( + self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing Azure Cosmos DB Cassandra keyspace. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_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_cassandra_keyspace_initial( + resource_group_name=resource_group_name, + account_name=account_name, + keyspace_name=keyspace_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_cassandra_keyspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}'} + + def get_cassandra_keyspace_throughput( + self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, **operation_config): + """Gets the RUs per second of the Cassandra Keyspace under an existing + Azure Cosmos DB database account with the provided name. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_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: Throughput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.Throughput or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_cassandra_keyspace_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Throughput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_cassandra_keyspace_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/settings/throughput'} + + + def _update_cassandra_keyspace_throughput_initial( + self, resource_group_name, account_name, keyspace_name, resource, custom_headers=None, raw=False, **operation_config): + update_throughput_parameters = models.ThroughputUpdateParameters(resource=resource) + + # Construct URL + url = self.update_cassandra_keyspace_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, '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['Accept'] = 'application/json' + 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(update_throughput_parameters, 'ThroughputUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Throughput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_cassandra_keyspace_throughput( + self, resource_group_name, account_name, keyspace_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param resource: The standard JSON format of a resource throughput + :type resource: ~azure.mgmt.cosmosdb.models.ThroughputResource + :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 Throughput or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.Throughput] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.Throughput]] + :raises: :class:`CloudError` + """ + raw_result = self._update_cassandra_keyspace_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + keyspace_name=keyspace_name, + resource=resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Throughput', 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_cassandra_keyspace_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/settings/throughput'} + + def list_cassandra_tables( + self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, **operation_config): + """Lists the Cassandra table under an existing Azure Cosmos DB database + account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_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 CassandraTable + :rtype: + ~azure.mgmt.cosmosdb.models.CassandraTablePaged[~azure.mgmt.cosmosdb.models.CassandraTable] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_cassandra_tables.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) @@ -2826,25 +4535,27 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.TablePaged(internal_paging, self._deserialize.dependencies) + deserialized = models.CassandraTablePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.TablePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.CassandraTablePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_tables.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables'} + list_cassandra_tables.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables'} - def get_table( - self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, **operation_config): - """Gets the Tables under an existing Azure Cosmos DB database account with - the provided name. + def get_cassandra_table( + self, resource_group_name, account_name, keyspace_name, table_name, custom_headers=None, raw=False, **operation_config): + """Gets the Cassandra table under an existing Azure Cosmos DB database + account. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str :param account_name: Cosmos DB database account name. :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str :param table_name: Cosmos DB table name. :type table_name: str :param dict custom_headers: headers that will be added to the request @@ -2852,17 +4563,18 @@ def get_table( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: Table or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cosmosdb.models.Table or + :return: CassandraTable or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.CassandraTable or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_table.metadata['url'] + url = self.get_cassandra_table.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), 'tableName': self._serialize.url("table_name", table_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2893,26 +4605,27 @@ def get_table( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Table', response) + deserialized = self._deserialize('CassandraTable', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}'} - + get_cassandra_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}'} - def _create_update_table_initial( - self, resource_group_name, account_name, table_name, resource, options, custom_headers=None, raw=False, **operation_config): - create_update_table_parameters = models.TableCreateUpdateParameters(resource=resource, options=options) + + def _create_update_cassandra_table_initial( + self, resource_group_name, account_name, keyspace_name, table_name, resource, options, custom_headers=None, raw=False, **operation_config): + create_update_cassandra_table_parameters = models.CassandraTableCreateUpdateParameters(resource=resource, options=options) # Construct URL - url = self.create_update_table.metadata['url'] + url = self.create_update_cassandra_table.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), 'tableName': self._serialize.url("table_name", table_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -2933,7 +4646,7 @@ def _create_update_table_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(create_update_table_parameters, 'TableCreateUpdateParameters') + body_content = self._serialize.body(create_update_cassandra_table_parameters, 'CassandraTableCreateUpdateParameters') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -2947,7 +4660,7 @@ def _create_update_table_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Table', response) + deserialized = self._deserialize('CassandraTable', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -2955,18 +4668,20 @@ def _create_update_table_initial( return deserialized - def create_update_table( - self, resource_group_name, account_name, table_name, resource, options, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update an Azure Cosmos DB Table. + def create_update_cassandra_table( + self, resource_group_name, account_name, keyspace_name, table_name, resource, options, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update an Azure Cosmos DB Cassandra Table. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str :param account_name: Cosmos DB database account name. :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str :param table_name: Cosmos DB table name. :type table_name: str - :param resource: The standard JSON format of a Table - :type resource: ~azure.mgmt.cosmosdb.models.TableResource + :param resource: The standard JSON format of a Cassandra table + :type resource: ~azure.mgmt.cosmosdb.models.CassandraTableResource :param options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :type options: dict[str, str] @@ -2975,17 +4690,18 @@ def create_update_table( 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 Table or - ClientRawResponse
if raw==True + :return: An instance of LROPoller that returns CassandraTable or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.Table] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.CassandraTable] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.Table]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.CassandraTable]] :raises: :class:`CloudError` """ - raw_result = self._create_update_table_initial( + raw_result = self._create_update_cassandra_table_initial( resource_group_name=resource_group_name, account_name=account_name, + keyspace_name=keyspace_name, table_name=table_name, resource=resource, options=options, @@ -2995,7 +4711,7 @@ def create_update_table( ) def get_long_running_output(response): - deserialized = self._deserialize('Table', response) + deserialized = self._deserialize('CassandraTable', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -3010,17 +4726,18 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_update_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}'} + create_update_cassandra_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}'} - def _delete_table_initial( - self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, **operation_config): + def _delete_cassandra_table_initial( + self, resource_group_name, account_name, keyspace_name, table_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.delete_table.metadata['url'] + url = self.delete_cassandra_table.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), 'tableName': self._serialize.url("table_name", table_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3051,14 +4768,16 @@ def _delete_table_initial( client_raw_response = ClientRawResponse(None, response) return client_raw_response - def delete_table( - self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes an existing Azure Cosmos DB Table. + def delete_cassandra_table( + self, resource_group_name, account_name, keyspace_name, table_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing Azure Cosmos DB Cassandra table. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str :param account_name: Cosmos DB database account name. :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str :param table_name: Cosmos DB table name. :type table_name: str :param dict custom_headers: headers that will be added to the request @@ -3072,9 +4791,10 @@ def delete_table( ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ - raw_result = self._delete_table_initial( + raw_result = self._delete_cassandra_table_initial( resource_group_name=resource_group_name, account_name=account_name, + keyspace_name=keyspace_name, table_name=table_name, custom_headers=custom_headers, raw=True, @@ -3093,83 +4813,12 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}'} - - def list_cassandra_keyspaces( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the Cassandra keyspaces under an existing Azure Cosmos DB - database account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. - :type account_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 CassandraKeyspace - :rtype: - ~azure.mgmt.cosmosdb.models.CassandraKeyspacePaged[~azure.mgmt.cosmosdb.models.CassandraKeyspace] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_cassandra_keyspaces.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.CassandraKeyspacePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.CassandraKeyspacePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_cassandra_keyspaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces'} + delete_cassandra_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}'} - def get_cassandra_keyspace( - self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, **operation_config): - """Gets the Cassandra keyspaces under an existing Azure Cosmos DB database - account with the provided name. + def get_cassandra_table_throughput( + self, resource_group_name, account_name, keyspace_name, table_name, custom_headers=None, raw=False, **operation_config): + """Gets the RUs per second of the Cassandra table under an existing Azure + Cosmos DB database account with the provided name. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str @@ -3177,23 +4826,26 @@ def get_cassandra_keyspace( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. :type keyspace_name: str + :param table_name: Cosmos DB table name. + :type table_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: CassandraKeyspace or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cosmosdb.models.CassandraKeyspace or + :return: Throughput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.Throughput or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_cassandra_keyspace.metadata['url'] + url = self.get_cassandra_table_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str') + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'tableName': self._serialize.url("table_name", table_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3223,27 +4875,28 @@ def get_cassandra_keyspace( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CassandraKeyspace', response) + deserialized = self._deserialize('Throughput', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_cassandra_keyspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}'} + get_cassandra_table_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}/settings/throughput'} - def _create_update_cassandra_keyspace_initial( - self, resource_group_name, account_name, keyspace_name, resource, options, custom_headers=None, raw=False, **operation_config): - create_update_cassandra_keyspace_parameters = models.CassandraKeyspaceCreateUpdateParameters(resource=resource, options=options) + def _update_cassandra_table_throughput_initial( + self, resource_group_name, account_name, keyspace_name, table_name, resource, custom_headers=None, raw=False, **operation_config): + update_throughput_parameters = models.ThroughputUpdateParameters(resource=resource) # Construct URL - url = self.create_update_cassandra_keyspace.metadata['url'] + url = self.update_cassandra_table_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str') + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'tableName': self._serialize.url("table_name", table_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3263,7 +4916,7 @@ def _create_update_cassandra_keyspace_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(create_update_cassandra_keyspace_parameters, 'CassandraKeyspaceCreateUpdateParameters') + body_content = self._serialize.body(update_throughput_parameters, 'ThroughputUpdateParameters') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -3277,7 +4930,7 @@ def _create_update_cassandra_keyspace_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CassandraKeyspace', response) + deserialized = self._deserialize('Throughput', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -3285,9 +4938,9 @@ def _create_update_cassandra_keyspace_initial( return deserialized - def create_update_cassandra_keyspace( - self, resource_group_name, account_name, keyspace_name, resource, options, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update an Azure Cosmos DB Cassandra keyspace. + def update_cassandra_table_throughput( + self, resource_group_name, account_name, keyspace_name, table_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Update RUs per second of an Azure Cosmos DB Cassandra table. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str @@ -3295,127 +4948,43 @@ def create_update_cassandra_keyspace( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. :type keyspace_name: str - :param resource: The standard JSON format of a Cassandra keyspace - :type resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceResource - :param options: A key-value pair of options to be applied for the - request. This corresponds to the headers sent with the request. - :type options: dict[str, str] + :param table_name: Cosmos DB table name. + :type table_name: str + :param resource: The standard JSON format of a resource throughput + :type resource: ~azure.mgmt.cosmosdb.models.ThroughputResource :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 CassandraKeyspace or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns Throughput or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.CassandraKeyspace] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.Throughput] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.CassandraKeyspace]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.Throughput]] :raises: :class:`CloudError` """ - raw_result = self._create_update_cassandra_keyspace_initial( + raw_result = self._update_cassandra_table_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, + table_name=table_name, resource=resource, - options=options, custom_headers=custom_headers, raw=True, **operation_config ) def get_long_running_output(response): - deserialized = self._deserialize('CassandraKeyspace', response) + deserialized = self._deserialize('Throughput', 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_update_cassandra_keyspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}'} - - - def _delete_cassandra_keyspace_initial( - self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete_cassandra_keyspace.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, '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 = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [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_cassandra_keyspace( - self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes an existing Azure Cosmos DB Cassandra keyspace. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. - :type keyspace_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_cassandra_keyspace_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_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 - + return deserialized + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -3423,39 +4992,36 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete_cassandra_keyspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}'} + update_cassandra_table_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}/settings/throughput'} - def list_cassandra_tables( - self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, **operation_config): - """Lists the Cassandra table under an existing Azure Cosmos DB database + def list_gremlin_databases( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the Gremlin databases under an existing Azure Cosmos DB database account. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str :param account_name: Cosmos DB database account name. :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. - :type keyspace_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 CassandraTable + :return: An iterator like instance of GremlinDatabase :rtype: - ~azure.mgmt.cosmosdb.models.CassandraTablePaged[~azure.mgmt.cosmosdb.models.CassandraTable] + ~azure.mgmt.cosmosdb.models.GremlinDatabasePaged[~azure.mgmt.cosmosdb.models.GremlinDatabase] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_cassandra_tables.metadata['url'] + url = self.list_gremlin_databases.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str') + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) } url = self._client.format_url(url, **path_format_arguments) @@ -3489,47 +5055,44 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.CassandraTablePaged(internal_paging, self._deserialize.dependencies) + deserialized = models.GremlinDatabasePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.CassandraTablePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.GremlinDatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized - list_cassandra_tables.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables'} + list_gremlin_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases'} - def get_cassandra_table( - self, resource_group_name, account_name, keyspace_name, table_name, custom_headers=None, raw=False, **operation_config): - """Gets the Cassandra table under an existing Azure Cosmos DB database - account. + def get_gremlin_database( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets the Gremlin databases under an existing Azure Cosmos DB database + account with the provided name. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str :param account_name: Cosmos DB database account name. :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. - :type keyspace_name: str - :param table_name: Cosmos DB table name. - :type table_name: str + :param database_name: Cosmos DB database name. + :type database_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: CassandraTable or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cosmosdb.models.CassandraTable or + :return: GremlinDatabase or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.GremlinDatabase or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get_cassandra_table.metadata['url'] + url = self.get_gremlin_database.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), - 'tableName': self._serialize.url("table_name", table_name, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3559,28 +5122,27 @@ def get_cassandra_table( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CassandraTable', response) + deserialized = self._deserialize('GremlinDatabase', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get_cassandra_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}'} + get_gremlin_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}'} - def _create_update_cassandra_table_initial( - self, resource_group_name, account_name, keyspace_name, table_name, resource, options, custom_headers=None, raw=False, **operation_config): - create_update_cassandra_table_parameters = models.CassandraTableCreateUpdateParameters(resource=resource, options=options) + def _create_update_gremlin_database_initial( + self, resource_group_name, account_name, database_name, resource, options, custom_headers=None, raw=False, **operation_config): + create_update_gremlin_database_parameters = models.GremlinDatabaseCreateUpdateParameters(resource=resource, options=options) # Construct URL - url = self.create_update_cassandra_table.metadata['url'] + url = self.create_update_gremlin_database.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), - 'tableName': self._serialize.url("table_name", table_name, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3600,7 +5162,7 @@ def _create_update_cassandra_table_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(create_update_cassandra_table_parameters, 'CassandraTableCreateUpdateParameters') + body_content = self._serialize.body(create_update_gremlin_database_parameters, 'GremlinDatabaseCreateUpdateParameters') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -3614,7 +5176,7 @@ def _create_update_cassandra_table_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CassandraTable', response) + deserialized = self._deserialize('GremlinDatabase', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -3622,20 +5184,18 @@ def _create_update_cassandra_table_initial( return deserialized - def create_update_cassandra_table( - self, resource_group_name, account_name, keyspace_name, table_name, resource, options, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update an Azure Cosmos DB Cassandra Table. + def create_update_gremlin_database( + self, resource_group_name, account_name, database_name, resource, options, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update an Azure Cosmos DB Gremlin database. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str :param account_name: Cosmos DB database account name. :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. - :type keyspace_name: str - :param table_name: Cosmos DB table name. - :type table_name: str - :param resource: The standard JSON format of a Cassandra table - :type resource: ~azure.mgmt.cosmosdb.models.CassandraTableResource + :param database_name: Cosmos DB database name. + :type database_name: str + :param resource: The standard JSON format of a Gremlin database + :type resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseResource :param options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :type options: dict[str, str] @@ -3644,19 +5204,18 @@ def create_update_cassandra_table( 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 CassandraTable or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns GremlinDatabase or + ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.CassandraTable] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.GremlinDatabase] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.CassandraTable]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.GremlinDatabase]] :raises: :class:`CloudError` """ - raw_result = self._create_update_cassandra_table_initial( + raw_result = self._create_update_gremlin_database_initial( resource_group_name=resource_group_name, account_name=account_name, - keyspace_name=keyspace_name, - table_name=table_name, + database_name=database_name, resource=resource, options=options, custom_headers=custom_headers, @@ -3665,7 +5224,7 @@ def create_update_cassandra_table( ) def get_long_running_output(response): - deserialized = self._deserialize('CassandraTable', response) + deserialized = self._deserialize('GremlinDatabase', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -3680,19 +5239,18 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_update_cassandra_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}'} + create_update_gremlin_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}'} - def _delete_cassandra_table_initial( - self, resource_group_name, account_name, keyspace_name, table_name, custom_headers=None, raw=False, **operation_config): + def _delete_gremlin_database_initial( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.delete_cassandra_table.metadata['url'] + url = self.delete_gremlin_database.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), - 'tableName': self._serialize.url("table_name", table_name, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -3722,18 +5280,16 @@ def _delete_cassandra_table_initial( client_raw_response = ClientRawResponse(None, response) return client_raw_response - def delete_cassandra_table( - self, resource_group_name, account_name, keyspace_name, table_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes an existing Azure Cosmos DB Cassandra table. + def delete_gremlin_database( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing Azure Cosmos DB Gremlin database. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str :param account_name: Cosmos DB database account name. :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. - :type keyspace_name: str - :param table_name: Cosmos DB table name. - :type table_name: str + :param database_name: Cosmos DB database name. + :type database_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 @@ -3745,11 +5301,10 @@ def delete_cassandra_table( ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ - raw_result = self._delete_cassandra_table_initial( + raw_result = self._delete_gremlin_database_initial( resource_group_name=resource_group_name, account_name=account_name, - keyspace_name=keyspace_name, - table_name=table_name, + database_name=database_name, custom_headers=custom_headers, raw=True, **operation_config @@ -3767,83 +5322,12 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete_cassandra_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}'} - - def list_gremlin_databases( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the Gremlin databases under an existing Azure Cosmos DB database - account. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. - :type account_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 GremlinDatabase - :rtype: - ~azure.mgmt.cosmosdb.models.GremlinDatabasePaged[~azure.mgmt.cosmosdb.models.GremlinDatabase] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_gremlin_databases.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.GremlinDatabasePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.GremlinDatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_gremlin_databases.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases'} + delete_gremlin_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}'} - def get_gremlin_database( + def get_gremlin_database_throughput( self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets the Gremlin databases under an existing Azure Cosmos DB database - account with the provided name. + """Gets the RUs per second of the Gremlin database under an existing Azure + Cosmos DB database account with the provided name. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str @@ -3856,63 +5340,13 @@ def get_gremlin_database( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: GremlinDatabase or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cosmosdb.models.GremlinDatabase or + :return: Throughput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.Throughput or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_gremlin_database.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), - 'databaseName': self._serialize.url("database_name", database_name, '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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('GremlinDatabase', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_gremlin_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}'} - - - def _create_update_gremlin_database_initial( - self, resource_group_name, account_name, database_name, resource, options, custom_headers=None, raw=False, **operation_config): - create_update_gremlin_database_parameters = models.GremlinDatabaseCreateUpdateParameters(resource=resource, options=options) - + """ # Construct URL - url = self.create_update_gremlin_database.metadata['url'] + url = self.get_gremlin_database_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -3928,7 +5362,6 @@ def _create_update_gremlin_database_initial( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - 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: @@ -3936,14 +5369,11 @@ def _create_update_gremlin_database_initial( 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(create_update_gremlin_database_parameters, 'GremlinDatabaseCreateUpdateParameters') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -3951,76 +5381,22 @@ def _create_update_gremlin_database_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('GremlinDatabase', response) + deserialized = self._deserialize('Throughput', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + get_gremlin_database_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/settings/throughput'} - def create_update_gremlin_database( - self, resource_group_name, account_name, database_name, resource, options, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update an Azure Cosmos DB Gremlin database. - - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. - :type account_name: str - :param database_name: Cosmos DB database name. - :type database_name: str - :param resource: The standard JSON format of a Gremlin database - :type resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseResource - :param options: A key-value pair of options to be applied for the - request. This corresponds to the headers sent with the request. - :type options: 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 GremlinDatabase or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.GremlinDatabase] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.GremlinDatabase]] - :raises: :class:`CloudError` - """ - raw_result = self._create_update_gremlin_database_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - resource=resource, - options=options, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('GremlinDatabase', 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_update_gremlin_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}'} + def _update_gremlin_database_throughput_initial( + self, resource_group_name, account_name, database_name, resource, custom_headers=None, raw=False, **operation_config): + update_throughput_parameters = models.ThroughputUpdateParameters(resource=resource) - def _delete_gremlin_database_initial( - self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.delete_gremlin_database.metadata['url'] + url = self.update_gremlin_database_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -4035,6 +5411,8 @@ def _delete_gremlin_database_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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: @@ -4042,22 +5420,32 @@ def _delete_gremlin_database_initial( 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(update_throughput_parameters, 'ThroughputUpdateParameters') + # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [202, 204]: + 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('Throughput', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - def delete_gremlin_database( - self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes an existing Azure Cosmos DB Gremlin database. + return deserialized + + def update_gremlin_database_throughput( + self, resource_group_name, account_name, database_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Update RUs per second of an Azure Cosmos DB Gremlin database. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str @@ -4065,31 +5453,40 @@ def delete_gremlin_database( :type account_name: str :param database_name: Cosmos DB database name. :type database_name: str + :param resource: The standard JSON format of a resource throughput + :type resource: ~azure.mgmt.cosmosdb.models.ThroughputResource :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]] + :return: An instance of LROPoller that returns Throughput or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.Throughput] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.Throughput]] :raises: :class:`CloudError` """ - raw_result = self._delete_gremlin_database_initial( + raw_result = self._update_gremlin_database_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, + resource=resource, custom_headers=custom_headers, raw=True, **operation_config ) def get_long_running_output(response): + deserialized = self._deserialize('Throughput', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + 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) @@ -4097,7 +5494,7 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete_gremlin_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}'} + update_gremlin_database_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/settings/throughput'} def list_gremlin_graphs( self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): @@ -4442,3 +5839,182 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete_gremlin_graph.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}'} + + def get_gremlin_graph_throughput( + self, resource_group_name, account_name, database_name, graph_name, custom_headers=None, raw=False, **operation_config): + """Gets the Gremlin graph throughput under an existing Azure Cosmos DB + database account with the provided name. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_name: Cosmos DB database name. + :type database_name: str + :param graph_name: Cosmos DB graph name. + :type graph_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: Throughput or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cosmosdb.models.Throughput or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_gremlin_graph_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'graphName': self._serialize.url("graph_name", graph_name, '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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('Throughput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_gremlin_graph_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}/settings/throughput'} + + + def _update_gremlin_graph_throughput_initial( + self, resource_group_name, account_name, database_name, graph_name, resource, custom_headers=None, raw=False, **operation_config): + update_throughput_parameters = models.ThroughputUpdateParameters(resource=resource) + + # Construct URL + url = self.update_gremlin_graph_throughput.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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'graphName': self._serialize.url("graph_name", graph_name, '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['Accept'] = 'application/json' + 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(update_throughput_parameters, 'ThroughputUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('Throughput', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_gremlin_graph_throughput( + self, resource_group_name, account_name, database_name, graph_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Update RUs per second of an Azure Cosmos DB Gremlin graph. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_name: Cosmos DB database name. + :type database_name: str + :param graph_name: Cosmos DB graph name. + :type graph_name: str + :param resource: The standard JSON format of a resource throughput + :type resource: ~azure.mgmt.cosmosdb.models.ThroughputResource + :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 Throughput or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.Throughput] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.Throughput]] + :raises: :class:`CloudError` + """ + raw_result = self._update_gremlin_graph_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + graph_name=graph_name, + resource=resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Throughput', 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_gremlin_graph_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}/settings/throughput'} diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py index 2f337cfc0adf..981739e4ff95 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.6.1" +VERSION = "0.7.0" diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/dev_requirements.txt b/sdk/cosmos/azure-mgmt-cosmosdb/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/dev_requirements.txt +++ b/sdk/cosmos/azure-mgmt-cosmosdb/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/cosmos/azure-mgmt-documentdb/dev_requirements.txt b/sdk/cosmos/azure-mgmt-documentdb/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/cosmos/azure-mgmt-documentdb/dev_requirements.txt +++ b/sdk/cosmos/azure-mgmt-documentdb/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/datafactory/azure-mgmt-datafactory/dev_requirements.txt b/sdk/datafactory/azure-mgmt-datafactory/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/datafactory/azure-mgmt-datafactory/dev_requirements.txt +++ b/sdk/datafactory/azure-mgmt-datafactory/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/datalake/azure-mgmt-datalake-analytics/dev_requirements.txt b/sdk/datalake/azure-mgmt-datalake-analytics/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/datalake/azure-mgmt-datalake-analytics/dev_requirements.txt +++ b/sdk/datalake/azure-mgmt-datalake-analytics/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/datalake/azure-mgmt-datalake-store/dev_requirements.txt b/sdk/datalake/azure-mgmt-datalake-store/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/datalake/azure-mgmt-datalake-store/dev_requirements.txt +++ b/sdk/datalake/azure-mgmt-datalake-store/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/datamigration/azure-mgmt-datamigration/dev_requirements.txt b/sdk/datamigration/azure-mgmt-datamigration/dev_requirements.txt index b1961912ade2..8289842acac7 100644 --- a/sdk/datamigration/azure-mgmt-datamigration/dev_requirements.txt +++ b/sdk/datamigration/azure-mgmt-datamigration/dev_requirements.txt @@ -1,2 +1,2 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools -e ../../network/azure-mgmt-network diff --git a/sdk/devtestlabs/azure-mgmt-devtestlabs/dev_requirements.txt b/sdk/devtestlabs/azure-mgmt-devtestlabs/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/devtestlabs/azure-mgmt-devtestlabs/dev_requirements.txt +++ b/sdk/devtestlabs/azure-mgmt-devtestlabs/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/eventgrid/azure-eventgrid/dev_requirements.txt b/sdk/eventgrid/azure-eventgrid/dev_requirements.txt index 8ffd9e3035d1..f6457a93d5e8 100644 --- a/sdk/eventgrid/azure-eventgrid/dev_requirements.txt +++ b/sdk/eventgrid/azure-eventgrid/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/eventgrid/azure-mgmt-eventgrid/dev_requirements.txt b/sdk/eventgrid/azure-mgmt-eventgrid/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/eventgrid/azure-mgmt-eventgrid/dev_requirements.txt +++ b/sdk/eventgrid/azure-mgmt-eventgrid/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/eventhub/azure-mgmt-eventhub/dev_requirements.txt b/sdk/eventhub/azure-mgmt-eventhub/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/dev_requirements.txt +++ b/sdk/eventhub/azure-mgmt-eventhub/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/graphrbac/azure-graphrbac/dev_requirements.txt b/sdk/graphrbac/azure-graphrbac/dev_requirements.txt index 8ffd9e3035d1..f6457a93d5e8 100644 --- a/sdk/graphrbac/azure-graphrbac/dev_requirements.txt +++ b/sdk/graphrbac/azure-graphrbac/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/HISTORY.rst b/sdk/hanaonazure/azure-mgmt-hanaonazure/HISTORY.rst index a7756730e8cb..feb2133c9049 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/HISTORY.rst +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/HISTORY.rst @@ -3,6 +3,13 @@ Release History =============== +0.7.1 (2019-06-12) +++++++++++++++++++ + +**Bugfixes** + +- Make mutable some attributes that were read-only by mistake (so they can be set on creation) + 0.7.0 (2019-05-30) ++++++++++++++++++ diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance.py index e3c5da1865ed..499d92ee41df 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance.py @@ -24,8 +24,8 @@ class HanaInstance(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :ivar location: Resource location - :vartype location: str + :param location: Resource location + :type location: str :ivar tags: Resource tags :vartype tags: dict[str, str] :param hardware_profile: Specifies the hardware settings for the HANA @@ -50,9 +50,9 @@ class HanaInstance(Resource): :vartype proximity_placement_group: str :ivar hw_revision: Hardware revision of a HANA instance :vartype hw_revision: str - :ivar partner_node_id: ARM ID of another HanaInstance that will share a + :param partner_node_id: ARM ID of another HanaInstance that will share a network with this HanaInstance - :vartype partner_node_id: str + :type partner_node_id: str :ivar provisioning_state: State of provisioning of the HanaInstance. Possible values include: 'Accepted', 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' @@ -64,13 +64,11 @@ class HanaInstance(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'readonly': True}, 'tags': {'readonly': True}, 'hana_instance_id': {'readonly': True}, 'power_state': {'readonly': True}, 'proximity_placement_group': {'readonly': True}, 'hw_revision': {'readonly': True}, - 'partner_node_id': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -102,5 +100,5 @@ def __init__(self, **kwargs): self.power_state = None self.proximity_placement_group = None self.hw_revision = None - self.partner_node_id = None + self.partner_node_id = kwargs.get('partner_node_id', None) self.provisioning_state = None diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance_py3.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance_py3.py index 9b83736a677e..6241551241f4 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance_py3.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/hana_instance_py3.py @@ -24,8 +24,8 @@ class HanaInstance(Resource): :vartype name: str :ivar type: Resource type :vartype type: str - :ivar location: Resource location - :vartype location: str + :param location: Resource location + :type location: str :ivar tags: Resource tags :vartype tags: dict[str, str] :param hardware_profile: Specifies the hardware settings for the HANA @@ -50,9 +50,9 @@ class HanaInstance(Resource): :vartype proximity_placement_group: str :ivar hw_revision: Hardware revision of a HANA instance :vartype hw_revision: str - :ivar partner_node_id: ARM ID of another HanaInstance that will share a + :param partner_node_id: ARM ID of another HanaInstance that will share a network with this HanaInstance - :vartype partner_node_id: str + :type partner_node_id: str :ivar provisioning_state: State of provisioning of the HanaInstance. Possible values include: 'Accepted', 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting', 'Migrating' @@ -64,13 +64,11 @@ class HanaInstance(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'readonly': True}, 'tags': {'readonly': True}, 'hana_instance_id': {'readonly': True}, 'power_state': {'readonly': True}, 'proximity_placement_group': {'readonly': True}, 'hw_revision': {'readonly': True}, - 'partner_node_id': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -92,8 +90,8 @@ class HanaInstance(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, **kwargs) -> None: - super(HanaInstance, self).__init__(**kwargs) + def __init__(self, *, location: str=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, partner_node_id: str=None, **kwargs) -> None: + super(HanaInstance, self).__init__(location=location, **kwargs) self.hardware_profile = hardware_profile self.storage_profile = storage_profile self.os_profile = os_profile @@ -102,5 +100,5 @@ def __init__(self, *, hardware_profile=None, storage_profile=None, os_profile=No self.power_state = None self.proximity_placement_group = None self.hw_revision = None - self.partner_node_id = None + self.partner_node_id = partner_node_id self.provisioning_state = None diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/ip_address.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/ip_address.py index 03abffe7f88e..1ec48ebbd78d 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/ip_address.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/ip_address.py @@ -15,21 +15,14 @@ class IpAddress(Model): """Specifies the IP address of the network interface. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar ip_address: Specifies the IP address of the network interface. - :vartype ip_address: str + :param ip_address: Specifies the IP address of the network interface. + :type ip_address: str """ - _validation = { - 'ip_address': {'readonly': True}, - } - _attribute_map = { 'ip_address': {'key': 'ipAddress', 'type': 'str'}, } def __init__(self, **kwargs): super(IpAddress, self).__init__(**kwargs) - self.ip_address = None + self.ip_address = kwargs.get('ip_address', None) diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/ip_address_py3.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/ip_address_py3.py index 31087cd52407..ab18580deda9 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/ip_address_py3.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/ip_address_py3.py @@ -15,21 +15,14 @@ class IpAddress(Model): """Specifies the IP address of the network interface. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar ip_address: Specifies the IP address of the network interface. - :vartype ip_address: str + :param ip_address: Specifies the IP address of the network interface. + :type ip_address: str """ - _validation = { - 'ip_address': {'readonly': True}, - } - _attribute_map = { 'ip_address': {'key': 'ipAddress', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, ip_address: str=None, **kwargs) -> None: super(IpAddress, self).__init__(**kwargs) - self.ip_address = None + self.ip_address = ip_address diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile.py index 6eb7cbb133cb..1b92b1c9bda5 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile.py @@ -18,22 +18,20 @@ class OSProfile(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar computer_name: Specifies the host OS name of the HANA instance. - :vartype computer_name: str + :param computer_name: Specifies the host OS name of the HANA instance. + :type computer_name: str :ivar os_type: This property allows you to specify the type of the OS. :vartype os_type: str :ivar version: Specifies version of operating system. :vartype version: str - :ivar ssh_public_key: Specifies the SSH public key used to access the + :param ssh_public_key: Specifies the SSH public key used to access the operating system. - :vartype ssh_public_key: str + :type ssh_public_key: str """ _validation = { - 'computer_name': {'readonly': True}, 'os_type': {'readonly': True}, 'version': {'readonly': True}, - 'ssh_public_key': {'readonly': True}, } _attribute_map = { @@ -45,7 +43,7 @@ class OSProfile(Model): def __init__(self, **kwargs): super(OSProfile, self).__init__(**kwargs) - self.computer_name = None + self.computer_name = kwargs.get('computer_name', None) self.os_type = None self.version = None - self.ssh_public_key = None + self.ssh_public_key = kwargs.get('ssh_public_key', None) diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile_py3.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile_py3.py index 2da441229ff7..7fbee6edb690 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile_py3.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/os_profile_py3.py @@ -18,22 +18,20 @@ class OSProfile(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar computer_name: Specifies the host OS name of the HANA instance. - :vartype computer_name: str + :param computer_name: Specifies the host OS name of the HANA instance. + :type computer_name: str :ivar os_type: This property allows you to specify the type of the OS. :vartype os_type: str :ivar version: Specifies version of operating system. :vartype version: str - :ivar ssh_public_key: Specifies the SSH public key used to access the + :param ssh_public_key: Specifies the SSH public key used to access the operating system. - :vartype ssh_public_key: str + :type ssh_public_key: str """ _validation = { - 'computer_name': {'readonly': True}, 'os_type': {'readonly': True}, 'version': {'readonly': True}, - 'ssh_public_key': {'readonly': True}, } _attribute_map = { @@ -43,9 +41,9 @@ class OSProfile(Model): 'ssh_public_key': {'key': 'sshPublicKey', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, computer_name: str=None, ssh_public_key: str=None, **kwargs) -> None: super(OSProfile, self).__init__(**kwargs) - self.computer_name = None + self.computer_name = computer_name self.os_type = None self.version = None - self.ssh_public_key = None + self.ssh_public_key = ssh_public_key diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/resource.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/resource.py index 99b32af0d9fe..6b44bb4441c0 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/resource.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/resource.py @@ -24,8 +24,8 @@ class Resource(Model): :vartype name: str :ivar type: Resource type :vartype type: str - :ivar location: Resource location - :vartype location: str + :param location: Resource location + :type location: str :ivar tags: Resource tags :vartype tags: dict[str, str] """ @@ -34,7 +34,6 @@ class Resource(Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'readonly': True}, 'tags': {'readonly': True}, } @@ -51,5 +50,5 @@ def __init__(self, **kwargs): self.id = None self.name = None self.type = None - self.location = None + self.location = kwargs.get('location', None) self.tags = None diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/resource_py3.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/resource_py3.py index 0696665423e1..2360d140daae 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/resource_py3.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/resource_py3.py @@ -24,8 +24,8 @@ class Resource(Model): :vartype name: str :ivar type: Resource type :vartype type: str - :ivar location: Resource location - :vartype location: str + :param location: Resource location + :type location: str :ivar tags: Resource tags :vartype tags: dict[str, str] """ @@ -34,7 +34,6 @@ class Resource(Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'readonly': True}, 'tags': {'readonly': True}, } @@ -46,10 +45,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, location: str=None, **kwargs) -> None: super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = None + self.location = location self.tags = None diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/version.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/version.py index 981739e4ff95..d473b389a956 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/version.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.7.0" +VERSION = "0.7.1" diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/dev_requirements.txt b/sdk/hanaonazure/azure-mgmt-hanaonazure/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/dev_requirements.txt +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/identity/azure-identity/README.md b/sdk/identity/azure-identity/README.md index 690d317662cb..1132582d925e 100644 --- a/sdk/identity/azure-identity/README.md +++ b/sdk/identity/azure-identity/README.md @@ -5,16 +5,57 @@ # Key concepts # Examples -Shortest path to an access token: +Authenticating as a service principal: ```py +# using a client secret from azure.identity import ClientSecretCredential - credential = ClientSecretCredential(client_id, secret, tenant_id) # all credentials implement get_token token = credential.get_token(scopes=["https://vault.azure.net/.default"]) + +# using a certificate requires a thumbprint and PEM-encoded private key +from azure.identity import CertificateCredential +with open("private-key.pem") as f: + private_key = f.read() +credential = CertificateCredential(client_id, tenant_id, private_key, thumbprint) +``` + +Authenticating via environment variables: +```py +from azure.identity import EnvironmentCredential + +# will authenticate with client secret or certificate, +# depending on which environment variables are set +# (see constants.py for expected variable names) +credential = EnvironmentCredential() +token = credential.get_token(scopes=["https://vault.azure.net/.default"]) +``` + +Chaining together multiple credentials: +```py +from azure.identity import TokenCredentialChain + +# default credentials are environment then managed identity +credential_chain = TokenCredentialChain.default() + +scopes = ["https://vault.azure.net/.default"] +# the chain has a get_token method like all credentials +token = credential_chain.get_token(scopes) # try each credential in order, return the first token ``` +Authenticating from a service client: +```py +from azure.core.pipeline import Pipeline +from azure.core.pipeline.policies import BearerTokenCredentialPolicy + +credential_chain = TokenCredentialChain.default() +scopes = ["https://vault.azure.net/.default"] + +# BearerTokenCredentialPolicy gets tokens as necessary, adds appropriate auth headers to requests +policies = [BearerTokenCredentialPolicy(credential=credential_chain, scopes=scopes)] +pipeline = Pipeline(transport=some_transport, policies=policies) +``` # Troubleshooting # Next steps diff --git a/sdk/identity/azure-identity/azure/identity/__init__.py b/sdk/identity/azure-identity/azure/identity/__init__.py index 180c308436e4..8089c166cf03 100644 --- a/sdk/identity/azure-identity/azure/identity/__init__.py +++ b/sdk/identity/azure-identity/azure/identity/__init__.py @@ -4,13 +4,53 @@ # license information. # -------------------------------------------------------------------------- from .exceptions import AuthenticationError -from .credentials import ClientSecretCredential, TokenCredentialChain +from .credentials import ( + CertificateCredential, + ClientSecretCredential, + EnvironmentCredential, + ManagedIdentityCredential, + TokenCredentialChain, +) -__all__ = ["AuthenticationError", "ClientSecretCredential", "TokenCredentialChain"] + +class DefaultAzureCredential(TokenCredentialChain): + """default credential is environment followed by MSI/IMDS""" + + def __init__(self, **kwargs): + super(DefaultAzureCredential, self).__init__( + EnvironmentCredential(**kwargs), ManagedIdentityCredential(**kwargs) + ) + + +__all__ = [ + "AuthenticationError", + "CertificateCredential", + "ClientSecretCredential", + "DefaultAzureCredential", + "EnvironmentCredential", + "ManagedIdentityCredential", + "TokenCredentialChain", +] try: - from .aio import AsyncClientSecretCredential, AsyncTokenCredentialChain + from .aio import ( + AsyncCertificateCredential, + AsyncClientSecretCredential, + AsyncDefaultAzureCredential, + AsyncEnvironmentCredential, + AsyncManagedIdentityCredential, + AsyncTokenCredentialChain, + ) - __all__.extend(["AsyncClientSecretCredential", "AsyncTokenCredentialChain"]) -except SyntaxError: + __all__.extend( + [ + "AsyncCertificateCredential", + "AsyncClientSecretCredential", + "AsyncDefaultAzureCredential", + "AsyncEnvironmentCredential", + "AsyncManagedIdentityCredential", + "AsyncTokenCredentialChain", + ] + ) +except (ImportError, SyntaxError): pass diff --git a/sdk/identity/azure-identity/azure/identity/_authn_client.py b/sdk/identity/azure-identity/azure/identity/_authn_client.py new file mode 100644 index 000000000000..570fb7804a4a --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/_authn_client.py @@ -0,0 +1,105 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# ------------------------------------------------------------------------- +from time import time + +from azure.core import Configuration, HttpRequest +from azure.core.pipeline import Pipeline, PipelineRequest +from azure.core.pipeline.policies import ContentDecodePolicy, NetworkTraceLoggingPolicy, RetryPolicy +from azure.core.pipeline.transport import HttpTransport, RequestsTransport +from msal import TokenCache + +from .exceptions import AuthenticationError + +try: + from typing import TYPE_CHECKING +except ImportError: + TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Any, Dict, Iterable, Mapping, Optional + from azure.core.pipeline import PipelineResponse + from azure.core.pipeline.policies import HTTPPolicy + + +class AuthnClientBase(object): + """Sans I/O authentication client methods""" + + def __init__(self, auth_url, **kwargs): + # type: (str, Mapping[str, Any]) -> None + if not auth_url: + raise ValueError("auth_url should be the URL of an OAuth endpoint") + super(AuthnClientBase, self).__init__() + self._auth_url = auth_url + self._cache = TokenCache() + + def get_cached_token(self, scopes): + # type: (Iterable[str]) -> Optional[str] + tokens = self._cache.find(TokenCache.CredentialType.ACCESS_TOKEN, list(scopes)) + for token in tokens: + if all((scope in token["target"] for scope in scopes)): + if int(token["expires_on"]) - 300 > int(time()): + return token["secret"] + return None + + def _deserialize_and_cache_token(self, response, scopes): + # type: (PipelineResponse, Iterable[str]) -> str + try: + if "deserialized_data" in response.context: + payload = response.context["deserialized_data"] + else: + payload = response.http_response.text() + token = payload["access_token"] + + # these values are strings in IMDS responses but msal.TokenCache requires they be integers + # https://github.com/AzureAD/microsoft-authentication-library-for-python/pull/55 + if payload.get("expires_in"): + payload["expires_in"] = int(payload["expires_in"]) + if payload.get("ext_expires_in"): + payload["ext_expires_in"] = int(payload["ext_expires_in"]) + + self._cache.add({"response": payload, "scope": scopes}) + return token + except KeyError: + raise AuthenticationError("Unexpected authentication response: {}".format(payload)) + except Exception as ex: + raise AuthenticationError("Authentication failed: {}".format(str(ex))) + + def _prepare_request(self, method="POST", headers=None, form_data=None, params=None): + # type: (Optional[str], Optional[Mapping[str, str]], Optional[Mapping[str, str]], Optional[Dict[str, str]]) -> HttpRequest + request = HttpRequest(method, self._auth_url, headers=headers) + if form_data: + request.headers["Content-Type"] = "application/x-www-form-urlencoded" + request.set_formdata_body(form_data) + if params: + request.format_parameters(params) + return request + + +class AuthnClient(AuthnClientBase): + """Synchronous authentication client""" + + def __init__(self, auth_url, config=None, policies=None, transport=None, **kwargs): + # type: (str, Optional[Configuration], Optional[Iterable[HTTPPolicy]], Optional[HttpTransport], Mapping[str, Any]) -> None + config = config or self.create_config(**kwargs) + policies = policies or [ContentDecodePolicy(), config.logging_policy, config.retry_policy] + if not transport: + transport = RequestsTransport(configuration=config) + self._pipeline = Pipeline(transport=transport, policies=policies) + super(AuthnClient, self).__init__(auth_url, **kwargs) + + def request_token(self, scopes, method="POST", headers=None, form_data=None, params=None): + # type: (Iterable[str], Optional[str], Optional[Mapping[str, str]], Optional[Mapping[str, str]], Optional[Dict[str, str]]) -> str + request = self._prepare_request(method, headers=headers, form_data=form_data, params=params) + response = self._pipeline.run(request, stream=False) + token = self._deserialize_and_cache_token(response, scopes) + return token + + @staticmethod + def create_config(**kwargs): + # type: (Mapping[str, Any]) -> Configuration + config = Configuration(**kwargs) + config.logging_policy = NetworkTraceLoggingPolicy(**kwargs) + config.retry_policy = RetryPolicy(retry_on_status_codes=[404, 429] + list(range(500, 600)), **kwargs) + return config diff --git a/sdk/identity/azure-identity/azure/identity/_base.py b/sdk/identity/azure-identity/azure/identity/_base.py new file mode 100644 index 000000000000..14d8ae6b9e3b --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/_base.py @@ -0,0 +1,52 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from msal.oauth2cli import JwtSigner + +from .constants import Endpoints + +try: + from typing import TYPE_CHECKING +except ImportError: + TYPE_CHECKING = False + +if TYPE_CHECKING: + # pylint:disable=unused-import + from typing import Any, Mapping + + +class ClientSecretCredentialBase(object): + def __init__(self, client_id, secret, tenant_id, **kwargs): + # type: (str, str, str, Mapping[str, Any]) -> None + if not client_id: + raise ValueError("client_id should be the id of an Azure Active Directory application") + if not secret: + raise ValueError("secret should be an Azure Active Directory application's client secret") + if not tenant_id: + raise ValueError("tenant_id should be an Azure Active Directory tenant's id (also called its 'directory id')") + self._form_data = {"client_id": client_id, "client_secret": secret, "grant_type": "client_credentials"} + super(ClientSecretCredentialBase, self).__init__() + + +class CertificateCredentialBase(object): + def __init__(self, client_id, tenant_id, certificate_path, **kwargs): + # type: (str, str, str, Mapping[str, Any]) -> None + if not certificate_path: + # TODO: support PFX + raise ValueError("certificate_path must be the path to a PEM-encoded private key file") + + super(CertificateCredentialBase, self).__init__() + auth_url = Endpoints.AAD_OAUTH2_V2_FORMAT.format(tenant_id) + + with open(certificate_path) as pem: + private_key = pem.read() + signer = JwtSigner(private_key, "RS256") + client_assertion = signer.sign_assertion(audience=auth_url, issuer=client_id) + self._form_data = { + "client_assertion": client_assertion, + "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", + "client_id": client_id, + "grant_type": "client_credentials", + } diff --git a/sdk/identity/azure-identity/azure/identity/_internal.py b/sdk/identity/azure-identity/azure/identity/_internal.py new file mode 100644 index 000000000000..c2fc52478575 --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/_internal.py @@ -0,0 +1,105 @@ +# ------------------------------------------------------------------------ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# ------------------------------------------------------------------------ +import os + +try: + from typing import TYPE_CHECKING +except ImportError: + TYPE_CHECKING = False + +if TYPE_CHECKING: + # pylint:disable=unused-import + from typing import Any, Dict, Optional + +from azure.core import Configuration +from azure.core.pipeline.policies import ContentDecodePolicy, HeadersPolicy, NetworkTraceLoggingPolicy, RetryPolicy + +from ._authn_client import AuthnClient +from .constants import Endpoints, MSI_ENDPOINT, MSI_SECRET +from .exceptions import AuthenticationError + + +class ImdsCredential: + """Authenticates with a managed identity via the IMDS endpoint""" + + def __init__(self, config=None, **kwargs): + # type: (Optional[Configuration], Dict[str, Any]) -> None + config = config or self.create_config(**kwargs) + policies = [config.header_policy, ContentDecodePolicy(), config.logging_policy, config.retry_policy] + self._client = AuthnClient(Endpoints.IMDS, config, policies, **kwargs) + + @staticmethod + def create_config(**kwargs): + # type: (Dict[str, str]) -> Configuration + timeout = kwargs.pop("connection_timeout", 2) + config = Configuration(connection_timeout=timeout, **kwargs) + config.header_policy = HeadersPolicy(base_headers={"Metadata": "true"}, **kwargs) + config.logging_policy = NetworkTraceLoggingPolicy(**kwargs) + retries = kwargs.pop("retry_total", 5) + config.retry_policy = RetryPolicy( + retry_total=retries, retry_on_status_codes=[404, 429] + list(range(500, 600)), **kwargs + ) + return config + + def get_token(self, *scopes): + # type: (*str) -> str + if len(scopes) != 1: + raise ValueError("this credential supports one scope per request") + token = self._client.get_cached_token(scopes) + if not token: + resource = scopes[0] + if resource.endswith("/.default"): + resource = resource[:-len("/.default")] + token = self._client.request_token( + scopes, method="GET", params={"api-version": "2018-02-01", "resource": resource} + ) + return token + + +class MsiCredential: + """Authenticates via the MSI endpoint""" + + def __init__(self, config=None, **kwargs): + # type: (Optional[Configuration], Dict[str, Any]) -> None + config = config or self.create_config(**kwargs) + policies = [ContentDecodePolicy(), config.retry_policy, config.logging_policy] + endpoint = os.environ.get(MSI_ENDPOINT) + if not endpoint: + raise ValueError("expected environment variable {} has no value".format(MSI_ENDPOINT)) + self._client = AuthnClient(endpoint, config, policies, **kwargs) + + @staticmethod + def create_config(**kwargs): + # type: (Dict[str, str]) -> Configuration + timeout = kwargs.pop("connection_timeout", 2) + config = Configuration(connection_timeout=timeout, **kwargs) + config.logging_policy = NetworkTraceLoggingPolicy(**kwargs) + retries = kwargs.pop("retry_total", 5) + config.retry_policy = RetryPolicy( + retry_total=retries, retry_on_status_codes=[404, 429] + list(range(500, 600)), **kwargs + ) + return config + + def get_token(self, *scopes): + # type: (*str) -> str + if len(scopes) != 1: + raise ValueError("this credential supports only one scope per request") + token = self._client.get_cached_token(scopes) + if not token: + secret = os.environ.get(MSI_SECRET) + if not secret: + raise AuthenticationError("{} environment variable has no value".format(MSI_SECRET)) + resource = scopes[0] + if resource.endswith("/.default"): + resource = resource[:-len("/.default")] + # TODO: support user-assigned client id + token = self._client.request_token( + scopes, + method="GET", + headers={"secret": secret}, + params={"api-version": "2017-09-01", "resource": resource}, + ) + return token diff --git a/sdk/identity/azure-identity/azure/identity/aio/__init__.py b/sdk/identity/azure-identity/azure/identity/aio/__init__.py index 476dcc21e9dc..3c119213381f 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/__init__.py +++ b/sdk/identity/azure-identity/azure/identity/aio/__init__.py @@ -1,8 +1,29 @@ -# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. -# -------------------------------------------------------------------------- -from .credentials import AsyncClientSecretCredential, AsyncTokenCredentialChain +# ------------------------------------------------------------------------ +from .credentials import ( + AsyncCertificateCredential, + AsyncClientSecretCredential, + AsyncEnvironmentCredential, + AsyncManagedIdentityCredential, + AsyncTokenCredentialChain, +) -__all__ = ["AsyncClientSecretCredential", "AsyncTokenCredentialChain"] + +class AsyncDefaultAzureCredential(AsyncTokenCredentialChain): + """default credential is environment followed by MSI/IMDS""" + + def __init__(self, **kwargs): + super().__init__(AsyncEnvironmentCredential(**kwargs), AsyncManagedIdentityCredential(**kwargs)) + + +__all__ = [ + "AsyncCertificateCredential", + "AsyncClientSecretCredential", + "AsyncDefaultAzureCredential", + "AsyncEnvironmentCredential", + "AsyncManagedIdentityCredential", + "AsyncTokenCredentialChain", +] diff --git a/sdk/identity/azure-identity/azure/identity/aio/_authn_client.py b/sdk/identity/azure-identity/azure/identity/aio/_authn_client.py new file mode 100644 index 000000000000..91a0ff09840f --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/aio/_authn_client.py @@ -0,0 +1,55 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from typing import Any, Dict, Iterable, Mapping, Optional + +from azure.core import Configuration +from azure.core.pipeline import AsyncPipeline +from azure.core.pipeline.policies import AsyncRetryPolicy, ContentDecodePolicy, HTTPPolicy, NetworkTraceLoggingPolicy +from azure.core.pipeline.transport import AsyncHttpTransport +from azure.core.pipeline.transport.requests_asyncio import AsyncioRequestsTransport + +from .._authn_client import AuthnClientBase + + +class AsyncAuthnClient(AuthnClientBase): + """Async authentication client""" + + def __init__( + self, + auth_url: str, + config: Optional[Configuration] = None, + policies: Optional[Iterable[HTTPPolicy]] = None, + transport: Optional[AsyncHttpTransport] = None, + **kwargs: Mapping[str, Any] + ) -> None: + config = config or self.create_config(**kwargs) + policies = policies or [ContentDecodePolicy(), config.logging_policy, config.retry_policy] + if not transport: + transport = AsyncioRequestsTransport(configuration=config) + self._pipeline = AsyncPipeline(transport=transport, policies=policies) + super(AsyncAuthnClient, self).__init__(auth_url, **kwargs) + + async def request_token( + self, + scopes: Iterable[str], + method: Optional[str] = "POST", + headers: Optional[Mapping[str, str]] = None, + form_data: Optional[Mapping[str, str]] = None, + params: Optional[Dict[str, str]] = None, + ) -> str: + request = self._prepare_request(method, headers=headers, form_data=form_data, params=params) + response = await self._pipeline.run(request, stream=False) + token = self._deserialize_and_cache_token(response, scopes) + return token + + @staticmethod + def create_config(**kwargs: Mapping[str, Any]) -> Configuration: + config = Configuration(**kwargs) + config.logging_policy = NetworkTraceLoggingPolicy(**kwargs) + config.retry_policy = AsyncRetryPolicy( + retry_on_status_codes=[404, 429] + list(range(500, 600)), **kwargs + ) + return config diff --git a/sdk/identity/azure-identity/azure/identity/aio/_internal.py b/sdk/identity/azure-identity/azure/identity/aio/_internal.py new file mode 100644 index 000000000000..97e84da0c216 --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/aio/_internal.py @@ -0,0 +1,87 @@ +# ------------------------------------------------------------------------ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# ------------------------------------------------------------------------ +import os +from typing import Any, Dict, Optional + +from azure.core import Configuration +from azure.core.pipeline.policies import ContentDecodePolicy, HeadersPolicy, NetworkTraceLoggingPolicy, AsyncRetryPolicy + +from ._authn_client import AsyncAuthnClient +from ..constants import Endpoints, MSI_ENDPOINT, MSI_SECRET +from ..exceptions import AuthenticationError + + +class AsyncImdsCredential: + def __init__(self, config: Optional[Configuration] = None, **kwargs: Dict[str, Any]) -> None: + config = config or self.create_config(**kwargs) + policies = [config.header_policy, ContentDecodePolicy(), config.retry_policy, config.logging_policy] + self._client = AsyncAuthnClient(Endpoints.IMDS, config, policies, **kwargs) + + async def get_token(self, *scopes: str) -> str: + if len(scopes) != 1: + raise ValueError("this credential supports one scope per request") + token = self._client.get_cached_token(scopes) + if not token: + resource = scopes[0] + if resource.endswith("/.default"): + resource = resource[:-len("/.default")] + token = await self._client.request_token( + scopes, method="GET", params={"api-version": "2018-02-01", "resource": resource} + ) + return token + + @staticmethod + def create_config(**kwargs: Dict[str, Any]) -> Configuration: + timeout = kwargs.pop("connection_timeout", 2) + config = Configuration(connection_timeout=timeout, **kwargs) + config.header_policy = HeadersPolicy(base_headers={"Metadata": "true"}, **kwargs) + config.logging_policy = NetworkTraceLoggingPolicy(**kwargs) + retries = kwargs.pop("retry_total", 5) + config.retry_policy = AsyncRetryPolicy( + retry_total=retries, retry_on_status_codes=[404, 429] + list(range(500, 600)), **kwargs + ) + return config + + +class AsyncMsiCredential: + def __init__(self, config: Optional[Configuration] = None, **kwargs: Dict[str, Any]) -> None: + config = config or self.create_config(**kwargs) + policies = [ContentDecodePolicy(), config.retry_policy, config.logging_policy] + endpoint = os.environ.get(MSI_ENDPOINT) + if not endpoint: + raise ValueError("expected environment variable {} has no value".format(MSI_ENDPOINT)) + self._client = AsyncAuthnClient(endpoint, config, policies, **kwargs) + + async def get_token(self, *scopes: str) -> str: + if len(scopes) != 1: + raise ValueError("this credential supports only one scope per request") + token = self._client.get_cached_token(scopes) + if not token: + resource = scopes[0] + if resource.endswith("/.default"): + resource = resource[:-len("/.default")] + secret = os.environ.get(MSI_SECRET) + if not secret: + raise AuthenticationError("{} environment variable has no value".format(MSI_SECRET)) + # TODO: support user-assigned client id + token = await self._client.request_token( + scopes, + method="GET", + headers={"secret": secret}, + params={"api-version": "2017-09-01", "resource": resource}, + ) + return token + + @staticmethod + def create_config(**kwargs: Dict[str, Any]) -> Configuration: + timeout = kwargs.pop("connection_timeout", 2) + config = Configuration(connection_timeout=timeout, **kwargs) + config.logging_policy = NetworkTraceLoggingPolicy(**kwargs) + retries = kwargs.pop("retry_total", 5) + config.retry_policy = AsyncRetryPolicy( + retry_total=retries, retry_on_status_codes=[404, 429] + list(range(500, 600)), **kwargs + ) + return config diff --git a/sdk/identity/azure-identity/azure/identity/aio/authn_client.py b/sdk/identity/azure-identity/azure/identity/aio/authn_client.py deleted file mode 100644 index 6886b945642d..000000000000 --- a/sdk/identity/azure-identity/azure/identity/aio/authn_client.py +++ /dev/null @@ -1,53 +0,0 @@ -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See LICENSE.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -from typing import Any, Iterable, Mapping, Optional - -from azure.core import Configuration -from azure.core.pipeline import AsyncPipeline -from azure.core.pipeline.policies import AsyncRetryPolicy, ContentDecodePolicy, HTTPPolicy, NetworkTraceLoggingPolicy -from azure.core.pipeline.transport import AsyncHttpTransport -from azure.core.pipeline.transport.requests_asyncio import AsyncioRequestsTransport - -from ..authn_client import _AuthnClientBase - - -class AsyncAuthnClient(_AuthnClientBase): - def __init__( - self, - auth_url: str, - config: Optional[Configuration] = None, - policies: Optional[Iterable[HTTPPolicy]] = None, - transport: Optional[AsyncHttpTransport] = None, - **kwargs: Mapping[str, Any] - ) -> None: - config = config or self.create_config(**kwargs) - # TODO: ContentDecodePolicy doesn't accept kwargs - policies = policies or [ContentDecodePolicy(), config.logging_policy, config.retry_policy] - if not transport: - transport = AsyncioRequestsTransport(configuration=config) - self._pipeline = AsyncPipeline(transport=transport, policies=policies) - super(AsyncAuthnClient, self).__init__(auth_url, **kwargs) - - async def request_token( - self, - scopes: Iterable[str], - method: Optional[str] = "POST", - form_data: Optional[Mapping[str, str]] = None, - params: Optional[Mapping[str, str]] = None, - ) -> str: - request = self._prepare_request(method, form_data, params) - response = await self._pipeline.run(request, stream=False) - token = self._deserialize_and_cache_token(response, scopes) - return token - - @staticmethod - def create_config(**kwargs: Mapping[str, Any]) -> Configuration: - config = Configuration(**kwargs) - config.logging_policy = NetworkTraceLoggingPolicy(**kwargs) - config.retry_policy = AsyncRetryPolicy( - retry_on_status_codes=[404, 429] + [x for x in range(500, 600)], **kwargs - ) - return config diff --git a/sdk/identity/azure-identity/azure/identity/aio/credentials.py b/sdk/identity/azure-identity/azure/identity/aio/credentials.py index 60474f476f95..06a003e25f8d 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/credentials.py +++ b/sdk/identity/azure-identity/azure/identity/aio/credentials.py @@ -1,74 +1,119 @@ -# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. -# -------------------------------------------------------------------------- -from typing import Any, Dict, Iterable, Mapping, Optional +# ------------------------------------------------------------------------ +import os +from typing import Any, Dict, Mapping, Optional, Union from azure.core import Configuration -from azure.core.pipeline.policies import HTTPPolicy +from azure.core.pipeline.policies import ContentDecodePolicy, HeadersPolicy, NetworkTraceLoggingPolicy, AsyncRetryPolicy -from .authn_client import AsyncAuthnClient +from ._authn_client import AsyncAuthnClient +from ._internal import AsyncImdsCredential, AsyncMsiCredential +from .._base import ClientSecretCredentialBase, CertificateCredentialBase +from ..constants import Endpoints, EnvironmentVariables, MSI_ENDPOINT, MSI_SECRET from ..credentials import TokenCredentialChain from ..exceptions import AuthenticationError - # pylint:disable=too-few-public-methods -# TODO: could share more code with sync -class _AsyncClientCredentialBase(object): - _OAUTH_ENDPOINT = "https://login.microsoftonline.com/{}/oauth2/v2.0/token" +class AsyncClientSecretCredential(ClientSecretCredentialBase): def __init__( self, client_id: str, + secret: str, tenant_id: str, config: Optional[Configuration] = None, - policies: Optional[Iterable[HTTPPolicy]] = None, **kwargs: Mapping[str, Any] ) -> None: - if not client_id: - raise ValueError("client_id") - if not tenant_id: - raise ValueError("tenant_id") - self._client = AsyncAuthnClient(self._OAUTH_ENDPOINT.format(tenant_id), config, policies, **kwargs) - self._form_data = {} # type: Dict[str, str] - - async def get_token(self, scopes: Iterable[str]) -> str: - data = self._form_data.copy() - data["scope"] = " ".join(scopes) + super(AsyncClientSecretCredential, self).__init__(client_id, secret, tenant_id, **kwargs) + self._client = AsyncAuthnClient(Endpoints.AAD_OAUTH2_V2_FORMAT.format(tenant_id), config, **kwargs) + + async def get_token(self, *scopes: str) -> str: token = self._client.get_cached_token(scopes) if not token: + data = dict(self._form_data, scope=" ".join(scopes)) token = await self._client.request_token(scopes, form_data=data) return token # type: ignore -class AsyncClientSecretCredential(_AsyncClientCredentialBase): +class AsyncCertificateCredential(CertificateCredentialBase): def __init__( self, client_id: str, - secret: str, tenant_id: str, + certificate_path: str, config: Optional[Configuration] = None, **kwargs: Mapping[str, Any] ) -> None: - if not secret: - raise ValueError("secret") - super(AsyncClientSecretCredential, self).__init__(client_id, tenant_id, config, **kwargs) - self._form_data = {"client_id": client_id, "client_secret": secret, "grant_type": "client_credentials"} + super(AsyncCertificateCredential, self).__init__(client_id, tenant_id, certificate_path, **kwargs) + self._client = AsyncAuthnClient(Endpoints.AAD_OAUTH2_V2_FORMAT.format(tenant_id), config, **kwargs) + + async def get_token(self, *scopes: str) -> str: + token = self._client.get_cached_token(scopes) + if not token: + data = dict(self._form_data, scope=" ".join(scopes)) + token = await self._client.request_token(scopes, form_data=data) + return token # type: ignore + + +class AsyncEnvironmentCredential: + def __init__(self, **kwargs: Mapping[str, Any]) -> None: + self._credential = None # type: Optional[Union[AsyncCertificateCredential, AsyncClientSecretCredential]] + + if all(os.environ.get(v) is not None for v in EnvironmentVariables.CLIENT_SECRET_VARS): + self._credential = AsyncClientSecretCredential( + client_id=os.environ[EnvironmentVariables.AZURE_CLIENT_ID], + secret=os.environ[EnvironmentVariables.AZURE_CLIENT_SECRET], + tenant_id=os.environ[EnvironmentVariables.AZURE_TENANT_ID], + **kwargs + ) + elif all(os.environ.get(v) is not None for v in EnvironmentVariables.CERT_VARS): + self._credential = AsyncCertificateCredential( + client_id=os.environ[EnvironmentVariables.AZURE_CLIENT_ID], + tenant_id=os.environ[EnvironmentVariables.AZURE_TENANT_ID], + certificate_path=os.environ[EnvironmentVariables.AZURE_CLIENT_CERTIFICATE_PATH], + **kwargs + ) + + async def get_token(self, *scopes: str) -> str: + if not self._credential: + message = "Missing environment settings. To authenticate with a client secret, set {}. To authenticate with a certificate, set {}.".format( + ", ".join(EnvironmentVariables.CLIENT_SECRET_VARS), ", ".join(EnvironmentVariables.CERT_VARS) + ) + raise AuthenticationError(message) + return await self._credential.get_token(*scopes) + + +class AsyncManagedIdentityCredential(object): + """factory for MSI and IMDS credentials""" + + def __new__(cls, *args, **kwargs): + if os.environ.get(MSI_SECRET) and os.environ.get(MSI_ENDPOINT): + return AsyncMsiCredential(*args, **kwargs) + return AsyncImdsCredential(*args, **kwargs) + + @staticmethod + def create_config(**kwargs: Dict[str, Any]) -> Configuration: + pass + + async def get_token(self, *scopes: str) -> str: + pass class AsyncTokenCredentialChain(TokenCredentialChain): """A sequence of token credentials""" - async def get_token(self, scopes: Iterable[str]) -> str: + async def get_token(self, *scopes: str) -> str: # type: ignore """Attempts to get a token from each credential, in order, returning the first token. If no token is acquired, raises an exception listing error messages. """ history = [] for credential in self._credentials: try: - return await credential.get_token(scopes) + return await credential.get_token(*scopes) except AuthenticationError as ex: history.append((credential, ex.message)) except Exception as ex: # pylint: disable=broad-except diff --git a/sdk/identity/azure-identity/azure/identity/authn_client.py b/sdk/identity/azure-identity/azure/identity/authn_client.py deleted file mode 100644 index aca01dd10bdc..000000000000 --- a/sdk/identity/azure-identity/azure/identity/authn_client.py +++ /dev/null @@ -1,87 +0,0 @@ -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See LICENSE.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -from time import time - -from azure.core import Configuration, HttpRequest -from azure.core.pipeline import Pipeline -from azure.core.pipeline.policies import ContentDecodePolicy, NetworkTraceLoggingPolicy, RetryPolicy -from azure.core.pipeline.transport import RequestsTransport -from msal import TokenCache - -from .exceptions import AuthenticationError - -try: - from typing import TYPE_CHECKING -except ImportError: - TYPE_CHECKING = False -if TYPE_CHECKING: - from typing import Any, Iterable, Mapping, Optional - - -class _AuthnClientBase(object): - def __init__(self, auth_url, **kwargs): - if not auth_url: - raise ValueError("auth_url") - super(_AuthnClientBase, self).__init__(**kwargs) - self._cache = TokenCache() - self._auth_url = auth_url - - def get_cached_token(self, scopes): - # type: (Iterable[str]) -> Optional[str] - tokens = self._cache.find(TokenCache.CredentialType.ACCESS_TOKEN, list(scopes)) - for token in tokens: - if all((scope in token["target"] for scope in scopes)): - if int(token["expires_on"]) - 300 > int(time()): - return token["secret"] - return None - - def _prepare_request(self, method="POST", form_data=None, params=None): - request = HttpRequest(method, self._auth_url) - if form_data: - request.headers["Content-Type"] = "application/x-www-form-urlencoded" - request.set_formdata_body(form_data) - if params: - request.format_parameters(params) - return request - - def _deserialize_and_cache_token(self, response, scopes): - try: - if "deserialized_data" in response.context: - payload = response.context["deserialized_data"] - else: - payload = response.http_response.text() - token = payload["access_token"] - self._cache.add({"response": payload, "scope": scopes}) - return token - except KeyError: - raise AuthenticationError("Unexpected authentication response: {}".format(payload)) - except Exception as ex: - raise AuthenticationError("Authentication failed: {}".format(str(ex))) - - -class AuthnClient(_AuthnClientBase): - def __init__(self, auth_url, config=None, policies=None, transport=None, **kwargs): - config = config or self.create_config(**kwargs) - # TODO: ContentDecodePolicy doesn't accept kwargs - policies = policies or [ContentDecodePolicy(), config.logging_policy, config.retry_policy] - if not transport: - transport = RequestsTransport(configuration=config) - self._pipeline = Pipeline(transport=transport, policies=policies) - super(AuthnClient, self).__init__(auth_url, **kwargs) - - def request_token(self, scopes, method="POST", form_data=None, params=None): - request = self._prepare_request(method, form_data, params) - response = self._pipeline.run(request, stream=False) - token = self._deserialize_and_cache_token(response, scopes) - return token - - @staticmethod - def create_config(**kwargs): - # type: (Mapping[str, Any]) -> Configuration - config = Configuration(**kwargs) - config.logging_policy = NetworkTraceLoggingPolicy(**kwargs) - config.retry_policy = RetryPolicy(retry_on_status_codes=[404, 429] + [x for x in range(500, 600)], **kwargs) - return config diff --git a/sdk/identity/azure-identity/azure/identity/constants.py b/sdk/identity/azure-identity/azure/identity/constants.py new file mode 100644 index 000000000000..5be0313f8394 --- /dev/null +++ b/sdk/identity/azure-identity/azure/identity/constants.py @@ -0,0 +1,28 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + + +class EnvironmentVariables: + AZURE_CLIENT_ID = "AZURE_CLIENT_ID" + AZURE_CLIENT_SECRET = "AZURE_CLIENT_SECRET" + AZURE_TENANT_ID = "AZURE_TENANT_ID" + CLIENT_SECRET_VARS = (AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID) + + AZURE_CLIENT_CERTIFICATE_PATH = "AZURE_CLIENT_CERTIFICATE_PATH" + CERT_VARS = (AZURE_CLIENT_ID, AZURE_CLIENT_CERTIFICATE_PATH, AZURE_TENANT_ID) + + +class Endpoints: + # https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token#get-a-token-using-http + IMDS = "http://169.254.169.254/metadata/identity/oauth2/token" + + # TODO: other clouds have other endpoints + AAD_OAUTH2_V2_FORMAT = "https://login.microsoftonline.com/{}/oauth2/v2.0/token" + + # https://docs.microsoft.com/en-us/azure/app-service/overview-managed-identity#obtaining-tokens-for-azure-resources + +MSI_ENDPOINT = "MSI_ENDPOINT" +MSI_SECRET = "MSI_SECRET" diff --git a/sdk/identity/azure-identity/azure/identity/credentials.py b/sdk/identity/azure-identity/azure/identity/credentials.py index 9b71bf3cd2dd..69625896fea6 100644 --- a/sdk/identity/azure-identity/azure/identity/credentials.py +++ b/sdk/identity/azure-identity/azure/identity/credentials.py @@ -1,11 +1,17 @@ -# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. -# -------------------------------------------------------------------------- +# ------------------------------------------------------------------------ +import os + from azure.core import Configuration +from azure.core.pipeline.policies import ContentDecodePolicy, HeadersPolicy, NetworkTraceLoggingPolicy, RetryPolicy -from .authn_client import AuthnClient +from ._authn_client import AuthnClient +from ._base import ClientSecretCredentialBase, CertificateCredentialBase +from ._internal import ImdsCredential, MsiCredential +from .constants import Endpoints, EnvironmentVariables, MSI_ENDPOINT, MSI_SECRET from .exceptions import AuthenticationError try: @@ -15,62 +21,114 @@ if TYPE_CHECKING: # pylint:disable=unused-import - from typing import Any, Dict, Iterable, Mapping, Optional - from azure.core.pipeline.policies import HTTPPolicy - from azure.core.credentials import SupportsGetToken + from typing import Any, Dict, Mapping, Optional, Union + from azure.core.credentials import TokenCredential # pylint:disable=too-few-public-methods -class _ClientCredentialBase(object): - _OAUTH_ENDPOINT = "https://login.microsoftonline.com/{}/oauth2/v2.0/token" +class ClientSecretCredential(ClientSecretCredentialBase): + """Authenticates with a client secret""" - def __init__(self, client_id, tenant_id, config=None, policies=None, **kwargs): - # type: (str, str, Optional[Configuration], Optional[Iterable[HTTPPolicy]], Mapping[str, Any]) -> None - if not client_id: - raise ValueError("client_id") - if not tenant_id: - raise ValueError("tenant_id") - self._client = AuthnClient(self._OAUTH_ENDPOINT.format(tenant_id), config, policies, **kwargs) - self._form_data = {} # type: Dict[str, str] + def __init__(self, client_id, secret, tenant_id, config=None, **kwargs): + # type: (str, str, str, Optional[Configuration], Mapping[str, Any]) -> None + super(ClientSecretCredential, self).__init__(client_id, secret, tenant_id, **kwargs) + self._client = AuthnClient(Endpoints.AAD_OAUTH2_V2_FORMAT.format(tenant_id), config, **kwargs) - def get_token(self, scopes): - # type: (Iterable[str]) -> str - data = self._form_data.copy() - data["scope"] = " ".join(scopes) + def get_token(self, *scopes): + # type: (*str) -> str token = self._client.get_cached_token(scopes) if not token: - return self._client.request_token(scopes, form_data=data) + data = dict(self._form_data, scope=" ".join(scopes)) + token = self._client.request_token(scopes, form_data=data) return token -class ClientSecretCredential(_ClientCredentialBase): - def __init__(self, client_id, secret, tenant_id, config=None, **kwargs): +class CertificateCredential(CertificateCredentialBase): + """Authenticates with a certificate""" + + def __init__(self, client_id, tenant_id, certificate_path, config=None, **kwargs): # type: (str, str, str, Optional[Configuration], Mapping[str, Any]) -> None - if not secret: - raise ValueError("secret") - super(ClientSecretCredential, self).__init__(client_id, tenant_id, config, **kwargs) - self._form_data = {"client_id": client_id, "client_secret": secret, "grant_type": "client_credentials"} + self._client = AuthnClient(Endpoints.AAD_OAUTH2_V2_FORMAT.format(tenant_id), config, **kwargs) + super(CertificateCredential, self).__init__(client_id, tenant_id, certificate_path, **kwargs) + + def get_token(self, *scopes): + # type: (*str) -> str + token = self._client.get_cached_token(scopes) + if not token: + data = dict(self._form_data, scope=" ".join(scopes)) + token = self._client.request_token(scopes, form_data=data) + return token + + +class EnvironmentCredential: + """Authenticates with a secret or certificate using environment variable settings""" + + def __init__(self, **kwargs): + # type: (Mapping[str, Any]) -> None + self._credential = None # type: Optional[Union[CertificateCredential, ClientSecretCredential]] + + if all(os.environ.get(v) is not None for v in EnvironmentVariables.CLIENT_SECRET_VARS): + self._credential = ClientSecretCredential( + client_id=os.environ[EnvironmentVariables.AZURE_CLIENT_ID], + secret=os.environ[EnvironmentVariables.AZURE_CLIENT_SECRET], + tenant_id=os.environ[EnvironmentVariables.AZURE_TENANT_ID], + **kwargs + ) + elif all(os.environ.get(v) is not None for v in EnvironmentVariables.CERT_VARS): + self._credential = CertificateCredential( + client_id=os.environ[EnvironmentVariables.AZURE_CLIENT_ID], + tenant_id=os.environ[EnvironmentVariables.AZURE_TENANT_ID], + certificate_path=os.environ[EnvironmentVariables.AZURE_CLIENT_CERTIFICATE_PATH], + **kwargs + ) + + def get_token(self, *scopes): + # type: (*str) -> str + if not self._credential: + message = "Missing environment settings. To authenticate with a client secret, set {}. To authenticate with a certificate, set {}.".format( + ", ".join(EnvironmentVariables.CLIENT_SECRET_VARS), ", ".join(EnvironmentVariables.CERT_VARS) + ) + raise AuthenticationError(message) + return self._credential.get_token(*scopes) + + +class ManagedIdentityCredential(object): + """factory for MSI and IMDS credentials""" + + def __new__(cls, *args, **kwargs): + if os.environ.get(MSI_SECRET) and os.environ.get(MSI_ENDPOINT): + return MsiCredential(*args, **kwargs) + return ImdsCredential(*args, **kwargs) + + @staticmethod + def create_config(**kwargs): + # type: (Dict[str, str]) -> Configuration + pass + + def get_token(self, *scopes): + # type: (*str) -> str + pass -class TokenCredentialChain: +class TokenCredentialChain(object): """A sequence of token credentials""" - def __init__(self, credentials): - # type: (Iterable[SupportsGetToken]) -> None + def __init__(self, *credentials): + # type: (*TokenCredential) -> None if not credentials: raise ValueError("at least one credential is required") self._credentials = credentials - def get_token(self, scopes): - # type: (Iterable[str]) -> str + def get_token(self, *scopes): + # type: (*str) -> str """Attempts to get a token from each credential, in order, returning the first token. If no token is acquired, raises an exception listing error messages. """ history = [] for credential in self._credentials: try: - return credential.get_token(scopes) + return credential.get_token(*scopes) except AuthenticationError as ex: history.append((credential, ex.message)) except Exception as ex: # pylint: disable=broad-except diff --git a/sdk/identity/azure-identity/azure/identity/exceptions.py b/sdk/identity/azure-identity/azure/identity/exceptions.py index f3edd0b45dee..672feb69be57 100644 --- a/sdk/identity/azure-identity/azure/identity/exceptions.py +++ b/sdk/identity/azure-identity/azure/identity/exceptions.py @@ -3,13 +3,8 @@ # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- +from azure.core.exceptions import AzureError -# TODO: probably a better base for this in azure-core -class AuthenticationError(Exception): - def __init__(self, message): - # type: (str) -> None - self.message = message - - def __str__(self): - return self.message +class AuthenticationError(AzureError): + pass diff --git a/sdk/identity/azure-identity/azure/identity/version.py b/sdk/identity/azure-identity/azure/identity/version.py index 937c2e059114..c78e131faf62 100644 --- a/sdk/identity/azure-identity/azure/identity/version.py +++ b/sdk/identity/azure-identity/azure/identity/version.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- -VERSION = "0.0.1" +VERSION = "0.1.0" diff --git a/sdk/identity/azure-identity/dev_requirements.txt b/sdk/identity/azure-identity/dev_requirements.txt index e30ad303788a..4ac84a358c64 100644 --- a/sdk/identity/azure-identity/dev_requirements.txt +++ b/sdk/identity/azure-identity/dev_requirements.txt @@ -1 +1,2 @@ +-e ../../core/azure-core typing_extensions>=3.7.2 diff --git a/sdk/identity/azure-identity/setup.py b/sdk/identity/azure-identity/setup.py index dab4f6d8e050..a76a2f21c32b 100644 --- a/sdk/identity/azure-identity/setup.py +++ b/sdk/identity/azure-identity/setup.py @@ -5,7 +5,6 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- - import re import os.path from io import open @@ -37,27 +36,28 @@ # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "version.py"), "r") as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) + VERSION = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) -if not version: +if not VERSION: raise RuntimeError("Cannot find version information") -# with open('README.rst', encoding='utf-8') as f: -# readme = f.read() +with open("README.md", encoding="utf-8") as f: + README = f.read() # with open('HISTORY.rst', encoding='utf-8') as f: # history = f.read() setup( name=PACKAGE_NAME, - version=version, + version=VERSION, description="Microsoft Azure {} Library for Python".format(PACKAGE_PPRINT_NAME), - # long_description=readme + '\n\n' + history, + long_description=README, + long_description_content_type="text/markdown", license="MIT License", author="Microsoft Corporation", # author_email='', url="https://github.com/Azure/azure-sdk-for-python", classifiers=[ - "Development Status :: 2 - Pre-Alpha", + "Development Status :: 4 - Beta", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", @@ -76,10 +76,9 @@ "azure", ] ), - install_requires=["azure-core~=1.0.0", "msal>=0.3.1"], - extras_require={ - ":python_version<'3.0'": ["azure-nspkg"], - ":python_version<'3.4'": ["enum34>=1.0.4"], - ":python_version<'3.5'": ["typing"], - }, + install_requires=[ + # "azure-core~=1.0.0", TODO: commented until azure-core is published + "msal~=0.3.1" + ], + extras_require={":python_version<'3.0'": ["azure-nspkg"]}, ) diff --git a/sdk/identity/azure-identity/tests/conftest.py b/sdk/identity/azure-identity/tests/conftest.py index 01957ae3dd87..807b28d514bc 100644 --- a/sdk/identity/azure-identity/tests/conftest.py +++ b/sdk/identity/azure-identity/tests/conftest.py @@ -2,10 +2,12 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. -# -------------------------------------------------------------------------- +# ------------------------------------------------------------------------- import sys +# IMDS tests must be run explicitly +collect_ignore_glob = ["*imds*"] + # Ignore collection of async tests for Python 2 -collect_ignore = [] if sys.version_info < (3, 5): - collect_ignore.append("test_identity_async.py") + collect_ignore_glob.append("*_async.py") diff --git a/sdk/identity/azure-identity/tests/private-key.pem b/sdk/identity/azure-identity/tests/private-key.pem new file mode 100644 index 000000000000..636550d834dd --- /dev/null +++ b/sdk/identity/azure-identity/tests/private-key.pem @@ -0,0 +1,35 @@ +Bag Attributes + Microsoft Local Key set: + localKeyID: 01 00 00 00 + friendlyName: te-6c7ca2ba-5bec-4802-bde3-1755fb26d651 + Microsoft CSP Name: Microsoft Software Key Storage Provider +Key Attributes + X509v3 Key Usage: 90 +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDZnnXDSPMKmbA+ +Lx+iZio78D0RS61lP5UfRQJU4NMnZhA1qEdVsvQfR+24eN4U34zXYsHMGP57NVRT +GYpy842oH6XAJ3uq59FgkO7NB6z1FXqnFbfAese+mssSlXtc91Ach4BpePk2/umO +eCZp/7l0pQPKMrawY8z7zogTnegAIwSDvVeGU0Zap4WPRMmMDAE38s7i0Dfxa1kh +9/TXvH/x6/+uNIyTIZ8PMH2uv9w/LNex4vh+Pw8jwo5XdVRXRessdMt2I3dVUtkw +AGHh1TA9Qkflji9tXjv3r2nRHqMLcqhPeIDJVkqUIqSiINQ61gy7CdkMxalp0MxE +6Mjo7eBpAgMBAAECggEAdv0XsvGeQnuKTFYD3A40pZVULrLMWoILjY90GOjdS7uY +vV4HsyooJTp1Ftqvw4YAQnyzLl+0NbYRJ2bdtsDJAdZcENcF3Yrnhv94Mw8xWMin +ydgsIsh/kw6cXsrxKwHnAdJtOj51Ncbn+YhkqKy0wLzBd7uG/Kd1G3HwIZnDkt6Q +E6J4G0u9atEX7pvV8/JBK3QxAZoOo1FkOO2IDk92z85G9+7GysDRssu6erzihX/b +/fG/DVx1vjeZz1jUC3rIbOhEmq1To0FdOlyRT79IW0RZWRNFAEaFE9sNYR4ZSsgZ +Bwznp1vwtwefPk31WJkGf+WRUERhG8vycOVOBErXCQKBgQD8fgO9JSESdOm8QIHt +kbqzA+IdyOL7lnK8SdWNiCqdX3e7ZokbYhlUvj6Hf3gGQUTHwTvGa2LIifrSo7jh +VvO7kIBRg7eMhK6mZMArEINFqEjlqnC5w+Js7hrhjMwPjwIzmcZ3R9GVWl1aq543 +Q8S+0aByxd7HKGG2DOtcdZxW1wKBgQDcpGtKslM3ql7hIMigrwg2vpB7OOj2P4Ja +cfY/DE4NJ+ZlAzPyDy/Hho7oSxb9ez0xxpOVz5/FpU0Ve1YfRU/41LAndHjudE3z +sxr7TjGcNS6Ao9790RCqtuE1LipaJ+pKvMS/4J94EM3jbpfZB0Dckmk0gz4lTvUM +5ZedRpravwKBgQDIfyRm6PnnFxGX3D2QMb1oc7f1YNTlZSV84MCEX9E/IFUKabSM +Gwz0XxF2NUFQ7jk4yfe2awWJKxASfdHMlmh605cho494NNAe7zgtujITeTtRrFNR +H/xH9ZdA7bYI0M21vfF8PHpvt88Ttd2wEs9Dm2BmYzuxOB7HGmE3DWl1BwKBgQCJ +1B+9wpWfYUrxoRQS5CPiZrpEbzF/mf6o1yW3Ds23BCS1FwIdBIWZQyIEU9vhrll0 +vZI19EPfKDp139zVneuuCdacXvKoKnkDce+56oetB7+r1jIXJcEeky0tllAYj3SZ +CUByiDO1wfGLT+uFRDWtU7xqdE2e6qrDSqyiL5fOawKBgDkkyj0ayZnxcMGgM5W6 +g1bwx5q3Kjc0FzGd8cmO5BLmxW8sCcQykOoZb42qmlGEJU0Q8ppiz82xmI7l+Sml +QdVTbroI9ECxwRFX97pu8gBR4rI1lyfCllI3Pm2Y6cvapki0eq+1jEReSclsyMK9 +mvgSQ07XbJjrqb6hJJo6iLmh +-----END PRIVATE KEY----- diff --git a/sdk/identity/azure-identity/tests/test_identity.py b/sdk/identity/azure-identity/tests/test_identity.py index a6ef08e2e1b8..c35b8de141d2 100644 --- a/sdk/identity/azure-identity/tests/test_identity.py +++ b/sdk/identity/azure-identity/tests/test_identity.py @@ -2,22 +2,30 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. -# -------------------------------------------------------------------------- +# ------------------------------------------------------------------------- import json +import os import time import uuid try: - from unittest.mock import Mock, MagicMock + from unittest.mock import Mock except ImportError: # python < 3.3 from mock import Mock import pytest -import requests -from azure.identity import AuthenticationError, ClientSecretCredential, TokenCredentialChain - - -def test_client_secret_credential_cache(monkeypatch): +from azure.identity import ( + AuthenticationError, + ClientSecretCredential, + DefaultAzureCredential, + EnvironmentCredential, + TokenCredentialChain, +) +from azure.identity._internal import ImdsCredential, MsiCredential +from azure.identity.constants import EnvironmentVariables, MSI_ENDPOINT, MSI_SECRET + + +def test_client_secret_credential_cache(): expired = "this token's expired" now = time.time() token_payload = { @@ -30,21 +38,79 @@ def test_client_secret_credential_cache(monkeypatch): "resource": str(uuid.uuid1()), } - # monkeypatch requests so we can test pipeline configuration - mock_response = Mock(text=json.dumps(token_payload), headers={"content-type": "application/json"}, status_code=200) + mock_response = Mock( + text=lambda: json.dumps(token_payload), + headers={"content-type": "application/json"}, + status_code=200, + content_type=["application/json"], + ) mock_send = Mock(return_value=mock_response) - monkeypatch.setattr(requests.Session, "send", value=mock_send) - credential = ClientSecretCredential("client_id", "secret", tenant_id=str(uuid.uuid1())) + credential = ClientSecretCredential( + "client_id", "secret", tenant_id=str(uuid.uuid1()), transport=Mock(send=mock_send) + ) scopes = ("https://foo.bar/.default", "https://bar.qux/.default") - token = credential.get_token(scopes) + token = credential.get_token(*scopes) assert token == expired - token = credential.get_token(scopes) + token = credential.get_token(*scopes) assert token == expired assert mock_send.call_count == 2 +def test_client_secret_environment_credential(monkeypatch): + client_id = "fake-client-id" + secret = "fake-client-secret" + tenant_id = "fake-tenant-id" + + monkeypatch.setenv(EnvironmentVariables.AZURE_CLIENT_ID, client_id) + monkeypatch.setenv(EnvironmentVariables.AZURE_CLIENT_SECRET, secret) + monkeypatch.setenv(EnvironmentVariables.AZURE_TENANT_ID, tenant_id) + + success_message = "request passed validation" + + def validate_request(request, **kwargs): + assert tenant_id in request.url + assert request.data["client_id"] == client_id + assert request.data["client_secret"] == secret + # raising here makes mocking a transport response unnecessary + raise AuthenticationError(success_message) + + credential = EnvironmentCredential(transport=Mock(send=validate_request)) + with pytest.raises(AuthenticationError) as ex: + credential.get_token("scope") + assert str(ex.value) == success_message + + +def test_cert_environment_credential(monkeypatch): + client_id = "fake-client-id" + pem_path = os.path.join(os.path.dirname(__file__), "private-key.pem") + tenant_id = "fake-tenant-id" + + monkeypatch.setenv(EnvironmentVariables.AZURE_CLIENT_ID, client_id) + monkeypatch.setenv(EnvironmentVariables.AZURE_CLIENT_CERTIFICATE_PATH, pem_path) + monkeypatch.setenv(EnvironmentVariables.AZURE_TENANT_ID, tenant_id) + + success_message = "request passed validation" + + def validate_request(request, **kwargs): + assert tenant_id in request.url + assert request.data["client_id"] == client_id + assert request.data["grant_type"] == "client_credentials" + # raising here makes mocking a transport response unnecessary + raise AuthenticationError(success_message) + + credential = EnvironmentCredential(transport=Mock(send=validate_request)) + with pytest.raises(AuthenticationError) as ex: + credential.get_token("scope") + assert str(ex.value) == success_message + + +def test_environment_credential_error(): + with pytest.raises(AuthenticationError): + EnvironmentCredential().get_token("scope") + + def test_credential_chain_error_message(): def raise_authn_error(message): raise AuthenticationError(message) @@ -55,7 +121,7 @@ def raise_authn_error(message): second_credential = Mock(name="second_credential", get_token=lambda _: raise_authn_error(second_error)) with pytest.raises(AuthenticationError) as ex: - TokenCredentialChain([first_credential, second_credential]).get_token(("scope",)) + TokenCredentialChain(first_credential, second_credential).get_token("scope") assert "ClientSecretCredential" in ex.value.message assert first_error in ex.value.message @@ -72,7 +138,7 @@ def raise_authn_error(message="it didn't work"): Mock(get_token=Mock(return_value="token")), ] - TokenCredentialChain(credentials).get_token(("scope",)) + TokenCredentialChain(*credentials).get_token("scope") for credential in credentials: assert credential.get_token.call_count == 1 @@ -83,8 +149,95 @@ def test_chain_returns_first_token(): first_credential = Mock(get_token=lambda _: expected_token) second_credential = Mock(get_token=Mock()) - aggregate = TokenCredentialChain([first_credential, second_credential]) - credential = aggregate.get_token(("scope",)) + aggregate = TokenCredentialChain(first_credential, second_credential) + credential = aggregate.get_token("scope") assert credential is expected_token assert second_credential.get_token.call_count == 0 + + +def test_imds_credential_cache(): + scope = "https://foo.bar" + expired = "this token's expired" + now = int(time.time()) + token_payload = { + "access_token": expired, + "refresh_token": "", + "expires_in": 0, + "expires_on": now - 300, # expired 5 minutes ago + "not_before": now, + "resource": scope, + "token_type": "Bearer", + } + + mock_response = Mock( + text=lambda: json.dumps(token_payload), + headers={"content-type": "application/json"}, + status_code=200, + content_type=["application/json"], + ) + mock_send = Mock(return_value=mock_response) + + credential = ImdsCredential(transport=Mock(send=mock_send)) + token = credential.get_token(scope) + assert token == expired + assert mock_send.call_count == 1 + + # calling get_token again should provoke another HTTP request + good_for_an_hour = "this token's good for an hour" + token_payload["expires_on"] = int(time.time()) + 3600 + token_payload["expires_in"] = 3600 + token_payload["access_token"] = good_for_an_hour + token = credential.get_token(scope) + assert token == good_for_an_hour + assert mock_send.call_count == 2 + + # get_token should return the cached token now + token = credential.get_token(scope) + assert token == good_for_an_hour + assert mock_send.call_count == 2 + + +def test_imds_credential_retries(): + mock_response = Mock( + text=lambda: b"", + headers={"content-type": "application/json", "Retry-After": "0"}, + status_code=200, + content_type=["application/json"], + ) + mock_send = Mock(return_value=mock_response) + + retry_total = 1 + credential = ImdsCredential(retry_total=retry_total, transport=Mock(send=mock_send)) + + for status_code in (404, 429, 500): + mock_response.status_code = status_code + try: + credential.get_token("scope") + except AuthenticationError: + pass + assert mock_send.call_count is 1 + retry_total + mock_send.reset_mock() + + +def test_msi_credential(monkeypatch): + msi_secret = "secret" + monkeypatch.setenv(MSI_SECRET, msi_secret) + monkeypatch.setenv(MSI_ENDPOINT, "https://foo.bar") + + success_message = "test passed" + + def validate_request(req, *args, **kwargs): + assert req.url.startswith(os.environ[MSI_ENDPOINT]) + assert req.headers["secret"] == msi_secret + exception = Exception() + exception.message = success_message + raise exception + + with pytest.raises(Exception) as ex: + MsiCredential(transport=Mock(send=validate_request)).get_token("https://scope") + assert ex.value.message is success_message + + +def test_default_credential(): + DefaultAzureCredential() diff --git a/sdk/identity/azure-identity/tests/test_identity_async.py b/sdk/identity/azure-identity/tests/test_identity_async.py index 2bf6b867fe29..5ee43083f356 100644 --- a/sdk/identity/azure-identity/tests/test_identity_async.py +++ b/sdk/identity/azure-identity/tests/test_identity_async.py @@ -2,20 +2,28 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. -# -------------------------------------------------------------------------- +# ------------------------------------------------------------------------- import asyncio import json +import os import time from unittest.mock import Mock import uuid import pytest -import requests -from azure.identity import AuthenticationError, AsyncClientSecretCredential, AsyncTokenCredentialChain +from azure.identity import ( + AuthenticationError, + AsyncClientSecretCredential, + AsyncDefaultAzureCredential, + AsyncEnvironmentCredential, + AsyncTokenCredentialChain, +) +from azure.identity.aio._internal import AsyncImdsCredential, AsyncMsiCredential +from azure.identity.constants import EnvironmentVariables, MSI_ENDPOINT, MSI_SECRET @pytest.mark.asyncio -async def test_client_secret_credential_cache(monkeypatch): +async def test_client_secret_credential_cache(): expired = "this token's expired" now = time.time() token_payload = { @@ -28,35 +36,96 @@ async def test_client_secret_credential_cache(monkeypatch): "resource": str(uuid.uuid1()), } - # monkeypatch requests so we can test pipeline configuration - mock_response = Mock(text=json.dumps(token_payload), headers={"content-type": "application/json"}, status_code=200) + mock_response = Mock( + text=lambda: json.dumps(token_payload), + headers={"content-type": "application/json"}, + status_code=200, + content_type=["application/json"], + ) mock_send = Mock(return_value=mock_response) - monkeypatch.setattr(requests.Session, "send", value=mock_send) - credential = AsyncClientSecretCredential("client_id", "secret", tenant_id=str(uuid.uuid1())) + credential = AsyncClientSecretCredential( + "client_id", "secret", tenant_id=str(uuid.uuid1()), transport=Mock(send=asyncio.coroutine(mock_send)) + ) scopes = ("https://foo.bar/.default", "https://bar.qux/.default") - token = await credential.get_token(scopes) + token = await credential.get_token(*scopes) assert token == expired - token = await credential.get_token(scopes) + token = await credential.get_token(*scopes) assert token == expired assert mock_send.call_count == 2 +@pytest.mark.asyncio +async def test_cert_environment_credential(monkeypatch): + client_id = "fake-client-id" + pem_path = os.path.join(os.path.dirname(__file__), "private-key.pem") + tenant_id = "fake-tenant-id" + + monkeypatch.setenv(EnvironmentVariables.AZURE_CLIENT_ID, client_id) + monkeypatch.setenv(EnvironmentVariables.AZURE_CLIENT_CERTIFICATE_PATH, pem_path) + monkeypatch.setenv(EnvironmentVariables.AZURE_TENANT_ID, tenant_id) + + success_message = "request passed validation" + + def validate_request(request, **kwargs): + assert tenant_id in request.url + assert request.data["client_id"] == client_id + assert request.data["grant_type"] == "client_credentials" + # raising here makes mocking a transport response unnecessary + raise AuthenticationError(success_message) + + credential = AsyncEnvironmentCredential(transport=Mock(send=validate_request)) + with pytest.raises(AuthenticationError) as ex: + await credential.get_token("scope") + assert str(ex.value) == success_message + + +@pytest.mark.asyncio +async def test_client_secret_environment_credential(monkeypatch): + client_id = "fake-client-id" + secret = "fake-client-secret" + tenant_id = "fake-tenant-id" + + monkeypatch.setenv(EnvironmentVariables.AZURE_CLIENT_ID, client_id) + monkeypatch.setenv(EnvironmentVariables.AZURE_CLIENT_SECRET, secret) + monkeypatch.setenv(EnvironmentVariables.AZURE_TENANT_ID, tenant_id) + + success_message = "request passed validation" + + def validate_request(request, **kwargs): + assert tenant_id in request.url + assert request.data["client_id"] == client_id + assert request.data["client_secret"] == secret + # raising here makes mocking a transport response unnecessary + raise AuthenticationError(success_message) + + credential = AsyncEnvironmentCredential(transport=Mock(send=validate_request)) + with pytest.raises(AuthenticationError) as ex: + await credential.get_token("scope") + assert str(ex.value) == success_message + + +@pytest.mark.asyncio +async def test_environment_credential_error(): + with pytest.raises(AuthenticationError): + await AsyncEnvironmentCredential().get_token("scope") + + @pytest.mark.asyncio async def test_credential_chain_error_message(): - async def raise_authn_error(message): + def raise_authn_error(message): raise AuthenticationError(message) first_error = "first_error" first_credential = Mock(spec=AsyncClientSecretCredential, get_token=lambda _: raise_authn_error(first_error)) second_error = "second_error" - second_credential = Mock(get_token=lambda _: raise_authn_error(second_error)) + second_credential = Mock(name="second_credential", get_token=lambda _: raise_authn_error(second_error)) with pytest.raises(AuthenticationError) as ex: - await AsyncTokenCredentialChain([first_credential, second_credential]).get_token(("scope",)) + await AsyncTokenCredentialChain(first_credential, second_credential).get_token("scope") - assert "AsyncClientSecretCredential" in ex.value.message + assert "ClientSecretCredential" in ex.value.message assert first_error in ex.value.message assert second_error in ex.value.message @@ -73,7 +142,7 @@ async def raise_authn_error(message="it didn't work"): Mock(get_token=asyncio.coroutine(lambda _: expected_token)), ] - token = await AsyncTokenCredentialChain(credentials).get_token(("scope",)) + token = await AsyncTokenCredentialChain(*credentials).get_token("scope") assert token is expected_token for credential in credentials[:-1]: @@ -86,8 +155,98 @@ async def test_chain_returns_first_token(): first_credential = Mock(get_token=asyncio.coroutine(lambda _: expected_token)) second_credential = Mock(get_token=Mock()) - aggregate = AsyncTokenCredentialChain([first_credential, second_credential]) - credential = await aggregate.get_token(("scope",)) + aggregate = AsyncTokenCredentialChain(first_credential, second_credential) + credential = await aggregate.get_token("scope") assert credential is expected_token assert second_credential.get_token.call_count == 0 + + +@pytest.mark.asyncio +async def test_imds_credential_cache(): + scope = "https://foo.bar" + expired = "this token's expired" + now = int(time.time()) + token_payload = { + "access_token": expired, + "refresh_token": "", + "expires_in": 0, + "expires_on": now - 300, # expired 5 minutes ago + "not_before": now, + "resource": scope, + "token_type": "Bearer", + } + + mock_response = Mock( + text=lambda: json.dumps(token_payload), + headers={"content-type": "application/json"}, + status_code=200, + content_type=["application/json"], + ) + mock_send = Mock(return_value=mock_response) + + credential = AsyncImdsCredential(transport=Mock(send=asyncio.coroutine(mock_send))) + token = await credential.get_token(scope) + assert token == expired + assert mock_send.call_count == 1 + + # calling get_token again should provoke another HTTP request + good_for_an_hour = "this token's good for an hour" + token_payload["expires_on"] = int(time.time()) + 3600 + token_payload["expires_in"] = 3600 + token_payload["access_token"] = good_for_an_hour + token = await credential.get_token(scope) + assert token == good_for_an_hour + assert mock_send.call_count == 2 + + # get_token should return the cached token now + token = await credential.get_token(scope) + assert token == good_for_an_hour + assert mock_send.call_count == 2 + + +@pytest.mark.asyncio +async def test_imds_credential_retries(): + mock_response = Mock( + text=lambda: b"", + headers={"content-type": "application/json", "Retry-After": "0"}, + status_code=200, + content_type=["application/json"], + ) + mock_send = Mock(return_value=mock_response) + + retry_total = 1 + credential = AsyncImdsCredential(retry_total=retry_total, transport=Mock(send=asyncio.coroutine(mock_send))) + + for status_code in (404, 429, 500): + mock_response.status_code = status_code + try: + await credential.get_token("scope") + except AuthenticationError: + pass + assert mock_send.call_count is 1 + retry_total + mock_send.reset_mock() + + +@pytest.mark.asyncio +async def test_msi_credential(monkeypatch): + msi_secret = "secret" + monkeypatch.setenv(MSI_SECRET, msi_secret) + monkeypatch.setenv(MSI_ENDPOINT, "https://foo.bar") + + success_message = "test passed" + + async def validate_request(req, *args, **kwargs): + assert req.url.startswith(os.environ[MSI_ENDPOINT]) + assert req.headers["secret"] == msi_secret + exception = Exception() + exception.message = success_message + raise exception + + with pytest.raises(Exception) as ex: + await AsyncMsiCredential(transport=Mock(send=validate_request)).get_token("https://scope") + assert ex.value.message is success_message + + +def test_default_credential(): + AsyncDefaultAzureCredential() diff --git a/sdk/identity/azure-identity/tests/test_imds.py b/sdk/identity/azure-identity/tests/test_imds.py new file mode 100644 index 000000000000..ddc624d6198d --- /dev/null +++ b/sdk/identity/azure-identity/tests/test_imds.py @@ -0,0 +1,12 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# ------------------------------------------------------------------------- +from azure.identity._internal import ImdsCredential + + +def test_imds_credential(): + credential = ImdsCredential() + token = credential.get_token("https://management.azure.com/.default") + assert token diff --git a/sdk/identity/azure-identity/tests/test_imds_async.py b/sdk/identity/azure-identity/tests/test_imds_async.py new file mode 100644 index 000000000000..e9d2571bdebe --- /dev/null +++ b/sdk/identity/azure-identity/tests/test_imds_async.py @@ -0,0 +1,15 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# ------------------------------------------------------------------------- +import pytest + +from azure.identity.aio._internal import AsyncImdsCredential + + +@pytest.mark.asyncio +async def test_imds_credential_async(): + credential = AsyncImdsCredential() + token = await credential.get_token("https://management.azure.com/.default") + assert token diff --git a/sdk/iothub/azure-mgmt-iotcentral/dev_requirements.txt b/sdk/iothub/azure-mgmt-iotcentral/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/iothub/azure-mgmt-iotcentral/dev_requirements.txt +++ b/sdk/iothub/azure-mgmt-iotcentral/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/iothub/azure-mgmt-iothub/dev_requirements.txt b/sdk/iothub/azure-mgmt-iothub/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/iothub/azure-mgmt-iothub/dev_requirements.txt +++ b/sdk/iothub/azure-mgmt-iothub/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/keyvault/azure-keyvault/dev_requirements.txt b/sdk/keyvault/azure-keyvault/dev_requirements.txt index 323eb1aa4e98..79c58888326b 100644 --- a/sdk/keyvault/azure-keyvault/dev_requirements.txt +++ b/sdk/keyvault/azure-keyvault/dev_requirements.txt @@ -1,4 +1,4 @@ -e ../../authorization/azure-mgmt-authorization -e ../../core/azure-core -e ../azure-mgmt-keyvault --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/keyvault/azure-mgmt-keyvault/dev_requirements.txt b/sdk/keyvault/azure-mgmt-keyvault/dev_requirements.txt index 8ffd9e3035d1..f6457a93d5e8 100644 --- a/sdk/keyvault/azure-mgmt-keyvault/dev_requirements.txt +++ b/sdk/keyvault/azure-mgmt-keyvault/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/__init__.py b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/__init__.py index 5f45ea2182a5..0b3dd35321d4 100644 --- a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/__init__.py +++ b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/__init__.py @@ -3,9 +3,11 @@ # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- +from .keys._client import KeyClient +from .secrets._client import SecretClient from .vault_client import VaultClient from .version import VERSION -__all__ = ["VaultClient"] +__all__ = ["VaultClient", "KeyClient", "SecretClient"] __version__ = VERSION diff --git a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/_internal.py b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/_internal.py index 871a4e6ec401..00396276606a 100644 --- a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/_internal.py +++ b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/_internal.py @@ -3,19 +3,34 @@ # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- -from azure.core.pipeline.policies import HTTPPolicy +from collections import namedtuple +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + # pylint:disable=unused-import + from typing import Any, Mapping, Optional + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpTransport try: import urllib.parse as parse except ImportError: import urlparse as parse # pylint: disable=import-error -from collections import namedtuple +from azure.core import Configuration +from azure.core.pipeline import Pipeline +from azure.core.pipeline.policies import BearerTokenCredentialPolicy, HTTPPolicy +from azure.core.pipeline.transport import RequestsTransport + +from ._generated import KeyVaultClient _VaultId = namedtuple("VaultId", ["vault_url", "collection", "name", "version"]) +KEY_VAULT_SCOPE = "https://vault.azure.net/.default" + + def _parse_vault_id(url): try: parsed_uri = parse.urlparse(url) @@ -37,13 +52,67 @@ def _parse_vault_id(url): ) -# TODO: integrate with azure.core -class _BearerTokenCredentialPolicy(HTTPPolicy): - def __init__(self, credentials): - self._credentials = credentials +class _KeyVaultClientBase(object): + """ + :param credential: A credential or credential provider which can be used to authenticate to the vault, + a ValueError will be raised if the entity is not provided + :type credential: azure.core.credentials.TokenCredential + :param str vault_url: The url of the vault to which the client will connect, + a ValueError will be raised if the entity is not provided + :param ~azure.core.configuration.Configuration config: The configuration for the KeyClient + """ + + @staticmethod + def create_config(credential, api_version=None, **kwargs): + # type: (TokenCredential, Optional[str], Mapping[str, Any]) -> Configuration + if api_version is None: + api_version = KeyVaultClient.DEFAULT_API_VERSION + config = KeyVaultClient.get_configuration_class(api_version, aio=False)(credential, **kwargs) + config.authentication_policy = BearerTokenCredentialPolicy(credential, KEY_VAULT_SCOPE) + return config + + def __init__(self, vault_url, credential, config=None, transport=None, api_version=None, **kwargs): + # type: (str, TokenCredential, Configuration, Optional[HttpTransport], Optional[str], **Any) -> None + if not credential: + raise ValueError( + "credential should be an object supporting the TokenCredential protocol, such as a credential from azure-identity" + ) + if not vault_url: + raise ValueError("vault_url must be the URL of an Azure Key Vault") + + self._vault_url = vault_url.strip(" /") + + client = kwargs.pop("generated_client", None) + if client: + # caller provided a configured client -> nothing left to initialize + self._client = client + return + + if api_version is None: + api_version = KeyVaultClient.DEFAULT_API_VERSION + + config = config or self.create_config(credential, api_version=api_version, **kwargs) + pipeline = kwargs.pop("pipeline", None) or self._build_pipeline(config, transport) + self._client = KeyVaultClient(credential, api_version=api_version, pipeline=pipeline, aio=False, **kwargs) + + def _build_pipeline(self, config, transport): + # type: (Configuration, HttpTransport) -> Pipeline + policies = [ + config.headers_policy, + config.user_agent_policy, + config.proxy_policy, + config.redirect_policy, + config.retry_policy, + config.authentication_policy, + config.logging_policy, + ] + + if transport is None: + transport = RequestsTransport(config) - def send(self, request, **kwargs): - auth_header = "Bearer " + self._credentials.token["access_token"] - request.http_request.headers["Authorization"] = auth_header + return Pipeline(transport, policies=policies) - return self.next.send(request, **kwargs) + @property + def vault_url(self): + # type: () -> str + return self._vault_url diff --git a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/_internal.py b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/_internal.py index e37f81029049..2337a97d5064 100644 --- a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/_internal.py +++ b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/_internal.py @@ -3,25 +3,112 @@ # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- -from typing import Any, Callable +from typing import Any, Callable, Mapping, Optional, TYPE_CHECKING + +if TYPE_CHECKING: + try: + from azure.core.credentials import TokenCredential + except ImportError: + # TokenCredential is a typing_extensions.Protocol; we don't depend on that package + pass from azure.core.async_paging import AsyncPagedMixin +from azure.core.configuration import Configuration +from azure.core.pipeline import AsyncPipeline +from azure.core.pipeline.policies import AsyncBearerTokenCredentialPolicy +from azure.core.pipeline.transport import AsyncioRequestsTransport, HttpTransport from msrest.serialization import Model +from .._generated import KeyVaultClient +from .._internal import KEY_VAULT_SCOPE + class AsyncPagingAdapter: """For each item in an AsyncPagedMixin, returns the result of applying fn to that item. Python 3.6 added syntax that could replace this (yield within async for).""" - def __init__(self, pages, fn): - # type: (AsyncPagedMixin, Callable[[Model], Any]) -> None + + def __init__(self, pages: AsyncPagedMixin, fn: Callable[[Model], Any]) -> None: self._pages = pages self._fn = fn def __aiter__(self): return self - async def __anext__(self): + async def __anext__(self) -> Any: item = await self._pages.__anext__() if not item: raise StopAsyncIteration return self._fn(item) + + +class _AsyncKeyVaultClientBase: + """ + :param credential: A credential or credential provider which can be used to authenticate to the vault, + a ValueError will be raised if the entity is not provided + :type credential: azure.authentication.Credential or azure.authentication.CredentialProvider + :param str vault_url: The url of the vault to which the client will connect, + a ValueError will be raised if the entity is not provided + :param ~azure.core.configuration.Configuration config: The configuration for the SecretClient + """ + + @staticmethod + def create_config( + credential: "TokenCredential", api_version: str = None, **kwargs: Mapping[str, Any] + ) -> Configuration: + if api_version is None: + api_version = KeyVaultClient.DEFAULT_API_VERSION + config = KeyVaultClient.get_configuration_class(api_version, aio=True)(credential, **kwargs) + config.authentication_policy = AsyncBearerTokenCredentialPolicy(credential, KEY_VAULT_SCOPE) + return config + + def __init__( + self, + vault_url: str, + credential: "TokenCredential", + config: Configuration = None, + transport: HttpTransport = None, + api_version: str = None, + **kwargs: Any + ) -> None: + if not credential: + raise ValueError( + "credential should be an object supporting the TokenCredential protocol, such as a credential from azure-identity" + ) + if not vault_url: + raise ValueError("vault_url must be the URL of an Azure Key Vault") + + self._vault_url = vault_url.strip(" /") + + client = kwargs.pop("generated_client", None) + if client: + # caller provided a configured client -> nothing left to initialize + self._client = client + return + + if api_version is None: + api_version = KeyVaultClient.DEFAULT_API_VERSION + + config = config or self.create_config(credential, api_version=api_version, **kwargs) + pipeline = kwargs.pop("pipeline", None) or self._build_pipeline(config, transport=transport) + self._client = KeyVaultClient(credential, api_version=api_version, pipeline=pipeline, aio=True) + + @staticmethod + def _build_pipeline(config: Configuration, transport: HttpTransport) -> AsyncPipeline: + policies = [ + config.headers_policy, + config.user_agent_policy, + config.proxy_policy, + config.redirect_policy, + config.retry_policy, + config.authentication_policy, + config.logging_policy, + ] + + if transport is None: + transport = AsyncioRequestsTransport(config) + + return AsyncPipeline(transport, policies=policies) + + @property + def vault_url(self) -> str: + return self._vault_url diff --git a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/keys/_client.py b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/keys/_client.py index 7d25ae01376f..e7a896214f68 100644 --- a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/keys/_client.py +++ b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/keys/_client.py @@ -3,31 +3,18 @@ # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Mapping, Optional, Dict, List from datetime import datetime +from typing import Any, AsyncIterable, Mapping, Optional, Dict, List -from azure.core.configuration import Configuration from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError -from azure.core.pipeline.transport import AsyncioRequestsTransport -from azure.core.pipeline import AsyncPipeline - -from azure.security.keyvault._internal import _BearerTokenCredentialPolicy -from azure.security.keyvault._generated import KeyVaultClient -from azure.security.keyvault.aio._internal import AsyncPagingAdapter +from .._internal import _AsyncKeyVaultClientBase, AsyncPagingAdapter from ...keys._models import Key, DeletedKey, KeyBase, KeyOperationResult -class KeyClient: +class KeyClient(_AsyncKeyVaultClientBase): """The KeyClient class defines a high level interface for managing keys in the specified vault. - - :param credentials: A credential or credential provider which can be used to authenticate to the vault, - a ValueError will be raised if the entity is not provided - :type credentials: azure.authentication.Credential or azure.authentication.CredentialProvider - :param str vault_url: The url of the vault to which the client will connect, - a ValueError will be raised if the entity is not provided - :param ~azure.core.configuration.Configuration config: The configuration for the KeyClient - + Example: .. literalinclude:: ../tests/test_examples_keys_async.py :start-after: [START create_key_client] @@ -37,38 +24,6 @@ class KeyClient: :caption: Creates a new instance of the Key client """ - @staticmethod - def create_config(**kwargs): - pass # TODO - - def __init__(self, vault_url, credentials, config=None, api_version=None, **kwargs): - if not credentials: - raise ValueError("credentials") - if not vault_url: - raise ValueError("vault_url") - self._vault_url = vault_url - if api_version is None: - api_version = KeyVaultClient.DEFAULT_API_VERSION - # TODO: need config to get default policies, config requires credentials but doesn't do anything with them - config = config or KeyVaultClient.get_configuration_class(api_version, aio=True)(credentials) - # TODO generated default pipeline should be fine when token policy isn't necessary - policies = [ - config.headers_policy, - config.user_agent_policy, - config.proxy_policy, - _BearerTokenCredentialPolicy(credentials), - config.redirect_policy, - config.retry_policy, - config.logging_policy, - ] - transport = AsyncioRequestsTransport(config) - pipeline = AsyncPipeline(transport, policies=policies) - self._client = KeyVaultClient(credentials, api_version=api_version, pipeline=pipeline, aio=True) - - @property - def vault_url(self) -> str: - return self._vault_url - async def get_key(self, name: str, version: Optional[str] = None, **kwargs: Mapping[str, Any]) -> Key: """Gets the public part of a stored key. @@ -146,7 +101,7 @@ async def create_key( :type tags: Dict[str, str] :returns: The created key :rtype: ~azure.security.keyvault.keys._models.Key - + Example: .. literalinclude:: ../tests/test_examples_keys_async.py :start-after: [START create_key] @@ -204,7 +159,7 @@ async def create_rsa_key( :type tags: Dict[str, str] :returns: The created key :rtype: ~azure.security.keyvault.keys._models.Key - + Example: .. literalinclude:: ../tests/test_examples_keys_async.py :start-after: [START create_rsa_key] @@ -356,7 +311,7 @@ async def update_key( def list_keys(self, **kwargs: Mapping[str, Any]) -> AsyncIterable[KeyBase]: """List keys in the specified vault. - + Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key @@ -367,7 +322,7 @@ def list_keys(self, **kwargs: Mapping[str, Any]) -> AsyncIterable[KeyBase]: :returns: An iterator like instance of KeyBase :rtype: typing.AsyncIterable[~azure.security.keyvault.keys._models.KeyBase] - + Example: .. literalinclude:: ../tests/test_examples_keys_async.py :start-after: [START list_keys] @@ -383,7 +338,7 @@ def list_keys(self, **kwargs: Mapping[str, Any]) -> AsyncIterable[KeyBase]: def list_key_versions(self, name: str, **kwargs: Mapping[str, Any]) -> AsyncIterable[KeyBase]: """Retrieves a list of individual key versions with the same key name. - + The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. @@ -392,7 +347,7 @@ def list_key_versions(self, name: str, **kwargs: Mapping[str, Any]) -> AsyncIter :returns: An iterator like instance of KeyBase :rtype: typing.AsyncIterable[~azure.security.keyvault.keys._models.KeyBase] - + Example: .. literalinclude:: ../tests/test_examples_keys_async.py :start-after: [START list_key_versions] @@ -409,7 +364,7 @@ def list_key_versions(self, name: str, **kwargs: Mapping[str, Any]) -> AsyncIter async def backup_key(self, name: str, **kwargs: Mapping[str, Any]) -> bytes: """Requests that a backup of the specified key be downloaded to the client. - + The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the @@ -424,7 +379,7 @@ async def backup_key(self, name: str, **kwargs: Mapping[str, Any]) -> bytes: another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission. - + :param name: The name of the key. :type name :return: The raw bytes of the key backup. @@ -444,7 +399,7 @@ async def backup_key(self, name: str, **kwargs: Mapping[str, Any]) -> bytes: async def restore_key(self, backup: bytes, **kwargs: Mapping[str, Any]) -> Key: """Restores a backed up key to a vault. - + Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. @@ -465,7 +420,7 @@ async def restore_key(self, backup: bytes, **kwargs: Mapping[str, Any]) -> Key: :returns: The restored key :rtype: ~azure.security.keyvault.keys._models.Key :raises: ~azure.core.exceptions.ResourceExistsError if the client failed to retrieve the key - + Example: .. literalinclude:: ../tests/test_examples_keys_async.py :start-after: [START restore_key] @@ -529,7 +484,7 @@ async def get_deleted_key(self, name: str, **kwargs: Mapping[str, Any]) -> Delet def list_deleted_keys(self, **kwargs: Mapping[str, Any]) -> AsyncIterable[DeletedKey]: """Lists the deleted keys in the specified vault. - + Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys @@ -556,12 +511,12 @@ def list_deleted_keys(self, **kwargs: Mapping[str, Any]) -> AsyncIterable[Delete async def purge_deleted_key(self, name: str, **kwargs: Mapping[str, Any]) -> None: """Permanently deletes the specified key. - + The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission. - + :param name: The name of the key :type name :returns: None @@ -579,7 +534,7 @@ async def purge_deleted_key(self, name: str, **kwargs: Mapping[str, Any]) -> Non async def recover_deleted_key(self, name: str, **kwargs: Mapping[str, Any]) -> Key: """Recovers the deleted key to its latest version. - + The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key @@ -591,7 +546,7 @@ async def recover_deleted_key(self, name: str, **kwargs: Mapping[str, Any]) -> K :type name: str :returns: The recovered deleted key :rtype: ~azure.security.keyvault.keys._models.Key - + Example: .. literalinclude:: ../tests/test_examples_keys_async.py :start-after: [START recover_deleted_key] diff --git a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/secrets/_client.py b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/secrets/_client.py index c07e694f5fd1..1b80226317bb 100644 --- a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/secrets/_client.py +++ b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/secrets/_client.py @@ -3,34 +3,20 @@ # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- +from datetime import datetime from typing import Any, AsyncIterable, Mapping, Optional, Dict -from azure.core.configuration import Configuration from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError -from azure.core.pipeline.policies import UserAgentPolicy, AsyncRetryPolicy, AsyncRedirectPolicy -from azure.core.pipeline.transport import AsyncioRequestsTransport -from azure.core.pipeline import AsyncPipeline - -from azure.security.keyvault._internal import _BearerTokenCredentialPolicy -from azure.security.keyvault._generated import KeyVaultClient -from azure.security.keyvault.aio._internal import AsyncPagingAdapter +from .._internal import _AsyncKeyVaultClientBase, AsyncPagingAdapter from ...secrets._models import Secret, DeletedSecret, SecretAttributes -from datetime import datetime # TODO: update all returns and raises -class SecretClient: +class SecretClient(_AsyncKeyVaultClientBase): """The SecretClient class defines a high level interface for managing secrets in the specified vault. - :param credentials: A credential or credential provider which can be used to authenticate to the vault, - a ValueError will be raised if the entity is not provided - :type credentials: azure.authentication.Credential or azure.authentication.CredentialProvider - :param str vault_url: The url of the vault to which the client will connect, - a ValueError will be raised if the entity is not provided - :param ~azure.core.configuration.Configuration config: The configuration for the SecretClient - Example: .. literalinclude:: ../tests/test_examples_keyvault.py :start-after: [START create_secret_client] @@ -40,44 +26,6 @@ class SecretClient: :caption: Creates a new instance of the Secret client """ - @staticmethod - def create_config(**kwargs): - pass # TODO - - def __init__(self, vault_url, credentials, config=None, api_version=None, **kwargs): - if not credentials: - raise ValueError("credentials") - - if not vault_url: - raise ValueError("vault_url") - - self._vault_url = vault_url - - if api_version is None: - api_version = KeyVaultClient.DEFAULT_API_VERSION - - # TODO: need config to get default policies, config requires credentials but doesn't do anything with them - config = config or KeyVaultClient.get_configuration_class(api_version, aio=True)(credentials) - - # TODO generated default pipeline should be fine when token policy isn't necessary - policies = [ - config.headers_policy, - config.user_agent_policy, - config.proxy_policy, - _BearerTokenCredentialPolicy(credentials), - config.redirect_policy, - config.retry_policy, - config.logging_policy, - ] - transport = AsyncioRequestsTransport(config) - pipeline = AsyncPipeline(transport, policies=policies) - - self._client = KeyVaultClient(credentials, api_version=api_version, pipeline=pipeline, aio=True) - - @property - def vault_url(self) -> str: - return self._vault_url - async def get_secret(self, name: str, version: str, **kwargs: Mapping[str, Any]) -> Secret: """Get a specified secret from the vault. @@ -152,10 +100,10 @@ async def set_secret( ) return Secret._from_secret_bundle(bundle) - async def update_secret_attributes( + async def update_secret( self, name: str, - version: str, + version: Optional[str] = None, content_type: Optional[str] = None, enabled: Optional[bool] = None, not_before: Optional[datetime] = None, @@ -186,8 +134,8 @@ async def update_secret_attributes( Example: .. literalinclude:: ../tests/test_examples_keyvault_async.py - :start-after: [START update_secret_attributes] - :end-before: [END update_secret_attributes] + :start-after: [START update_secret] + :end-before: [END update_secret] :language: python :dedent: 4 :caption: Updates the attributes associated with a specified secret in the key vault @@ -199,7 +147,7 @@ async def update_secret_attributes( bundle = await self._client.update_secret( self.vault_url, name, - secret_version=version, + secret_version=version or "", content_type=content_type, tags=tags, secret_attributes=attributes, diff --git a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/vault_client.py b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/vault_client.py index cc66d7fcb575..577681616a8f 100644 --- a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/vault_client.py +++ b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/aio/vault_client.py @@ -3,16 +3,37 @@ # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- +from typing import Any, Optional, TYPE_CHECKING +if TYPE_CHECKING: + try: + from azure.core.credentials import TokenCredential + except ImportError: + # TokenCredential is a typing_extensions.Protocol; we don't depend on that package + pass + +from azure.core import Configuration +from azure.core.pipeline.transport import HttpTransport + +from ._internal import _AsyncKeyVaultClientBase from .keys._client import KeyClient from .secrets._client import SecretClient -class VaultClient(object): - - def __init__(self, vault_url, credentials, config=None, **kwargs): - self.vault_url = vault_url - self._secrets = SecretClient(vault_url, credentials, config=config, **kwargs) - self._keys = KeyClient(vault_url, credentials, config=config, **kwargs) +class VaultClient(_AsyncKeyVaultClientBase): + def __init__( + self, + vault_url: str, + credential: "TokenCredential", + config: Configuration = None, + transport: HttpTransport = None, + api_version: str = None, + **kwargs: Any + ) -> None: + super(VaultClient, self).__init__( + vault_url, credential, config=config, transport=transport, api_version=api_version, **kwargs + ) + self._secrets = SecretClient(self.vault_url, credential, generated_client=self._client, **kwargs) + self._keys = KeyClient(self.vault_url, credential, generated_client=self._client, **kwargs) @property def secrets(self): @@ -33,4 +54,4 @@ def keys(self): # """ # :rtype: ~azure.keyvault.aio.certificates.CertificateClient` # """ - # pass \ No newline at end of file + # pass diff --git a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/certificates/__init__.py b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/certificates/__init__.py index 0e95a46f18f9..c690a5e0c3e0 100644 --- a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/certificates/__init__.py +++ b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/certificates/__init__.py @@ -1,5 +1,31 @@ -# ------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- + +from ._client import CertificateClient +from ._models import ( + Certificate, + CertificateBase, + DeletedCertificate, + CertificateOperation, + CertificatePolicy, + Contact, + Issuer, + IssuerBase, + LifetimeAction, +) + +__all__ = [ + "CertificateClient", + "CertificateBase", + "Certificate", + "DeletedCertificate", + "CertificatePolicy", + "Issuer", + "IssuerBase", + "Contact", + "CertificateOperation", + "LifetimeAction" +] diff --git a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/certificates/_client.py b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/certificates/_client.py new file mode 100644 index 000000000000..0bee4fcc929e --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/certificates/_client.py @@ -0,0 +1,177 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from typing import Any, Dict, Mapping, Optional, Iterator, List +from datetime import datetime +from .._generated.v7_0 import models +from .._internal import _KeyVaultClientBase +from ._models import ( + Certificate, + CertificateBase, + DeletedCertificate, + CertificatePolicy, + Issuer, + IssuerBase, + Contact, + CertificateOperation, +) + + +class CertificateClient(_KeyVaultClientBase): + + def create_certificate(self, name, policy, enabled=None, not_before=None, expires=None, tags=None, **kwargs): + # type: (str, models.CertificatePolicy, Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> CertificateOperation + pass + + def get_certificate(self, name, version=None, **kwargs): + # type: (str, Optional[str], Mapping[str, Any]) -> Certificate + pass + + def delete_certificate(self, name, **kwargs): + # type: (str, Mapping[str, Any]) -> DeletedCertificate + pass + + def get_deleted_certificate(self, name, **kwargs): + # type: (str, Mapping[str, Any]) -> DeletedCertificate + pass + + def purge_deleted_certificate(self, name, **kwargs): + # type: (str, Mapping[str, Any]) -> None + pass + + def recover_deleted_certificate(self, name, **kwargs): + # type: (str, Mapping[str, Any]) -> Certificate + pass + + def import_certificate( + self, + name, + base64_encoded_certificate, + password=None, + policy=None, + enabled=None, + not_before=None, + expires=None, + tags=None, + **kwargs + ): + # type: (str, str, Optional[str], Optional[models.CertificatePolicy], Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> Certificate + pass + + def get_certificate_policy(self, name, **kwargs): + # type: (str, Mapping[str, Any]) -> CertificatePolicy + pass + + def update_certificate_policy(self, name, policy, enabled=None, not_before=None, expires=None, tags=None, **kwargs): + # type: (str, models.CertificatePolicy, Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> CertificatePolicy + pass + + def update_certificate(self, name, version, not_before=None, expires=None, enabled=None, tags=None, **kwargs): + # type: (str, str, Optional[datetime], Optional[datetime], Optional[bool], Optional[Dict[str, str]], Mapping[str, Any]) -> Certificate + pass + + def merge_certificate( + self, name, x509_certificates, enabled=True, not_before=None, expires=None, tags=None, **kwargs + ): + # type: (str, List[str], Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> Certificate + pass + + def backup_certificate(self, name, **kwargs): + # type: (str, Mapping[str, Any]) -> bytes + pass + + def restore_certificate(self, backup, **kwargs): + # type: (bytes, Mapping[str, Any]) -> Certificate + pass + + def list_deleted_certificates(self, include_pending=None, **kwargs): + # type: (Optional[bool], Mapping[str, Any]) -> Iterator[DeletedCertificate] + pass + + def list_certificates(self, include_pending=None, **kwargs): + # type: (Optional[bool], Mapping[str, Any]) -> Iterator[CertificateBase] + pass + + def list_certificate_versions(self, name, **kwargs): + # type: (str, Mapping[str, Any]) -> Iterator[CertificateBase] + pass + + def create_contacts(self, contacts, **kwargs): + # type: (Iterator[Contact], Mapping[str, Any]) -> Iterator[Contact] + # TODO: rest api includes an id should it be returned? + pass + + def list_contacts(self, **kwargs): + # type: (Mapping[str, Any]) -> Iterator[Contact] + pass + + def delete_contacts(self, **kwargs): + # type: (Mapping[str, Any]) -> Iterator[Contact] + pass + + def get_certificate_operation(self, name, **kwargs): + # type: (str, Mapping[str, Any]) -> CertificateOperation + pass + + def delete_certificate_operation(self, name, **kwargs): + # type: (str, Mapping[str, Any]) -> CertificateOperation + pass + + def cancel_certificate_operation(self, name, cancellation_requested, **kwargs): + # type: (str, bool, Mapping[str, Any]) -> CertificateOperation + pass + + def get_pending_certificate_signing_request(self, name, **kwargs): + # type: (str, Mapping[str, Any]) -> str + pass + + def get_issuer(self, name, **kwargs): + # type: (str, Mapping[str, Any]) -> Issuer + pass + + def create_issuer( + self, + name, + provider, + account_id=None, + password=None, + organization_id=None, + admin_details=None, + enabled=None, + not_before=None, + expires=None, + tags=None, + **kwargs + ): + # type: (str, str, Optional[str], Optional[str], Optional[str], Optional[List[models.AdministratorDetails]], Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> Issuer + pass + + def update_issuer( + self, + name, + provider=None, + account_id=None, + password=None, + organization_id=None, + first_name=None, + last_name=None, + email=None, + phone=None, + enabled=True, + not_before=None, + expires=None, + tags=None, + **kwargs + ): + # type: (str, Optional[str], Optional[str], Optional[str], Optional[str], Optional[str], Optional[str], Optional[str], Optional[str], Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> Issuer + pass + + def delete_issuer(self, name, **kwargs): + # type: (str, Mapping[str, Any]) -> Issuer + pass + + def list_issuers(self, **kwargs): + # type: (Mapping[str, Any]) -> Iterator[IssuerBase] + pass diff --git a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/certificates/_models.py b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/certificates/_models.py new file mode 100644 index 000000000000..45f2ff4517be --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/certificates/_models.py @@ -0,0 +1,626 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +from datetime import datetime +from typing import Any, Dict, Mapping, Optional, List +from .._internal import _parse_vault_id +from .._generated.v7_0 import models + + +class AdministratorDetails(object): + """Details of the organization administrator of the certificate issuer. + :param first_name: First name. + :type first_name: str + :param last_name: Last name. + :type last_name: str + :param email: Email address. + :type email: str + :param phone: Phone number. + :type phone: str + """ + + def __init__(self, first_name=None, last_name=None, email=None, phone=None): + # type: (Optional[str], Optional[str], Optional[str], Optional[str]) -> None + self._first_name = first_name + self._last_name = last_name + self._phone = phone + self._email = email + + @classmethod + def _from_admin_details_bundle(cls, admin_details_bundle): + # type: (models.AdministratorDetails) -> AdministratorDetails + """Construct a AdministratorDetails from an autorest-generated AdministratorDetailsBundle""" + return cls( + email=admin_details_bundle.email_address, + first_name=admin_details_bundle.first_name, + last_name=admin_details_bundle.last_name, + phone=admin_details_bundle.phone, + ) + + @property + def email(self): + # type: () -> str + return self._email + + @property + def first_name(self): + # type: () -> str + return self._first_name + + @property + def last_name(self): + # type: () -> str + return self._last_name + + @property + def phone(self): + # type: () -> str + return self._phone + + +class Error(object): + """The key vault server error.""" + + def __init__(self, code=None, message=None, inner_error=None): + # type: (Optional[str], Optional[str], Optional[models.Error]) -> None + self._code = code + self._message = message + self._inner_error = inner_error + + @property + def code(self): + # type: () -> str + return self._code + + @property + def message(self): + # type: () -> str + return self._message + + @property + def inner_error(self): + # type: () -> models.Error + return self._inner_error + + +class CertificateBase(object): + def __init__(self, attributes, cert_id, thumbprint, **kwargs): + # type: (models.CertificateAttributes, str, bytes, Mapping[str, Any]) -> None + self._attributes = attributes + self._id = cert_id + self._vault_id = _parse_vault_id(cert_id) + self._thumbprint = thumbprint + self._tags = kwargs.get("tags", None) + + @classmethod + def _from_certificate_item(cls, certificate_item): + # type: (models.CertificateItem) -> Certificate + """Construct a Certificate from an autorest-generated CertificateItem""" + return cls( + attributes=certificate_item.attributes, + cert_id=certificate_item.id, + thumbprint=certificate_item.x509_thumbprint, + tags=certificate_item.tags, + ) + + @property + def id(self): + # type: () -> str + pass + + @property + def name(self): + # type: () -> str + return self._vault_id.name + + @property + def thumbprint(self): + # type: () -> bytes + return self._thumbprint + + @property + def enabled(self): + # type: () -> bool + return self._attributes.enabled + + @property + def not_before(self): + # type: () -> datetime + return self._attributes.not_before + + @property + def expires(self): + # type: () -> datetime + return self._attributes.expires + + @property + def created(self): + # type: () -> datetime + return self._attributes.created + + @property + def updated(self): + # type: () -> datetime + return self._attributes.updated + + @property + def recovery_level(self): + # type: () -> str + return self._attributes.recovery_level + + @property + def vault_url(self): + # type: () -> str + return self._vault_id.vault_url + + @property + def tags(self): + # type: () -> Dict[str, str] + return self._tags + + +class Certificate(CertificateBase): + def __init__(self, attributes, cert_id, thumbprint, kid, sid, policy, cer, **kwargs): + # type: (models.CertificateAttributes, str, bytes, str, str, CertificatePolicy, bytes, Mapping[str, Any]) -> None + super(Certificate, self).__init__(attributes, cert_id, thumbprint, **kwargs) + self._kid = kid + self._sid = sid + self._policy = policy + self._cer = cer + + @classmethod + def _from_certificate_bundle(cls, certificate_bundle): + # type: (models.CertificateBundle) -> Certificate + """Construct a Certificate from an autorest-generated CertificateBundle""" + return cls( + attributes=certificate_bundle.attributes, + cert_id=certificate_bundle.id, + thumbprint=certificate_bundle.x509_thumbprint, + kid=certificate_bundle.kid, + sid=certificate_bundle.sid, + policy=CertificatePolicy._from_certificate_policy_bundle(certificate_bundle.policy), + cer=certificate_bundle.cer, + tags=certificate_bundle.tags, + ) + + @property + def kid(self): + # type: () -> str + return self._kid + + @property + def sid(self): + # type: () -> str + return self._sid + + @property + def policy(self): + # type: () -> models.CertificatePolicy + return self._policy + + @property + def cer(self): + # type: () -> bytes + return self._cer + + +class CertificateOperation(object): + """A certificate operation is returned in case of asynchronous requests. """ + + def __init__( + self, + cert_operation_id, + issuer_name, + certificate_type, + certificate_transparency, + csr, + cancellation_requested, + status, + status_details, + error, + target, + request_id, + **kwargs, + ): + # type: (str, str, str, bool, str, bool, str, str, models.Error, str, str, Mapping[str, Any]) -> None + pass + + @property + def id(self): + # type: () -> str + pass + + @property + def issuer_name(self): + # type: () -> str + pass + + @property + def certificate_type(self): + # type: () -> str + pass + + @property + def certificate_transparency(self): + # type: () -> bool + pass + + @property + def csr(self): + # type: () -> str + pass + + @property + def cancellation_requested(self): + # type: () -> bool + pass + + @property + def status(self): + # type: () -> str + pass + + @property + def status_details(self): + # type: () -> str + pass + + @property + def error(self): + # type: () -> models.Error + pass + + @property + def target(self): + # type: () -> str + pass + + @property + def request_id(self): + # type: () -> str + pass + + +class CertificatePolicy(object): + """Management policy for a certificate.""" + + def __init__( + self, + cert_policy_id, + key_properties, + content_type, + subject_name, + subject_alternative_emails, + subject_alternative_dns_names, + subject_alternative_upns, + validity_in_months, + lifetime_actions, + issuer_name, + certificate_type, + certificate_transparency, + **kwargs, + ): + # type: (str, models.KeyProperties, str, str, list[str], list[str], list[str], int, list[models.LifetimeAction], str, str, bool, Mapping[str, Any]) -> None + pass + + @classmethod + def _from_certificate_policy_bundle(cls, certificate_policy_bundle): + # type: (models.CertificatePolicy) -> CertificatePolicy + """Construct a CertificatePolicy from an autorest-generated CertificatePolicy bundle""" + pass + + @property + def id(self): + # type: () -> str + pass + + @property + def name(self): + # type: () -> str + pass + + @property + def content_type(self): + # type: () -> str + pass + + @property + def subject_name(self): + # type: () -> str + pass + + @property + def subject_alternative_emails(self): + # type: () -> list[str] + pass + + @property + def subject_alternative_dns_names(self): + # type: () -> list[str] + pass + + @property + def subject_alternative_upns(self): + # type: () -> list[str] + pass + + @property + def validity_in_months(self): + # type: () -> int + pass + + @property + def lifetime_actions(self): + pass + + @property + def issuer_name(self): + # type: () -> str + pass + + @property + def certificate_type(self): + # type: () -> str + pass + + @property + def certificate_transparency(self): + # type: () -> bool + pass + + @property + def created(self): + # type: () -> datetime + pass + + @property + def enabled(self): + # type: () -> bool + pass + + @property + def updated(self): + # type: () -> datetime + pass + + +class Contact: + """The contact information for the vault certificates. + """ + + def __init__(self, email, name, phone): + # type: (str, str, str) -> None + self._email = email + self._name = name + self._phone = phone + + @property + def email(self): + # type: () -> str + return self._email + + @property + def name(self): + # type: () -> str + return self._name + + @property + def phone(self): + # type: () -> str + return self._phone + + +class IssuerBase(object): + def __init__(self, issuer_id, provider, attributes=None): + # type: (str, str, Optional[models.IssuerAttributes]) -> None + self._attributes = attributes + self._id = issuer_id + self._vault_id = _parse_vault_id(issuer_id) + self._provider = provider + + @classmethod + def _from_issuer_item(cls, issuer_item): + # type: (models.CertificateIssuerItem) -> IssuerBase + """Construct a IssuerBase from an autorest-generated IssuerItem""" + return cls(issuer_id=issuer_item.id, provider=issuer_item.provider) + + @property + def enabled(self): + # type: () -> bool + return self._attributes.enabled + + @property + def created(self): + # type: () -> datetime + return self._attributes.created + + @property + def updated(self): + # type: () -> datetime + return self._attributes.updated + + @property + def id(self): + # type: () -> str + return self._id + + @property + def name(self): + # type: () -> str + return self._vault_id.name + + @property + def provider(self): + # type: () -> str + return self._provider + + @property + def vault_url(self): + # type: () -> str + return self._vault_id.vault_url + + +class Issuer(IssuerBase): + def __init__(self, attributes, issuer_id, provider=None, account_id=None, password=None, organization_id=None, admin_details=None): + # type: (models.IssuerAttributes, str, Optional[str], Optional[str], Optional[str], Optional[str], Optional[str], Optional[List[AdministratorDetails]]) -> None + super(Issuer, self).__init__(attributes, issuer_id, provider) + self._account_id = account_id + self._password = password + self._organization_id = organization_id + self._admin_details = admin_details + + @classmethod + def _from_issuer_bundle(cls, issuer_bundle): + # type: (models.IssuerBundle) -> Issuer + """Construct a Issuer from an autorest-generated IssuerBundle""" + return cls( + attributes=issuer_bundle.attributes, + issuer_id=issuer_bundle.id, + provider=issuer_bundle.provider, + account_id=issuer_bundle.credentials.account_id, + password=issuer_bundle.credentials.password, + organization_id=issuer_bundle.organization_details.id, + admin_details=[ + AdministratorDetails._from_admin_details_bundle(item) + for item in issuer_bundle.organization_details.admin_details + ], + ) + + @property + def account_id(self): + # type: () -> str + return self._account_id + + @property + def password(self): + # type: () -> str + return self._password + + @property + def organization_id(self): + # type: () -> str + return self._organization_id + + @property + def admin_details(self): + # type: () -> List[AdministratorDetails] + return self._admin_details + + +class KeyProperties(object): + def __init__(self, exportable, key_type, key_size, reuse_key, curve, ekus, key_usage): + # type: (bool, str, int, bool, str, list[str], list[str]) -> None + self._exportable = exportable + self._key_type = key_type + self._key_size = key_size + self._reuse_key = reuse_key + self._curve = curve + self._ekus = ekus + self._key_usage = key_usage + + @property + def exportable(self): + return self._exportable + + @property + def key_type(self): + return self._key_type + + @property + def key_size(self): + return self._key_size + + @property + def curve(self): + return self._curve + + @property + def ekus(self): + return self._ekus + + @property + def key_usage(self): + return self._key_usage + + +class LifetimeAction(object): + """Action and its trigger that will be performed by certificate Vault over the + lifetime of a certificate. + """ + + def __init__(self, action_type, lifetime_percentage=None, days_before_expiry=None): + # type: (models.ActionType, Optional[int], Optional[int]) -> None + self._lifetime_percentage = lifetime_percentage + self._days_before_expiry = days_before_expiry + self._action_type = action_type + + @property + def lifetime_percentage(self): + # type: () -> int + return self._lifetime_percentage + + @property + def days_before_expiry(self): + # type: () -> int + return self._days_before_expiry + + @property + def action_type(self): + # type: () -> models.ActionType + return self._action_type + + +class DeletedCertificate(Certificate): + """A Deleted Certificate consisting of its previous id, attributes and its + tags, as well as information on when it will be purged.""" + + def __init__( + self, + attributes, + cert_id, + thumbprint, + kid=None, + sid=None, + policy=None, + cer=None, + deleted_date=None, + recovery_id=None, + scheduled_purge_date=None, + **kwargs, + ): + # type: (models.CertificateAttributes, str, bytes, Optional[str], Optional[str], Optional[models.CertificatePolicy], Optional[bytes], Optional[datetime], Optional[str], Optional[datetime], Mapping[str, Any]) -> None + super(DeletedCertificate, self).__init__(attributes, cert_id, thumbprint, kid, sid, policy, cer, **kwargs) + self._deleted_date = deleted_date + self._recovery_id = recovery_id + self._scheduled_purge_date = scheduled_purge_date + + @classmethod + def _from_deleted_certificate_item(cls, deleted_certificate_item): + # type: (models.DeletedCertificateItem) -> DeletedCertificate + """Construct a DeletedCertificate from an autorest-generated DeletedCertificateItem""" + return cls( + attributes=deleted_certificate_item.attributes, + cert_id=deleted_certificate_item.id, + thumbprint=deleted_certificate_item.x509_thumbprint, + recovery_id=deleted_certificate_item.recovery_id, + scheduled_purge_date=deleted_certificate_item.scheduled_purge_date, + tags=deleted_certificate_item.tags, + ) + + @property + def deleted_date(self): + # type: () -> datetime + return self._deleted_date + + @property + def recovery_id(self): + # type: () -> str + return self._recovery_id + + @property + def scheduled_purge_date(self): + # type: () -> datetime + return self._scheduled_purge_date diff --git a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/keys/_client.py b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/keys/_client.py index c7f0bc47089e..801f618ad80a 100644 --- a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/keys/_client.py +++ b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/keys/_client.py @@ -6,27 +6,16 @@ from typing import Any, Dict, Generator, Mapping, Optional, List from datetime import datetime -from azure.core import Configuration from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError -from azure.core.pipeline import Pipeline -from azure.core.pipeline.transport import RequestsTransport -from azure.security.keyvault._internal import _BearerTokenCredentialPolicy -from .._generated import KeyVaultClient +from .._internal import _KeyVaultClientBase from ._models import Key, KeyBase, DeletedKey, KeyOperationResult -class KeyClient: +class KeyClient(_KeyVaultClientBase): """KeyClient defines a high level interface for managing keys in the specified vault. - :param credentials: A credential or credential provider which can be used to authenticate to the vault, - a ValueError will be raised if the entity is not provided - :type credentials: azure.authentication.Credential or azure.authentication.CredentialProvider - :param str vault_url: The url of the vault to which the client will connect, - a ValueError will be raised if the entity is not provided - :param ~azure.core.configuration.Configuration config: The configuration for the KeyClient - Example: .. literalinclude:: ../tests/test_examples_keyvault.py :start-after: [START create_key_client] @@ -38,46 +27,6 @@ class KeyClient: # pylint:disable=protected-access - @staticmethod - def create_config(**kwargs): - pass # TODO - - def __init__(self, vault_url, credentials, config=None, api_version=None, **kwargs): - # type: (str, Any, Configuration, Optional[str], Mapping[str, Any]) -> None - # TODO: update type hint for credentials - if not credentials: - raise ValueError("credentials") - - if not vault_url: - raise ValueError("vault_url") - - self._vault_url = vault_url - - if api_version is None: - api_version = KeyVaultClient.DEFAULT_API_VERSION - - config = config or KeyVaultClient.get_configuration_class(api_version)(credentials) - - # TODO generated default pipeline should be fine when token policy isn't necessary - policies = [ - config.headers_policy, - config.user_agent_policy, - config.proxy_policy, - _BearerTokenCredentialPolicy(credentials), - config.redirect_policy, - config.retry_policy, - config.logging_policy, - ] - transport = RequestsTransport(config) - pipeline = Pipeline(transport, policies=policies) - - self._client = KeyVaultClient(credentials, api_version=api_version, pipeline=pipeline) - - @property - def vault_url(self): - # type: () -> str - return self._vault_url - def create_key( self, name, diff --git a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/secrets/_client.py b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/secrets/_client.py index 421eb4e1c232..7deed936cf51 100644 --- a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/secrets/_client.py +++ b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/secrets/_client.py @@ -6,28 +6,16 @@ from typing import Any, Dict, Generator, Mapping, Optional from datetime import datetime -from azure.core import Configuration from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError -from azure.core.pipeline import Pipeline -from azure.core.pipeline.policies import RetryPolicy, RedirectPolicy, UserAgentPolicy -from azure.core.pipeline.transport import RequestsTransport -from azure.security.keyvault._internal import _BearerTokenCredentialPolicy -from .._generated import KeyVaultClient +from .._internal import _KeyVaultClientBase from ._models import Secret, DeletedSecret, SecretAttributes -class SecretClient: +class SecretClient(_KeyVaultClientBase): """SecretClient defines a high level interface for managing secrets in the specified vault. - :param credentials: A credential or credential provider which can be used to authenticate to the vault, - a ValueError will be raised if the entity is not provided - :type credentials: azure.authentication.Credential or azure.authentication.CredentialProvider - :param str vault_url: The url of the vault to which the client will connect, - a ValueError will be raised if the entity is not provided - :param ~azure.core.configuration.Configuration config: The configuration for the SecretClient - Example: .. literalinclude:: ../tests/test_examples_keyvault.py :start-after: [START create_secret_client] @@ -41,44 +29,6 @@ class SecretClient: _api_version = "7.0" - @staticmethod - def create_config(**kwargs): - pass # TODO - - def __init__(self, vault_url, credentials, config=None, api_version=None, **kwargs): - if not credentials: - raise ValueError("credentials") - - if not vault_url: - raise ValueError("vault_url") - - self._vault_url = vault_url - - if api_version is None: - api_version = KeyVaultClient.DEFAULT_API_VERSION - - config = config or KeyVaultClient.get_configuration_class(api_version)(credentials) - - # TODO generated default pipeline should be fine when token policy isn't necessary - policies = [ - config.headers_policy, - config.user_agent_policy, - config.proxy_policy, - _BearerTokenCredentialPolicy(credentials), - config.redirect_policy, - config.retry_policy, - config.logging_policy, - ] - transport = RequestsTransport(config) - pipeline = Pipeline(transport, policies=policies) - - self._client = KeyVaultClient(credentials, api_version=self._api_version, pipeline=pipeline) - - @property - def vault_url(self): - # type: () -> str - return self._vault_url - def get_secret(self, name, version=None, **kwargs): # type: (str, str, Mapping[str, Any]) -> Secret """Get a specified secret from the vault. @@ -100,9 +50,8 @@ def get_secret(self, name, version=None, **kwargs): :language: python :dedent: 4 :caption: Get secret from the key vault - """ - bundle = self._client.get_secret(self._vault_url, name, version, error_map={404: ResourceNotFoundError}) + bundle = self._client.get_secret(self._vault_url, name, version or "", error_map={404: ResourceNotFoundError}) return Secret._from_secret_bundle(bundle) def set_secret( @@ -148,10 +97,10 @@ def set_secret( ) return Secret._from_secret_bundle(bundle) - def update_secret_attributes( - self, name, version, content_type=None, enabled=None, not_before=None, expires=None, tags=None, **kwargs + def update_secret( + self, name, version=None, content_type=None, enabled=None, not_before=None, expires=None, tags=None, **kwargs ): - # type: (str, str, Optional[str], Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> SecretAttributes + # type: (str, Optional[str], Optional[str], Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> SecretAttributes """Updates the attributes associated with a specified secret in the key vault. The UPDATE operation changes specified attributes of an existing stored secret. @@ -175,8 +124,8 @@ def update_secret_attributes( Example: .. literalinclude:: ../tests/test_examples_keyvault.py - :start-after: [START update_secret_attributes] - :end-before: [END update_secret_attributes] + :start-after: [START update_secret] + :end-before: [END update_secret] :language: python :dedent: 4 :caption: Updates the attributes associated with a specified secret in the key vault @@ -189,7 +138,7 @@ def update_secret_attributes( bundle = self._client.update_secret( self.vault_url, name, - secret_version=version, + secret_version=version or "", content_type=content_type, tags=tags, secret_attributes=attributes, diff --git a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/vault_client.py b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/vault_client.py index 40f6be9430c2..0de695b2c809 100644 --- a/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/vault_client.py +++ b/sdk/keyvault/azure-security-keyvault/azure/security/keyvault/vault_client.py @@ -3,15 +3,31 @@ # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- +try: + from typing import TYPE_CHECKING +except ImportError: + TYPE_CHECKING = False + +if TYPE_CHECKING: + # pylint:disable=unused-import + from azure.core import Configuration + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpTransport + from typing import Any, Mapping, Optional + +from ._internal import _KeyVaultClientBase from .keys._client import KeyClient from .secrets._client import SecretClient -class VaultClient(object): - def __init__(self, vault_url, credentials, config=None, **kwargs): - self._vault_url = vault_url.strip(" /") - self._secrets = SecretClient(self._vault_url, credentials, config=config, **kwargs) - self._keys = KeyClient(self._vault_url, credentials, config=config, **kwargs) +class VaultClient(_KeyVaultClientBase): + def __init__(self, vault_url, credential, config=None, transport=None, api_version=None, **kwargs): + # type: (str, TokenCredential, Configuration, Optional[HttpTransport], Optional[str], **Any) -> None + super(VaultClient, self).__init__( + vault_url, credential, config=config, transport=transport, api_version=api_version, **kwargs + ) + self._secrets = SecretClient(self.vault_url, credential, generated_client=self._client, **kwargs) + self._keys = KeyClient(self.vault_url, credential, generated_client=self._client, **kwargs) @property def secrets(self): @@ -27,13 +43,9 @@ def keys(self): """ return self._keys - @property - def certificates(self): - """ - :rtype: ~azure.keyvault.certificates.CertificateClient - """ - pass - - @property - def vault_url(self): - return self._vault_url + # @property + # def certificates(self): + # """ + # :rtype: ~azure.keyvault.certificates.CertificateClient + # """ + # pass diff --git a/sdk/keyvault/azure-security-keyvault/dev_requirements.txt b/sdk/keyvault/azure-security-keyvault/dev_requirements.txt index 24991df94887..fa269d4c6a63 100644 --- a/sdk/keyvault/azure-security-keyvault/dev_requirements.txt +++ b/sdk/keyvault/azure-security-keyvault/dev_requirements.txt @@ -1,2 +1,3 @@ -e ../../core/azure-core +-e ../../identity/azure-identity aiohttp>=3.0; python_version >= '3.5' diff --git a/sdk/keyvault/azure-security-keyvault/tests/async_preparer.py b/sdk/keyvault/azure-security-keyvault/tests/async_preparer.py new file mode 100644 index 000000000000..d5f14431a8aa --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault/tests/async_preparer.py @@ -0,0 +1,21 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# ------------------------------------------------------------------------- +import asyncio +from unittest.mock import Mock + +from azure.identity.aio import AsyncEnvironmentCredential +from azure.security.keyvault.aio import VaultClient + +from preparer import VaultClientPreparer + + +class AsyncVaultClientPreparer(VaultClientPreparer): + def create_vault_client(self, vault_uri): + if self.is_live: + credential = AsyncEnvironmentCredential() + else: + credential = Mock(get_token=asyncio.coroutine(lambda _: "fake-token")) + return VaultClient(vault_uri, credential) diff --git a/sdk/keyvault/azure-security-keyvault/tests/async_test_case.py b/sdk/keyvault/azure-security-keyvault/tests/async_test_case.py new file mode 100644 index 000000000000..38bd1387a629 --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault/tests/async_test_case.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import asyncio +import functools + +from azure.core.exceptions import ResourceNotFoundError + +from test_case import KeyVaultTestCase + + +class AsyncKeyVaultTestCase(KeyVaultTestCase): + @staticmethod + def await_prepared_test(test_fn): + """Synchronous wrapper for async test methods. Used to avoid making changes + upstream to AbstractPreparer (which doesn't await the functions it wraps) + """ + + @functools.wraps(test_fn) + def run(test_class_instance, *args, **kwargs): + vault_client = kwargs.get("vault_client") + loop = asyncio.get_event_loop() + return loop.run_until_complete(test_fn(test_class_instance, vault_client)) + + return run + + async def _poll_until_resource_found(self, fn, secret_names, max_retries=20, retry_delay=6): + """polling helper for live tests because some operations take an unpredictable amount of time to complete""" + + if not self.is_live: + return + + for i in range(max_retries): + await asyncio.sleep(retry_delay) + try: + for name in secret_names: + # TODO: this enables polling get_secret but it'd be better if caller applied args to fn + await fn(name, version="") + break + except ResourceNotFoundError: + if i == max_retries - 1: + raise diff --git a/sdk/keyvault/azure-security-keyvault/tests/auth_request_filter.py b/sdk/keyvault/azure-security-keyvault/tests/auth_request_filter.py new file mode 100644 index 000000000000..a1e021a6e8ae --- /dev/null +++ b/sdk/keyvault/azure-security-keyvault/tests/auth_request_filter.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from azure_devtools.scenario_tests import RecordingProcessor + + +class OAuthv2RequestResponsesFilter(RecordingProcessor): + """Remove oauth authentication requests and responses from recording.""" + + def process_request(self, request): + import re + if not re.match('https://login.microsoftonline.com/([^/]+)/oauth2(?:/v2.0)?/token', request.uri): + return request + return None diff --git a/sdk/keyvault/azure-security-keyvault/tests/preparer.py b/sdk/keyvault/azure-security-keyvault/tests/preparer.py index 4f8ef74fb53d..08c38d9f3a33 100644 --- a/sdk/keyvault/azure-security-keyvault/tests/preparer.py +++ b/sdk/keyvault/azure-security-keyvault/tests/preparer.py @@ -2,14 +2,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. -# -------------------------------------------------------------------------- -from collections import namedtuple -import io -import os -import requests -import time +# ------------------------------------------------------------------------- +try: + from unittest.mock import Mock +except ImportError: # python < 3.3 + from mock import Mock +from azure.identity import EnvironmentCredential from azure.security.keyvault import VaultClient + from azure.mgmt.keyvault import KeyVaultManagementClient from azure.mgmt.keyvault.models import ( SecretPermissions, @@ -22,16 +23,12 @@ AccessPolicyEntry, VaultProperties, VaultCreateOrUpdateParameters, - Vault, ) -from azure_devtools.scenario_tests.preparers import AbstractPreparer, SingleValueReplacer from azure_devtools.scenario_tests.exceptions import AzureTestError -from devtools_testutils import AzureMgmtPreparer, ResourceGroupPreparer, FakeResource +from devtools_testutils import AzureMgmtPreparer, ResourceGroupPreparer from devtools_testutils.resource_testcase import RESOURCE_GROUP_PARAM -FakeAccount = namedtuple("FakeResource", ["name", "account_endpoint"]) - DEFAULT_PERMISSIONS = Permissions( keys=[perm.value for perm in KeyPermissions], secrets=[perm.value for perm in SecretPermissions], @@ -117,11 +114,17 @@ def create_resource(self, name, **kwargs): # playback => we need only the uri used in the recording vault_uri = "https://{}.vault.azure.net/".format(name) - vault_credentials = self.test_class_instance.settings.get_credentials(resource="https://vault.azure.net") - client = VaultClient(vault_uri, vault_credentials) + client = self.create_vault_client(vault_uri) return {self.parameter_name: client} + def create_vault_client(self, vault_uri): + if self.is_live: + credential = EnvironmentCredential() + else: + credential = Mock(get_token=lambda _: "fake-token") + return VaultClient(vault_uri, credential) + def remove_resource(self, name, **kwargs): if self.is_live: group = self._get_resource_group(**kwargs).name diff --git a/sdk/keyvault/azure-security-keyvault/tests/test_case.py b/sdk/keyvault/azure-security-keyvault/tests/test_case.py index f64165ccfbb1..a085eb7578f2 100644 --- a/sdk/keyvault/azure-security-keyvault/tests/test_case.py +++ b/sdk/keyvault/azure-security-keyvault/tests/test_case.py @@ -3,11 +3,17 @@ # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # -------------------------------------------------------------------------- -from azure_devtools.scenario_tests import GeneralNameReplacer from devtools_testutils import AzureMgmtTestCase +from auth_request_filter import OAuthv2RequestResponsesFilter + class KeyVaultTestCase(AzureMgmtTestCase): + def __init__(self, *args, **kwargs): + super(KeyVaultTestCase, self).__init__(*args, **kwargs) + # workaround for upstream issue https://github.com/Azure/azure-python-devtools/pull/57 + self.recording_processors.append(OAuthv2RequestResponsesFilter()) + def setUp(self): self.list_test_size = 7 super(KeyVaultTestCase, self).setUp() diff --git a/sdk/keyvault/azure-security-keyvault/tests/test_examples_keys_async.py b/sdk/keyvault/azure-security-keyvault/tests/test_examples_keys_async.py index 9d5ce41b34c2..f3e9c3061a6b 100644 --- a/sdk/keyvault/azure-security-keyvault/tests/test_examples_keys_async.py +++ b/sdk/keyvault/azure-security-keyvault/tests/test_examples_keys_async.py @@ -9,28 +9,11 @@ from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError, HttpResponseError from devtools_testutils import ResourceGroupPreparer -from preparer import VaultClientPreparer -from test_case import KeyVaultTestCase +from async_preparer import AsyncVaultClientPreparer +from async_test_case import AsyncKeyVaultTestCase from azure.security.keyvault.aio import VaultClient -def await_prepared_test(test_fn): - """Synchronous wrapper for async test methods. Used to avoid making changes - upstream to AbstractPreparer (which doesn't await the functions it wraps) - """ - - @functools.wraps(test_fn) - def run(test_class_instance, *args, **kwargs): - # TODO: this is a workaround for VaultClientPreparer creating a sync client; let's obviate it - vault_client = kwargs.get("vault_client") - credentials = test_class_instance.settings.get_credentials(resource="https://vault.azure.net") - aio_client = VaultClient(vault_client.vault_url, credentials) - loop = asyncio.get_event_loop() - return loop.run_until_complete(test_fn(test_class_instance, vault_client=aio_client)) - - return run - - def create_vault_client(): client_id = "" client_secret = "" @@ -38,15 +21,13 @@ def create_vault_client(): vault_url = "" # [START create_vault_client] + from azure.identity import AsyncClientSecretCredential from azure.security.keyvault.aio import VaultClient - from azure.common.credentials import ServicePrincipalCredentials - credentials = ServicePrincipalCredentials( - client_id=client_id, secret=client_secret, tenant=tenant_id, resource="https://vault.azure.net" - ) + credential = AsyncClientSecretCredential(client_id=client_id, secret=client_secret, tenant_id=tenant_id) - # Create a new Vault client using Azure credentials - vault_client = VaultClient(vault_url=vault_url, credentials=credentials) + # Create a new Vault client using a client secret credential + vault_client = VaultClient(vault_url=vault_url, credential=credential) # [END create_vault_client] return vault_client @@ -58,23 +39,21 @@ def create_key_client(): vault_url = "" # [START create_key_client] - from azure.common.credentials import ServicePrincipalCredentials + from azure.identity import AsyncClientSecretCredential from azure.security.keyvault.aio import KeyClient - credentials = ServicePrincipalCredentials( - client_id=client_id, secret=client_secret, tenant=tenant_id, resource="https://vault.azure.net" - ) + credential = AsyncClientSecretCredential(client_id=client_id, secret=client_secret, tenant_id=tenant_id) - # Create a new key client using Azure credentials - key_client = KeyClient(vault_url=vault_url, credentials=credentials) + # Create a new key client using a client secret credential + key_client = KeyClient(vault_url=vault_url, credential=credential) # [END create_key_client] return key_client -class TestExamplesKeyVault(KeyVaultTestCase): +class TestExamplesKeyVault(AsyncKeyVaultTestCase): @ResourceGroupPreparer() - @VaultClientPreparer() - @await_prepared_test + @AsyncVaultClientPreparer() + @AsyncKeyVaultTestCase.await_prepared_test async def test_example_key_crud_operations(self, vault_client, **kwargs): from dateutil import parser as date_parse @@ -186,8 +165,8 @@ async def test_example_key_crud_operations(self, vault_client, **kwargs): pass @ResourceGroupPreparer() - @VaultClientPreparer(enable_soft_delete=True) - @await_prepared_test + @AsyncVaultClientPreparer(enable_soft_delete=True) + @AsyncKeyVaultTestCase.await_prepared_test async def test_example_key_list_operations(self, vault_client, **kwargs): key_client = vault_client.keys try: @@ -234,8 +213,8 @@ async def test_example_key_list_operations(self, vault_client, **kwargs): pass @ResourceGroupPreparer() - @VaultClientPreparer() - @await_prepared_test + @AsyncVaultClientPreparer() + @AsyncKeyVaultTestCase.await_prepared_test async def test_example_keys_backup_restore(self, vault_client, **kwargs): key_client = vault_client.keys created_key = await key_client.create_key("keyrec", "RSA") @@ -266,8 +245,8 @@ async def test_example_keys_backup_restore(self, vault_client, **kwargs): pass @ResourceGroupPreparer() - @VaultClientPreparer(enable_soft_delete=True) - @await_prepared_test + @AsyncVaultClientPreparer(enable_soft_delete=True) + @AsyncKeyVaultTestCase.await_prepared_test async def test_example_keys_recover_purge(self, vault_client, **kwargs): key_client = vault_client.keys created_key = await key_client.create_key("key-name", "RSA") diff --git a/sdk/keyvault/azure-security-keyvault/tests/test_examples_keyvault.py b/sdk/keyvault/azure-security-keyvault/tests/test_examples_keyvault.py index 6ed449c024b8..a17c7a670bae 100644 --- a/sdk/keyvault/azure-security-keyvault/tests/test_examples_keyvault.py +++ b/sdk/keyvault/azure-security-keyvault/tests/test_examples_keyvault.py @@ -26,7 +26,7 @@ def create_vault_client(): ) # Create a new Vault client using Azure credentials - vault_client = VaultClient(vault_url=vault_url, credentials=credentials) + vault_client = VaultClient(vault_url=vault_url, credential=credentials) # [END create_vault_client] return vault_client @@ -46,7 +46,7 @@ def create_secret_client(): ) # Create a new Secret client using Azure credentials - secret_client = SecretClient(vault_url=vault_url, credentials=credentials) + secret_client = SecretClient(vault_url=vault_url, credential=credentials) # [END create_secret_client] return secret_client @@ -95,14 +95,14 @@ def test_example_secret_crud_operations(self, vault_client, **kwargs): pass try: - # [START update_secret_attributes] + # [START update_secret] # update attributes of an existing secret content_type = "text/plain" tags = {"foo": "updated tag"} secret_version = secret.version - updated_secret = secret_client.update_secret_attributes( + updated_secret = secret_client.update_secret( "secret-name", secret_version, content_type=content_type, tags=tags ) @@ -111,7 +111,7 @@ def test_example_secret_crud_operations(self, vault_client, **kwargs): print(updated_secret.content_type) print(updated_secret.tags) - # [END update_secret_attributes] + # [END update_secret] except HttpResponseError: pass diff --git a/sdk/keyvault/azure-security-keyvault/tests/test_examples_keyvault_async.py b/sdk/keyvault/azure-security-keyvault/tests/test_examples_keyvault_async.py index 320451c13ef9..9f8f27614c17 100644 --- a/sdk/keyvault/azure-security-keyvault/tests/test_examples_keyvault_async.py +++ b/sdk/keyvault/azure-security-keyvault/tests/test_examples_keyvault_async.py @@ -9,34 +9,16 @@ import functools from devtools_testutils import ResourceGroupPreparer -from preparer import VaultClientPreparer -from test_case import KeyVaultTestCase +from async_preparer import AsyncVaultClientPreparer +from async_test_case import AsyncKeyVaultTestCase from azure.security.keyvault._generated.v7_0.models import KeyVaultErrorException from azure.security.keyvault.aio.vault_client import VaultClient -# TODO: Remove, later? -def await_prepared_test(test_fn): - """Synchronous wrapper for async test methods. Used to avoid making changes - upstream to AbstractPreparer (which doesn't await the functions it wraps) - """ - @functools.wraps(test_fn) - def run(test_class_instance, *args, **kwargs): - # TODO: this is a workaround for VaultClientPreparer creating a sync client; let's obviate it - vault_client = kwargs.get("vault_client") - credentials = test_class_instance.settings.get_credentials( - resource="https://vault.azure.net") - aio_client = VaultClient(vault_client.vault_url, credentials) - loop = asyncio.get_event_loop() - return loop.run_until_complete(test_fn(test_class_instance, vault_client=aio_client)) - return run - - -class TestExamplesKeyVault(KeyVaultTestCase): - +class TestExamplesKeyVault(AsyncKeyVaultTestCase): @ResourceGroupPreparer() - @VaultClientPreparer(enable_soft_delete=True) - @await_prepared_test + @AsyncVaultClientPreparer(enable_soft_delete=True) + @AsyncKeyVaultTestCase.await_prepared_test async def test_example_secret_crud_operations(self, vault_client, **kwargs): secret_client = vault_client.secrets try: @@ -77,14 +59,14 @@ async def test_example_secret_crud_operations(self, vault_client, **kwargs): pass try: - # [START update_secret_attributes] + # [START update_secret] # update attributes of an existing secret content_type = 'text/plain' tags = {'foo': 'updated tag'} secret_version = secret.version - updated_secret = await secret_client.update_secret_attributes( + updated_secret = await secret_client.update_secret( 'secret-name', secret_version, content_type=content_type, tags=tags) @@ -94,7 +76,7 @@ async def test_example_secret_crud_operations(self, vault_client, **kwargs): print(updated_secret.content_type) print(updated_secret.tags) - # [END update_secret_attributes] + # [END update_secret] except KeyVaultErrorException: pass @@ -112,8 +94,8 @@ async def test_example_secret_crud_operations(self, vault_client, **kwargs): pass @ResourceGroupPreparer() - @VaultClientPreparer(enable_soft_delete=True) - @await_prepared_test + @AsyncVaultClientPreparer(enable_soft_delete=True) + @AsyncKeyVaultTestCase.await_prepared_test async def test_example_secret_list_operations(self, vault_client, **kwargs): secret_client = vault_client.secrets try: @@ -163,8 +145,8 @@ async def test_example_secret_list_operations(self, vault_client, **kwargs): pass @ResourceGroupPreparer() - @VaultClientPreparer(enable_soft_delete=True) - @await_prepared_test + @AsyncVaultClientPreparer(enable_soft_delete=True) + @AsyncKeyVaultTestCase.await_prepared_test async def test_example_secrets_backup_restore(self, vault_client, **kwargs): secret_client = vault_client.secrets created_secret = await secret_client.set_secret('secret-name', 'secret-value') @@ -213,8 +195,8 @@ async def test_example_secrets_backup_restore(self, vault_client, **kwargs): pass @ResourceGroupPreparer() - @VaultClientPreparer(enable_soft_delete=True) - @await_prepared_test + @AsyncVaultClientPreparer(enable_soft_delete=True) + @AsyncKeyVaultTestCase.await_prepared_test async def test_example_secrets_recover_purge(self, vault_client, **kwargs): secret_client = vault_client.secrets created_secret = await secret_client.set_secret('secret-name', 'secret-value') diff --git a/sdk/keyvault/azure-security-keyvault/tests/test_keys_async.py b/sdk/keyvault/azure-security-keyvault/tests/test_keys_async.py index 366db9c2e999..ed084be69d28 100644 --- a/sdk/keyvault/azure-security-keyvault/tests/test_keys_async.py +++ b/sdk/keyvault/azure-security-keyvault/tests/test_keys_async.py @@ -9,8 +9,8 @@ from azure.core.exceptions import ResourceNotFoundError from devtools_testutils import ResourceGroupPreparer -from preparer import VaultClientPreparer -from test_case import KeyVaultTestCase +from async_preparer import AsyncVaultClientPreparer +from async_test_case import AsyncKeyVaultTestCase from azure.security.keyvault.aio import VaultClient from azure.security.keyvault._generated.v7_0.models import JsonWebKey @@ -18,41 +18,7 @@ from dateutil import parser as date_parse -def await_prepared_test(test_fn): - """Synchronous wrapper for async test methods. Used to avoid making changes - upstream to AbstractPreparer (which doesn't await the functions it wraps) - """ - - @functools.wraps(test_fn) - def run(test_class_instance, *args, **kwargs): - # TODO: this is a workaround for VaultClientPreparer creating a sync client - vault_client = kwargs.get("vault_client") - credentials = test_class_instance.settings.get_credentials(resource="https://vault.azure.net") - aio_client = VaultClient(vault_client.vault_url, credentials) - loop = asyncio.get_event_loop() - return loop.run_until_complete(test_fn(test_class_instance, vault_client=aio_client)) - - return run - - -class KeyVaultKeyTest(KeyVaultTestCase): - async def _poll_until_resource_found(self, fn, key_names, max_retries=20, retry_delay=6): - """polling helper for live tests because some operations take an unpredictable amount of time to complete""" - - if not self.is_live: - return - - for i in range(max_retries): - await asyncio.sleep(retry_delay) - try: - for name in key_names: - # TODO: this enables polling get_key but it'd be better if caller applied args to fn - await fn(name, version="") - break - except ResourceNotFoundError: - if i == max_retries - 1: - raise - +class KeyVaultKeyTest(AsyncKeyVaultTestCase): def _assert_key_attributes_equal(self, k1, k2): self.assertEqual(k1.name, k2.name) self.assertEqual(k1.vault_url, k2.vault_url) @@ -161,8 +127,8 @@ def _to_bytes(hex): return imported_key @ResourceGroupPreparer() - @VaultClientPreparer(enable_soft_delete=True) - @await_prepared_test + @AsyncVaultClientPreparer(enable_soft_delete=True) + @AsyncKeyVaultTestCase.await_prepared_test async def test_key_crud_operations(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) client = vault_client.keys @@ -211,8 +177,8 @@ async def test_key_crud_operations(self, vault_client, **kwargs): self.assertEqual(created_rsa_key.id, deleted_key.id) @ResourceGroupPreparer() - @VaultClientPreparer() - @await_prepared_test + @AsyncVaultClientPreparer() + @AsyncKeyVaultTestCase.await_prepared_test async def test_key_list(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) client = vault_client.keys @@ -231,8 +197,8 @@ async def test_key_list(self, vault_client, **kwargs): await self._validate_key_list(result, expected) @ResourceGroupPreparer() - @VaultClientPreparer() - @await_prepared_test + @AsyncVaultClientPreparer() + @AsyncKeyVaultTestCase.await_prepared_test async def test_list_versions(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) client = vault_client.keys @@ -257,8 +223,8 @@ async def test_list_versions(self, vault_client, **kwargs): self.assertEqual(0, len(expected)) @ResourceGroupPreparer() - @VaultClientPreparer(enable_soft_delete=True) - @await_prepared_test + @AsyncVaultClientPreparer(enable_soft_delete=True) + @AsyncKeyVaultTestCase.await_prepared_test async def test_list_deleted_keys(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) client = vault_client.keys @@ -281,8 +247,8 @@ async def test_list_deleted_keys(self, vault_client, **kwargs): await self._validate_key_list(result, expected) @ResourceGroupPreparer() - @VaultClientPreparer() - @await_prepared_test + @AsyncVaultClientPreparer() + @AsyncKeyVaultTestCase.await_prepared_test async def test_backup_restore(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) client = vault_client.keys @@ -306,8 +272,8 @@ async def test_backup_restore(self, vault_client, **kwargs): self._assert_key_attributes_equal(created_bundle, restored) @ResourceGroupPreparer() - @VaultClientPreparer(enable_soft_delete=True) - @await_prepared_test + @AsyncVaultClientPreparer(enable_soft_delete=True) + @AsyncKeyVaultTestCase.await_prepared_test async def test_recover_purge(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) @@ -351,8 +317,8 @@ async def test_recover_purge(self, vault_client, **kwargs): self.assertEqual(len(set(expected.keys()) & set(actual.keys())), len(expected)) @ResourceGroupPreparer() - @VaultClientPreparer() - @await_prepared_test + @AsyncVaultClientPreparer() + @AsyncKeyVaultTestCase.await_prepared_test async def test_key_wrap_and_unwrap(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) client = vault_client.keys diff --git a/sdk/keyvault/azure-security-keyvault/tests/test_secrets_async.py b/sdk/keyvault/azure-security-keyvault/tests/test_secrets_async.py index f1bf2d2070b5..4b36fd340742 100644 --- a/sdk/keyvault/azure-security-keyvault/tests/test_secrets_async.py +++ b/sdk/keyvault/azure-security-keyvault/tests/test_secrets_async.py @@ -8,8 +8,8 @@ from azure.core.exceptions import ResourceNotFoundError from devtools_testutils import ResourceGroupPreparer -from preparer import VaultClientPreparer -from test_case import KeyVaultTestCase +from async_preparer import AsyncVaultClientPreparer +from async_test_case import AsyncKeyVaultTestCase from azure.security.keyvault.aio.vault_client import VaultClient @@ -17,41 +17,7 @@ import time -def await_prepared_test(test_fn): - """Synchronous wrapper for async test methods. Used to avoid making changes - upstream to AbstractPreparer (which doesn't await the functions it wraps) - """ - - @functools.wraps(test_fn) - def run(test_class_instance, *args, **kwargs): - # TODO: this is a workaround for VaultClientPreparer creating a sync client - vault_client = kwargs.get("vault_client") - credentials = test_class_instance.settings.get_credentials(resource="https://vault.azure.net") - aio_client = VaultClient(vault_client.vault_url, credentials) - loop = asyncio.get_event_loop() - return loop.run_until_complete(test_fn(test_class_instance, vault_client=aio_client)) - - return run - - -class KeyVaultSecretTest(KeyVaultTestCase): - async def _poll_until_resource_found(self, fn, secret_names, max_retries=20, retry_delay=6): - """polling helper for live tests because some operations take an unpredictable amount of time to complete""" - - if not self.is_live: - return - - for i in range(max_retries): - await asyncio.sleep(retry_delay) - try: - for name in secret_names: - # TODO: this enables polling get_secret but it'd be better if caller applied args to fn - await fn(name, version="") - break - except ResourceNotFoundError: - if i == max_retries - 1: - raise - +class KeyVaultSecretTest(AsyncKeyVaultTestCase): def _assert_secret_attributes_equal(self, s1, s2): # self.assertEqual(s1.id , s2.id) self.assertEqual(s1.content_type, s2.content_type) @@ -84,8 +50,8 @@ async def _validate_secret_list(self, secrets, expected): self.assertEqual(len(expected), 0) @ResourceGroupPreparer() - @VaultClientPreparer(enable_soft_delete=True) - @await_prepared_test + @AsyncVaultClientPreparer(enable_soft_delete=True) + @AsyncKeyVaultTestCase.await_prepared_test async def test_secret_crud_operations(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) client = vault_client.secrets @@ -120,7 +86,7 @@ async def _update_secret(secret): content_type = "text/plain" expires = date_parse.parse("2050-02-02T08:00:00.000Z") tags = {"foo": "updated tag"} - secret_bundle = await client.update_secret_attributes( + secret_bundle = await client.update_secret( secret.name, secret.version, content_type=content_type, expires=expires, tags=tags ) self.assertEqual(tags, secret_bundle.tags) @@ -146,8 +112,8 @@ async def _update_secret(secret): await client.get_secret(updated.name, "") @ResourceGroupPreparer() - @VaultClientPreparer() - @await_prepared_test + @AsyncVaultClientPreparer() + @AsyncKeyVaultTestCase.await_prepared_test async def test_secret_list(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) client = vault_client.secrets @@ -169,8 +135,8 @@ async def test_secret_list(self, vault_client, **kwargs): await self._validate_secret_list(result, expected) @ResourceGroupPreparer() - @VaultClientPreparer() - @await_prepared_test + @AsyncVaultClientPreparer() + @AsyncKeyVaultTestCase.await_prepared_test async def test_list_versions(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) client = vault_client.secrets @@ -199,8 +165,8 @@ async def test_list_versions(self, vault_client, **kwargs): self.assertEqual(len(expected), 0) @ResourceGroupPreparer() - @VaultClientPreparer(enable_soft_delete=True) - @await_prepared_test + @AsyncVaultClientPreparer(enable_soft_delete=True) + @AsyncKeyVaultTestCase.await_prepared_test async def test_list_deleted_secrets(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) client = vault_client.secrets @@ -223,8 +189,8 @@ async def test_list_deleted_secrets(self, vault_client, **kwargs): await self._validate_secret_list(result, expected) @ResourceGroupPreparer() - @VaultClientPreparer() - @await_prepared_test + @AsyncVaultClientPreparer() + @AsyncKeyVaultTestCase.await_prepared_test async def test_backup_restore(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) client = vault_client.secrets @@ -247,8 +213,8 @@ async def test_backup_restore(self, vault_client, **kwargs): self._assert_secret_attributes_equal(created_bundle, restored) @ResourceGroupPreparer() - @VaultClientPreparer(enable_soft_delete=True) - @await_prepared_test + @AsyncVaultClientPreparer(enable_soft_delete=True) + @AsyncKeyVaultTestCase.await_prepared_test async def test_recover_purge(self, vault_client, **kwargs): self.assertIsNotNone(vault_client) client = vault_client.secrets diff --git a/sdk/keyvault/azure-security-keyvault/tests/test_secrets_client.py b/sdk/keyvault/azure-security-keyvault/tests/test_secrets_client.py index 3aa8f842f9d9..95887a7b9a40 100644 --- a/sdk/keyvault/azure-security-keyvault/tests/test_secrets_client.py +++ b/sdk/keyvault/azure-security-keyvault/tests/test_secrets_client.py @@ -87,7 +87,7 @@ def _update_secret(secret): content_type = "text/plain" expires = date_parse.parse("2050-01-02T08:00:00.000Z") tags = {"foo": "updated tag"} - secret_bundle = client.update_secret_attributes( + secret_bundle = client.update_secret( secret.name, secret.version, content_type=content_type, expires=expires, tags=tags ) self.assertEqual(tags, secret_bundle.tags) diff --git a/sdk/loganalytics/azure-loganalytics/dev_requirements.txt b/sdk/loganalytics/azure-loganalytics/dev_requirements.txt index 8ffd9e3035d1..f6457a93d5e8 100644 --- a/sdk/loganalytics/azure-loganalytics/dev_requirements.txt +++ b/sdk/loganalytics/azure-loganalytics/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/logic/azure-mgmt-logic/dev_requirements.txt b/sdk/logic/azure-mgmt-logic/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/logic/azure-mgmt-logic/dev_requirements.txt +++ b/sdk/logic/azure-mgmt-logic/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/machinelearning/azure-mgmt-machinelearningcompute/dev_requirements.txt b/sdk/machinelearning/azure-mgmt-machinelearningcompute/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/machinelearning/azure-mgmt-machinelearningcompute/dev_requirements.txt +++ b/sdk/machinelearning/azure-mgmt-machinelearningcompute/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/managementpartner/azure-mgmt-managementpartner/dev_requirements.txt b/sdk/managementpartner/azure-mgmt-managementpartner/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/managementpartner/azure-mgmt-managementpartner/dev_requirements.txt +++ b/sdk/managementpartner/azure-mgmt-managementpartner/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/media/azure-mgmt-media/dev_requirements.txt b/sdk/media/azure-mgmt-media/dev_requirements.txt index fe6f543ba71c..b31282865c30 100644 --- a/sdk/media/azure-mgmt-media/dev_requirements.txt +++ b/sdk/media/azure-mgmt-media/dev_requirements.txt @@ -1,2 +1,2 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools -e ../../storage/azure-mgmt-storage diff --git a/sdk/monitor/azure-mgmt-monitor/dev_requirements.txt b/sdk/monitor/azure-mgmt-monitor/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/monitor/azure-mgmt-monitor/dev_requirements.txt +++ b/sdk/monitor/azure-mgmt-monitor/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/network/azure-mgmt-dns/dev_requirements.txt b/sdk/network/azure-mgmt-dns/dev_requirements.txt index bd7bc7415187..f1bda8ee5e52 100644 --- a/sdk/network/azure-mgmt-dns/dev_requirements.txt +++ b/sdk/network/azure-mgmt-dns/dev_requirements.txt @@ -1,2 +1,2 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools -e ../azure-mgmt-network diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/__init__.py index 905cdbfa0138..6011c1a921c6 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/__init__.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/__init__.py @@ -1,4 +1,4 @@ -# coding=utf-8 +# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for @@ -9,9 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .network_management_client import NetworkManagementClient -from .version import VERSION +from ._configuration import NetworkManagementClientConfiguration +from ._network_management_client import NetworkManagementClient +__all__ = ['NetworkManagementClient', 'NetworkManagementClientConfiguration'] -__all__ = ['NetworkManagementClient'] +from .version import VERSION __version__ = VERSION + diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/_configuration.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/_configuration.py new file mode 100644 index 000000000000..a7dd38c001c1 --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/_configuration.py @@ -0,0 +1,50 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class NetworkManagementClientConfiguration(AzureConfiguration): + """Configuration for NetworkManagementClient + 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 subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :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(NetworkManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-network/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/_network_management_client.py new file mode 100644 index 000000000000..8a809ae8d6bf --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/_network_management_client.py @@ -0,0 +1,3651 @@ +# 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 azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin +from .version import VERSION +from ._configuration import NetworkManagementClientConfiguration +from ._operations_mixin import NetworkManagementClientOperationsMixin + + +class NetworkManagementClient(NetworkManagementClientOperationsMixin, MultiApiClientMixin, SDKClient): + """Network Client + + This ready contains multiple API versions, to help you deal with all Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, uses latest API version available on public Azure. + For production, you should stick a particular api-version and/or profile. + The profile sets a mapping between the operation group and an API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + + :ivar config: Configuration for client. + :vartype config: NetworkManagementClientConfiguration + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :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 profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles + """ + + DEFAULT_API_VERSION = '2019-04-01' + _PROFILE_TAG = "azure.mgmt.network.NetworkManagementClient" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { + 'interface_endpoints': '2019-02-01', + 'virtual_wa_ns': '2018-07-01', + None: DEFAULT_API_VERSION + }}, + _PROFILE_TAG + " latest" + ) + + def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): + self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) + super(NetworkManagementClient, self).__init__( + credentials, + self.config, + api_version=api_version, + profile=profile + ) + + @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: + + * 2015-06-15: :mod:`v2015_06_15.models` + * 2016-09-01: :mod:`v2016_09_01.models` + * 2016-12-01: :mod:`v2016_12_01.models` + * 2017-03-01: :mod:`v2017_03_01.models` + * 2017-06-01: :mod:`v2017_06_01.models` + * 2017-08-01: :mod:`v2017_08_01.models` + * 2017-09-01: :mod:`v2017_09_01.models` + * 2017-10-01: :mod:`v2017_10_01.models` + * 2017-11-01: :mod:`v2017_11_01.models` + * 2018-01-01: :mod:`v2018_01_01.models` + * 2018-02-01: :mod:`v2018_02_01.models` + * 2018-04-01: :mod:`v2018_04_01.models` + * 2018-06-01: :mod:`v2018_06_01.models` + * 2018-07-01: :mod:`v2018_07_01.models` + * 2018-08-01: :mod:`v2018_08_01.models` + * 2018-10-01: :mod:`v2018_10_01.models` + * 2018-11-01: :mod:`v2018_11_01.models` + * 2018-12-01: :mod:`v2018_12_01.models` + * 2019-02-01: :mod:`v2019_02_01.models` + * 2019-04-01: :mod:`v2019_04_01.models` + """ + if api_version == '2015-06-15': + from .v2015_06_15 import models + return models + elif api_version == '2016-09-01': + from .v2016_09_01 import models + return models + elif api_version == '2016-12-01': + from .v2016_12_01 import models + return models + elif api_version == '2017-03-01': + from .v2017_03_01 import models + return models + elif api_version == '2017-06-01': + from .v2017_06_01 import models + return models + elif api_version == '2017-08-01': + from .v2017_08_01 import models + return models + elif api_version == '2017-09-01': + from .v2017_09_01 import models + return models + elif api_version == '2017-10-01': + from .v2017_10_01 import models + return models + elif api_version == '2017-11-01': + from .v2017_11_01 import models + return models + elif api_version == '2018-01-01': + from .v2018_01_01 import models + return models + elif api_version == '2018-02-01': + from .v2018_02_01 import models + return models + elif api_version == '2018-04-01': + from .v2018_04_01 import models + return models + elif api_version == '2018-06-01': + from .v2018_06_01 import models + return models + elif api_version == '2018-07-01': + from .v2018_07_01 import models + return models + elif api_version == '2018-08-01': + from .v2018_08_01 import models + return models + elif api_version == '2018-10-01': + from .v2018_10_01 import models + return models + elif api_version == '2018-11-01': + from .v2018_11_01 import models + return models + elif api_version == '2018-12-01': + from .v2018_12_01 import models + return models + elif api_version == '2019-02-01': + from .v2019_02_01 import models + return models + elif api_version == '2019-04-01': + from .v2019_04_01 import models + return models + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + + @property + def application_gateways(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`ApplicationGatewaysOperations` + * 2016-09-01: :class:`ApplicationGatewaysOperations` + * 2016-12-01: :class:`ApplicationGatewaysOperations` + * 2017-03-01: :class:`ApplicationGatewaysOperations` + * 2017-06-01: :class:`ApplicationGatewaysOperations` + * 2017-08-01: :class:`ApplicationGatewaysOperations` + * 2017-09-01: :class:`ApplicationGatewaysOperations` + * 2017-10-01: :class:`ApplicationGatewaysOperations` + * 2017-11-01: :class:`ApplicationGatewaysOperations` + * 2018-01-01: :class:`ApplicationGatewaysOperations` + * 2018-02-01: :class:`ApplicationGatewaysOperations` + * 2018-04-01: :class:`ApplicationGatewaysOperations` + * 2018-06-01: :class:`ApplicationGatewaysOperations` + * 2018-07-01: :class:`ApplicationGatewaysOperations` + * 2018-08-01: :class:`ApplicationGatewaysOperations` + * 2018-10-01: :class:`ApplicationGatewaysOperations` + * 2018-11-01: :class:`ApplicationGatewaysOperations` + * 2018-12-01: :class:`ApplicationGatewaysOperations` + * 2019-02-01: :class:`ApplicationGatewaysOperations` + * 2019-04-01: :class:`ApplicationGatewaysOperations` + """ + api_version = self._get_api_version('application_gateways') + if api_version == '2015-06-15': + from .v2015_06_15.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ApplicationGatewaysOperations 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 application_security_groups(self): + """Instance depends on the API version: + + * 2017-09-01: :class:`ApplicationSecurityGroupsOperations` + * 2017-10-01: :class:`ApplicationSecurityGroupsOperations` + * 2017-11-01: :class:`ApplicationSecurityGroupsOperations` + * 2018-01-01: :class:`ApplicationSecurityGroupsOperations` + * 2018-02-01: :class:`ApplicationSecurityGroupsOperations` + * 2018-04-01: :class:`ApplicationSecurityGroupsOperations` + * 2018-06-01: :class:`ApplicationSecurityGroupsOperations` + * 2018-07-01: :class:`ApplicationSecurityGroupsOperations` + * 2018-08-01: :class:`ApplicationSecurityGroupsOperations` + * 2018-10-01: :class:`ApplicationSecurityGroupsOperations` + * 2018-11-01: :class:`ApplicationSecurityGroupsOperations` + * 2018-12-01: :class:`ApplicationSecurityGroupsOperations` + * 2019-02-01: :class:`ApplicationSecurityGroupsOperations` + * 2019-04-01: :class:`ApplicationSecurityGroupsOperations` + """ + api_version = self._get_api_version('application_security_groups') + if api_version == '2017-09-01': + from .v2017_09_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ApplicationSecurityGroupsOperations 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 available_delegations(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`AvailableDelegationsOperations` + * 2018-10-01: :class:`AvailableDelegationsOperations` + * 2018-11-01: :class:`AvailableDelegationsOperations` + * 2018-12-01: :class:`AvailableDelegationsOperations` + * 2019-02-01: :class:`AvailableDelegationsOperations` + * 2019-04-01: :class:`AvailableDelegationsOperations` + """ + api_version = self._get_api_version('available_delegations') + if api_version == '2018-08-01': + from .v2018_08_01.operations import AvailableDelegationsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import AvailableDelegationsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import AvailableDelegationsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import AvailableDelegationsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import AvailableDelegationsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import AvailableDelegationsOperations 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 available_endpoint_services(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`AvailableEndpointServicesOperations` + * 2017-08-01: :class:`AvailableEndpointServicesOperations` + * 2017-09-01: :class:`AvailableEndpointServicesOperations` + * 2017-10-01: :class:`AvailableEndpointServicesOperations` + * 2017-11-01: :class:`AvailableEndpointServicesOperations` + * 2018-01-01: :class:`AvailableEndpointServicesOperations` + * 2018-02-01: :class:`AvailableEndpointServicesOperations` + * 2018-04-01: :class:`AvailableEndpointServicesOperations` + * 2018-06-01: :class:`AvailableEndpointServicesOperations` + * 2018-07-01: :class:`AvailableEndpointServicesOperations` + * 2018-08-01: :class:`AvailableEndpointServicesOperations` + * 2018-10-01: :class:`AvailableEndpointServicesOperations` + * 2018-11-01: :class:`AvailableEndpointServicesOperations` + * 2018-12-01: :class:`AvailableEndpointServicesOperations` + * 2019-02-01: :class:`AvailableEndpointServicesOperations` + * 2019-04-01: :class:`AvailableEndpointServicesOperations` + """ + api_version = self._get_api_version('available_endpoint_services') + if api_version == '2017-06-01': + from .v2017_06_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import AvailableEndpointServicesOperations 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 available_private_endpoint_types(self): + """Instance depends on the API version: + + * 2019-04-01: :class:`AvailablePrivateEndpointTypesOperations` + """ + api_version = self._get_api_version('available_private_endpoint_types') + if api_version == '2019-04-01': + from .v2019_04_01.operations import AvailablePrivateEndpointTypesOperations 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 available_resource_group_delegations(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`AvailableResourceGroupDelegationsOperations` + * 2018-10-01: :class:`AvailableResourceGroupDelegationsOperations` + * 2018-11-01: :class:`AvailableResourceGroupDelegationsOperations` + * 2018-12-01: :class:`AvailableResourceGroupDelegationsOperations` + * 2019-02-01: :class:`AvailableResourceGroupDelegationsOperations` + * 2019-04-01: :class:`AvailableResourceGroupDelegationsOperations` + """ + api_version = self._get_api_version('available_resource_group_delegations') + if api_version == '2018-08-01': + from .v2018_08_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import AvailableResourceGroupDelegationsOperations 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 available_resource_group_private_endpoint_types(self): + """Instance depends on the API version: + + * 2019-04-01: :class:`AvailableResourceGroupPrivateEndpointTypesOperations` + """ + api_version = self._get_api_version('available_resource_group_private_endpoint_types') + if api_version == '2019-04-01': + from .v2019_04_01.operations import AvailableResourceGroupPrivateEndpointTypesOperations 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 azure_firewall_fqdn_tags(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`AzureFirewallFqdnTagsOperations` + * 2018-10-01: :class:`AzureFirewallFqdnTagsOperations` + * 2018-11-01: :class:`AzureFirewallFqdnTagsOperations` + * 2018-12-01: :class:`AzureFirewallFqdnTagsOperations` + * 2019-02-01: :class:`AzureFirewallFqdnTagsOperations` + * 2019-04-01: :class:`AzureFirewallFqdnTagsOperations` + """ + api_version = self._get_api_version('azure_firewall_fqdn_tags') + if api_version == '2018-08-01': + from .v2018_08_01.operations import AzureFirewallFqdnTagsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import AzureFirewallFqdnTagsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import AzureFirewallFqdnTagsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import AzureFirewallFqdnTagsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import AzureFirewallFqdnTagsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import AzureFirewallFqdnTagsOperations 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 azure_firewalls(self): + """Instance depends on the API version: + + * 2018-04-01: :class:`AzureFirewallsOperations` + * 2018-06-01: :class:`AzureFirewallsOperations` + * 2018-07-01: :class:`AzureFirewallsOperations` + * 2018-08-01: :class:`AzureFirewallsOperations` + * 2018-10-01: :class:`AzureFirewallsOperations` + * 2018-11-01: :class:`AzureFirewallsOperations` + * 2018-12-01: :class:`AzureFirewallsOperations` + * 2019-02-01: :class:`AzureFirewallsOperations` + * 2019-04-01: :class:`AzureFirewallsOperations` + """ + api_version = self._get_api_version('azure_firewalls') + if api_version == '2018-04-01': + from .v2018_04_01.operations import AzureFirewallsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import AzureFirewallsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import AzureFirewallsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import AzureFirewallsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import AzureFirewallsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import AzureFirewallsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import AzureFirewallsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import AzureFirewallsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import AzureFirewallsOperations 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 bastion_hosts(self): + """Instance depends on the API version: + + * 2019-04-01: :class:`BastionHostsOperations` + """ + api_version = self._get_api_version('bastion_hosts') + if api_version == '2019-04-01': + from .v2019_04_01.operations import BastionHostsOperations 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 bgp_service_communities(self): + """Instance depends on the API version: + + * 2016-12-01: :class:`BgpServiceCommunitiesOperations` + * 2017-03-01: :class:`BgpServiceCommunitiesOperations` + * 2017-06-01: :class:`BgpServiceCommunitiesOperations` + * 2017-08-01: :class:`BgpServiceCommunitiesOperations` + * 2017-09-01: :class:`BgpServiceCommunitiesOperations` + * 2017-10-01: :class:`BgpServiceCommunitiesOperations` + * 2017-11-01: :class:`BgpServiceCommunitiesOperations` + * 2018-01-01: :class:`BgpServiceCommunitiesOperations` + * 2018-02-01: :class:`BgpServiceCommunitiesOperations` + * 2018-04-01: :class:`BgpServiceCommunitiesOperations` + * 2018-06-01: :class:`BgpServiceCommunitiesOperations` + * 2018-07-01: :class:`BgpServiceCommunitiesOperations` + * 2018-08-01: :class:`BgpServiceCommunitiesOperations` + * 2018-10-01: :class:`BgpServiceCommunitiesOperations` + * 2018-11-01: :class:`BgpServiceCommunitiesOperations` + * 2018-12-01: :class:`BgpServiceCommunitiesOperations` + * 2019-02-01: :class:`BgpServiceCommunitiesOperations` + * 2019-04-01: :class:`BgpServiceCommunitiesOperations` + """ + api_version = self._get_api_version('bgp_service_communities') + if api_version == '2016-12-01': + from .v2016_12_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import BgpServiceCommunitiesOperations 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 connection_monitors(self): + """Instance depends on the API version: + + * 2017-10-01: :class:`ConnectionMonitorsOperations` + * 2017-11-01: :class:`ConnectionMonitorsOperations` + * 2018-01-01: :class:`ConnectionMonitorsOperations` + * 2018-02-01: :class:`ConnectionMonitorsOperations` + * 2018-04-01: :class:`ConnectionMonitorsOperations` + * 2018-06-01: :class:`ConnectionMonitorsOperations` + * 2018-07-01: :class:`ConnectionMonitorsOperations` + * 2018-08-01: :class:`ConnectionMonitorsOperations` + * 2018-10-01: :class:`ConnectionMonitorsOperations` + * 2018-11-01: :class:`ConnectionMonitorsOperations` + * 2018-12-01: :class:`ConnectionMonitorsOperations` + * 2019-02-01: :class:`ConnectionMonitorsOperations` + * 2019-04-01: :class:`ConnectionMonitorsOperations` + """ + api_version = self._get_api_version('connection_monitors') + if api_version == '2017-10-01': + from .v2017_10_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ConnectionMonitorsOperations 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 ddos_custom_policies(self): + """Instance depends on the API version: + + * 2018-11-01: :class:`DdosCustomPoliciesOperations` + * 2018-12-01: :class:`DdosCustomPoliciesOperations` + * 2019-02-01: :class:`DdosCustomPoliciesOperations` + * 2019-04-01: :class:`DdosCustomPoliciesOperations` + """ + api_version = self._get_api_version('ddos_custom_policies') + if api_version == '2018-11-01': + from .v2018_11_01.operations import DdosCustomPoliciesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import DdosCustomPoliciesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import DdosCustomPoliciesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import DdosCustomPoliciesOperations 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 ddos_protection_plans(self): + """Instance depends on the API version: + + * 2018-02-01: :class:`DdosProtectionPlansOperations` + * 2018-04-01: :class:`DdosProtectionPlansOperations` + * 2018-06-01: :class:`DdosProtectionPlansOperations` + * 2018-07-01: :class:`DdosProtectionPlansOperations` + * 2018-08-01: :class:`DdosProtectionPlansOperations` + * 2018-10-01: :class:`DdosProtectionPlansOperations` + * 2018-11-01: :class:`DdosProtectionPlansOperations` + * 2018-12-01: :class:`DdosProtectionPlansOperations` + * 2019-02-01: :class:`DdosProtectionPlansOperations` + * 2019-04-01: :class:`DdosProtectionPlansOperations` + """ + api_version = self._get_api_version('ddos_protection_plans') + if api_version == '2018-02-01': + from .v2018_02_01.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import DdosProtectionPlansOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import DdosProtectionPlansOperations 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 default_security_rules(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`DefaultSecurityRulesOperations` + * 2017-08-01: :class:`DefaultSecurityRulesOperations` + * 2017-09-01: :class:`DefaultSecurityRulesOperations` + * 2017-10-01: :class:`DefaultSecurityRulesOperations` + * 2017-11-01: :class:`DefaultSecurityRulesOperations` + * 2018-01-01: :class:`DefaultSecurityRulesOperations` + * 2018-02-01: :class:`DefaultSecurityRulesOperations` + * 2018-04-01: :class:`DefaultSecurityRulesOperations` + * 2018-06-01: :class:`DefaultSecurityRulesOperations` + * 2018-07-01: :class:`DefaultSecurityRulesOperations` + * 2018-08-01: :class:`DefaultSecurityRulesOperations` + * 2018-10-01: :class:`DefaultSecurityRulesOperations` + * 2018-11-01: :class:`DefaultSecurityRulesOperations` + * 2018-12-01: :class:`DefaultSecurityRulesOperations` + * 2019-02-01: :class:`DefaultSecurityRulesOperations` + * 2019-04-01: :class:`DefaultSecurityRulesOperations` + """ + api_version = self._get_api_version('default_security_rules') + if api_version == '2017-06-01': + from .v2017_06_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import DefaultSecurityRulesOperations 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 express_route_circuit_authorizations(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2016-09-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2016-12-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2017-03-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2017-06-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2017-08-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2017-09-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2017-10-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2017-11-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2018-01-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2018-02-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2018-04-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2018-06-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2018-07-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2018-08-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2018-10-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2018-11-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2018-12-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2019-02-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2019-04-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + """ + api_version = self._get_api_version('express_route_circuit_authorizations') + if api_version == '2015-06-15': + from .v2015_06_15.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ExpressRouteCircuitAuthorizationsOperations 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 express_route_circuit_connections(self): + """Instance depends on the API version: + + * 2018-02-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2018-04-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2018-06-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2018-07-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2018-08-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2018-10-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2018-11-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2018-12-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2019-02-01: :class:`ExpressRouteCircuitConnectionsOperations` + * 2019-04-01: :class:`ExpressRouteCircuitConnectionsOperations` + """ + api_version = self._get_api_version('express_route_circuit_connections') + if api_version == '2018-02-01': + from .v2018_02_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ExpressRouteCircuitConnectionsOperations 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 express_route_circuit_peerings(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`ExpressRouteCircuitPeeringsOperations` + * 2016-09-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2016-12-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2017-03-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2017-06-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2017-08-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2017-09-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2017-10-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2017-11-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2018-01-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2018-02-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2018-04-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2018-06-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2018-07-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2018-08-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2018-10-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2018-11-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2018-12-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2019-02-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2019-04-01: :class:`ExpressRouteCircuitPeeringsOperations` + """ + api_version = self._get_api_version('express_route_circuit_peerings') + if api_version == '2015-06-15': + from .v2015_06_15.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ExpressRouteCircuitPeeringsOperations 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 express_route_circuits(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`ExpressRouteCircuitsOperations` + * 2016-09-01: :class:`ExpressRouteCircuitsOperations` + * 2016-12-01: :class:`ExpressRouteCircuitsOperations` + * 2017-03-01: :class:`ExpressRouteCircuitsOperations` + * 2017-06-01: :class:`ExpressRouteCircuitsOperations` + * 2017-08-01: :class:`ExpressRouteCircuitsOperations` + * 2017-09-01: :class:`ExpressRouteCircuitsOperations` + * 2017-10-01: :class:`ExpressRouteCircuitsOperations` + * 2017-11-01: :class:`ExpressRouteCircuitsOperations` + * 2018-01-01: :class:`ExpressRouteCircuitsOperations` + * 2018-02-01: :class:`ExpressRouteCircuitsOperations` + * 2018-04-01: :class:`ExpressRouteCircuitsOperations` + * 2018-06-01: :class:`ExpressRouteCircuitsOperations` + * 2018-07-01: :class:`ExpressRouteCircuitsOperations` + * 2018-08-01: :class:`ExpressRouteCircuitsOperations` + * 2018-10-01: :class:`ExpressRouteCircuitsOperations` + * 2018-11-01: :class:`ExpressRouteCircuitsOperations` + * 2018-12-01: :class:`ExpressRouteCircuitsOperations` + * 2019-02-01: :class:`ExpressRouteCircuitsOperations` + * 2019-04-01: :class:`ExpressRouteCircuitsOperations` + """ + api_version = self._get_api_version('express_route_circuits') + if api_version == '2015-06-15': + from .v2015_06_15.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ExpressRouteCircuitsOperations 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 express_route_connections(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`ExpressRouteConnectionsOperations` + * 2018-10-01: :class:`ExpressRouteConnectionsOperations` + * 2018-11-01: :class:`ExpressRouteConnectionsOperations` + * 2018-12-01: :class:`ExpressRouteConnectionsOperations` + * 2019-02-01: :class:`ExpressRouteConnectionsOperations` + * 2019-04-01: :class:`ExpressRouteConnectionsOperations` + """ + api_version = self._get_api_version('express_route_connections') + if api_version == '2018-08-01': + from .v2018_08_01.operations import ExpressRouteConnectionsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ExpressRouteConnectionsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ExpressRouteConnectionsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ExpressRouteConnectionsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ExpressRouteConnectionsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ExpressRouteConnectionsOperations 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 express_route_cross_connection_peerings(self): + """Instance depends on the API version: + + * 2018-02-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2018-04-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2018-06-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2018-07-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2018-08-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2018-10-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2018-11-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2018-12-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2019-02-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + * 2019-04-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` + """ + api_version = self._get_api_version('express_route_cross_connection_peerings') + if api_version == '2018-02-01': + from .v2018_02_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ExpressRouteCrossConnectionPeeringsOperations 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 express_route_cross_connections(self): + """Instance depends on the API version: + + * 2018-02-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2018-04-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2018-06-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2018-07-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2018-08-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2018-10-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2018-11-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2018-12-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2019-02-01: :class:`ExpressRouteCrossConnectionsOperations` + * 2019-04-01: :class:`ExpressRouteCrossConnectionsOperations` + """ + api_version = self._get_api_version('express_route_cross_connections') + if api_version == '2018-02-01': + from .v2018_02_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ExpressRouteCrossConnectionsOperations 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 express_route_gateways(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`ExpressRouteGatewaysOperations` + * 2018-10-01: :class:`ExpressRouteGatewaysOperations` + * 2018-11-01: :class:`ExpressRouteGatewaysOperations` + * 2018-12-01: :class:`ExpressRouteGatewaysOperations` + * 2019-02-01: :class:`ExpressRouteGatewaysOperations` + * 2019-04-01: :class:`ExpressRouteGatewaysOperations` + """ + api_version = self._get_api_version('express_route_gateways') + if api_version == '2018-08-01': + from .v2018_08_01.operations import ExpressRouteGatewaysOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ExpressRouteGatewaysOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ExpressRouteGatewaysOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ExpressRouteGatewaysOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ExpressRouteGatewaysOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ExpressRouteGatewaysOperations 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 express_route_links(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`ExpressRouteLinksOperations` + * 2018-10-01: :class:`ExpressRouteLinksOperations` + * 2018-11-01: :class:`ExpressRouteLinksOperations` + * 2018-12-01: :class:`ExpressRouteLinksOperations` + * 2019-02-01: :class:`ExpressRouteLinksOperations` + * 2019-04-01: :class:`ExpressRouteLinksOperations` + """ + api_version = self._get_api_version('express_route_links') + if api_version == '2018-08-01': + from .v2018_08_01.operations import ExpressRouteLinksOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ExpressRouteLinksOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ExpressRouteLinksOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ExpressRouteLinksOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ExpressRouteLinksOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ExpressRouteLinksOperations 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 express_route_ports(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`ExpressRoutePortsOperations` + * 2018-10-01: :class:`ExpressRoutePortsOperations` + * 2018-11-01: :class:`ExpressRoutePortsOperations` + * 2018-12-01: :class:`ExpressRoutePortsOperations` + * 2019-02-01: :class:`ExpressRoutePortsOperations` + * 2019-04-01: :class:`ExpressRoutePortsOperations` + """ + api_version = self._get_api_version('express_route_ports') + if api_version == '2018-08-01': + from .v2018_08_01.operations import ExpressRoutePortsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ExpressRoutePortsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ExpressRoutePortsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ExpressRoutePortsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ExpressRoutePortsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ExpressRoutePortsOperations 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 express_route_ports_locations(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`ExpressRoutePortsLocationsOperations` + * 2018-10-01: :class:`ExpressRoutePortsLocationsOperations` + * 2018-11-01: :class:`ExpressRoutePortsLocationsOperations` + * 2018-12-01: :class:`ExpressRoutePortsLocationsOperations` + * 2019-02-01: :class:`ExpressRoutePortsLocationsOperations` + * 2019-04-01: :class:`ExpressRoutePortsLocationsOperations` + """ + api_version = self._get_api_version('express_route_ports_locations') + if api_version == '2018-08-01': + from .v2018_08_01.operations import ExpressRoutePortsLocationsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ExpressRoutePortsLocationsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ExpressRoutePortsLocationsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ExpressRoutePortsLocationsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ExpressRoutePortsLocationsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ExpressRoutePortsLocationsOperations 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 express_route_service_providers(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`ExpressRouteServiceProvidersOperations` + * 2016-09-01: :class:`ExpressRouteServiceProvidersOperations` + * 2016-12-01: :class:`ExpressRouteServiceProvidersOperations` + * 2017-03-01: :class:`ExpressRouteServiceProvidersOperations` + * 2017-06-01: :class:`ExpressRouteServiceProvidersOperations` + * 2017-08-01: :class:`ExpressRouteServiceProvidersOperations` + * 2017-09-01: :class:`ExpressRouteServiceProvidersOperations` + * 2017-10-01: :class:`ExpressRouteServiceProvidersOperations` + * 2017-11-01: :class:`ExpressRouteServiceProvidersOperations` + * 2018-01-01: :class:`ExpressRouteServiceProvidersOperations` + * 2018-02-01: :class:`ExpressRouteServiceProvidersOperations` + * 2018-04-01: :class:`ExpressRouteServiceProvidersOperations` + * 2018-06-01: :class:`ExpressRouteServiceProvidersOperations` + * 2018-07-01: :class:`ExpressRouteServiceProvidersOperations` + * 2018-08-01: :class:`ExpressRouteServiceProvidersOperations` + * 2018-10-01: :class:`ExpressRouteServiceProvidersOperations` + * 2018-11-01: :class:`ExpressRouteServiceProvidersOperations` + * 2018-12-01: :class:`ExpressRouteServiceProvidersOperations` + * 2019-02-01: :class:`ExpressRouteServiceProvidersOperations` + * 2019-04-01: :class:`ExpressRouteServiceProvidersOperations` + """ + api_version = self._get_api_version('express_route_service_providers') + if api_version == '2015-06-15': + from .v2015_06_15.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ExpressRouteServiceProvidersOperations 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 hub_virtual_network_connections(self): + """Instance depends on the API version: + + * 2018-04-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2018-06-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2018-07-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2018-08-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2018-10-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2018-11-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2018-12-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2019-02-01: :class:`HubVirtualNetworkConnectionsOperations` + * 2019-04-01: :class:`HubVirtualNetworkConnectionsOperations` + """ + api_version = self._get_api_version('hub_virtual_network_connections') + if api_version == '2018-04-01': + from .v2018_04_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import HubVirtualNetworkConnectionsOperations 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 inbound_nat_rules(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`InboundNatRulesOperations` + * 2017-08-01: :class:`InboundNatRulesOperations` + * 2017-09-01: :class:`InboundNatRulesOperations` + * 2017-10-01: :class:`InboundNatRulesOperations` + * 2017-11-01: :class:`InboundNatRulesOperations` + * 2018-01-01: :class:`InboundNatRulesOperations` + * 2018-02-01: :class:`InboundNatRulesOperations` + * 2018-04-01: :class:`InboundNatRulesOperations` + * 2018-06-01: :class:`InboundNatRulesOperations` + * 2018-07-01: :class:`InboundNatRulesOperations` + * 2018-08-01: :class:`InboundNatRulesOperations` + * 2018-10-01: :class:`InboundNatRulesOperations` + * 2018-11-01: :class:`InboundNatRulesOperations` + * 2018-12-01: :class:`InboundNatRulesOperations` + * 2019-02-01: :class:`InboundNatRulesOperations` + * 2019-04-01: :class:`InboundNatRulesOperations` + """ + api_version = self._get_api_version('inbound_nat_rules') + if api_version == '2017-06-01': + from .v2017_06_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import InboundNatRulesOperations 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 interface_endpoints(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`InterfaceEndpointsOperations` + * 2018-10-01: :class:`InterfaceEndpointsOperations` + * 2018-11-01: :class:`InterfaceEndpointsOperations` + * 2018-12-01: :class:`InterfaceEndpointsOperations` + * 2019-02-01: :class:`InterfaceEndpointsOperations` + """ + api_version = self._get_api_version('interface_endpoints') + if api_version == '2018-08-01': + from .v2018_08_01.operations import InterfaceEndpointsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import InterfaceEndpointsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import InterfaceEndpointsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import InterfaceEndpointsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import InterfaceEndpointsOperations 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 load_balancer_backend_address_pools(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2017-08-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2017-09-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2017-10-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2017-11-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2018-01-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2018-02-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2018-04-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2018-06-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2018-07-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2018-08-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2018-10-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2018-11-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2018-12-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2019-02-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2019-04-01: :class:`LoadBalancerBackendAddressPoolsOperations` + """ + api_version = self._get_api_version('load_balancer_backend_address_pools') + if api_version == '2017-06-01': + from .v2017_06_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import LoadBalancerBackendAddressPoolsOperations 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 load_balancer_frontend_ip_configurations(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2017-08-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2017-09-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2017-10-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2017-11-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2018-01-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2018-02-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2018-04-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2018-06-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2018-07-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2018-08-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2018-10-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2018-11-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2018-12-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2019-02-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2019-04-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + """ + api_version = self._get_api_version('load_balancer_frontend_ip_configurations') + if api_version == '2017-06-01': + from .v2017_06_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import LoadBalancerFrontendIPConfigurationsOperations 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 load_balancer_load_balancing_rules(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2017-08-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2017-09-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2017-10-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2017-11-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2018-01-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2018-02-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2018-04-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2018-06-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2018-07-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2018-08-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2018-10-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2018-11-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2018-12-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2019-02-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2019-04-01: :class:`LoadBalancerLoadBalancingRulesOperations` + """ + api_version = self._get_api_version('load_balancer_load_balancing_rules') + if api_version == '2017-06-01': + from .v2017_06_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import LoadBalancerLoadBalancingRulesOperations 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 load_balancer_network_interfaces(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2017-08-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2017-09-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2017-10-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2017-11-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2018-01-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2018-02-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2018-04-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2018-06-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2018-07-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2018-08-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2018-10-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2018-11-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2018-12-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2019-02-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2019-04-01: :class:`LoadBalancerNetworkInterfacesOperations` + """ + api_version = self._get_api_version('load_balancer_network_interfaces') + if api_version == '2017-06-01': + from .v2017_06_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import LoadBalancerNetworkInterfacesOperations 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 load_balancer_outbound_rules(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`LoadBalancerOutboundRulesOperations` + * 2018-10-01: :class:`LoadBalancerOutboundRulesOperations` + * 2018-11-01: :class:`LoadBalancerOutboundRulesOperations` + * 2018-12-01: :class:`LoadBalancerOutboundRulesOperations` + * 2019-02-01: :class:`LoadBalancerOutboundRulesOperations` + * 2019-04-01: :class:`LoadBalancerOutboundRulesOperations` + """ + api_version = self._get_api_version('load_balancer_outbound_rules') + if api_version == '2018-08-01': + from .v2018_08_01.operations import LoadBalancerOutboundRulesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import LoadBalancerOutboundRulesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import LoadBalancerOutboundRulesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import LoadBalancerOutboundRulesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import LoadBalancerOutboundRulesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import LoadBalancerOutboundRulesOperations 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 load_balancer_probes(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`LoadBalancerProbesOperations` + * 2017-08-01: :class:`LoadBalancerProbesOperations` + * 2017-09-01: :class:`LoadBalancerProbesOperations` + * 2017-10-01: :class:`LoadBalancerProbesOperations` + * 2017-11-01: :class:`LoadBalancerProbesOperations` + * 2018-01-01: :class:`LoadBalancerProbesOperations` + * 2018-02-01: :class:`LoadBalancerProbesOperations` + * 2018-04-01: :class:`LoadBalancerProbesOperations` + * 2018-06-01: :class:`LoadBalancerProbesOperations` + * 2018-07-01: :class:`LoadBalancerProbesOperations` + * 2018-08-01: :class:`LoadBalancerProbesOperations` + * 2018-10-01: :class:`LoadBalancerProbesOperations` + * 2018-11-01: :class:`LoadBalancerProbesOperations` + * 2018-12-01: :class:`LoadBalancerProbesOperations` + * 2019-02-01: :class:`LoadBalancerProbesOperations` + * 2019-04-01: :class:`LoadBalancerProbesOperations` + """ + api_version = self._get_api_version('load_balancer_probes') + if api_version == '2017-06-01': + from .v2017_06_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import LoadBalancerProbesOperations 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 load_balancers(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`LoadBalancersOperations` + * 2016-09-01: :class:`LoadBalancersOperations` + * 2016-12-01: :class:`LoadBalancersOperations` + * 2017-03-01: :class:`LoadBalancersOperations` + * 2017-06-01: :class:`LoadBalancersOperations` + * 2017-08-01: :class:`LoadBalancersOperations` + * 2017-09-01: :class:`LoadBalancersOperations` + * 2017-10-01: :class:`LoadBalancersOperations` + * 2017-11-01: :class:`LoadBalancersOperations` + * 2018-01-01: :class:`LoadBalancersOperations` + * 2018-02-01: :class:`LoadBalancersOperations` + * 2018-04-01: :class:`LoadBalancersOperations` + * 2018-06-01: :class:`LoadBalancersOperations` + * 2018-07-01: :class:`LoadBalancersOperations` + * 2018-08-01: :class:`LoadBalancersOperations` + * 2018-10-01: :class:`LoadBalancersOperations` + * 2018-11-01: :class:`LoadBalancersOperations` + * 2018-12-01: :class:`LoadBalancersOperations` + * 2019-02-01: :class:`LoadBalancersOperations` + * 2019-04-01: :class:`LoadBalancersOperations` + """ + api_version = self._get_api_version('load_balancers') + if api_version == '2015-06-15': + from .v2015_06_15.operations import LoadBalancersOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import LoadBalancersOperations 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 local_network_gateways(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`LocalNetworkGatewaysOperations` + * 2016-09-01: :class:`LocalNetworkGatewaysOperations` + * 2016-12-01: :class:`LocalNetworkGatewaysOperations` + * 2017-03-01: :class:`LocalNetworkGatewaysOperations` + * 2017-06-01: :class:`LocalNetworkGatewaysOperations` + * 2017-08-01: :class:`LocalNetworkGatewaysOperations` + * 2017-09-01: :class:`LocalNetworkGatewaysOperations` + * 2017-10-01: :class:`LocalNetworkGatewaysOperations` + * 2017-11-01: :class:`LocalNetworkGatewaysOperations` + * 2018-01-01: :class:`LocalNetworkGatewaysOperations` + * 2018-02-01: :class:`LocalNetworkGatewaysOperations` + * 2018-04-01: :class:`LocalNetworkGatewaysOperations` + * 2018-06-01: :class:`LocalNetworkGatewaysOperations` + * 2018-07-01: :class:`LocalNetworkGatewaysOperations` + * 2018-08-01: :class:`LocalNetworkGatewaysOperations` + * 2018-10-01: :class:`LocalNetworkGatewaysOperations` + * 2018-11-01: :class:`LocalNetworkGatewaysOperations` + * 2018-12-01: :class:`LocalNetworkGatewaysOperations` + * 2019-02-01: :class:`LocalNetworkGatewaysOperations` + * 2019-04-01: :class:`LocalNetworkGatewaysOperations` + """ + api_version = self._get_api_version('local_network_gateways') + if api_version == '2015-06-15': + from .v2015_06_15.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import LocalNetworkGatewaysOperations 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 nat_gateways(self): + """Instance depends on the API version: + + * 2019-02-01: :class:`NatGatewaysOperations` + * 2019-04-01: :class:`NatGatewaysOperations` + """ + api_version = self._get_api_version('nat_gateways') + if api_version == '2019-02-01': + from .v2019_02_01.operations import NatGatewaysOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import NatGatewaysOperations 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 network_interface_ip_configurations(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2017-08-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2017-09-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2017-10-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2017-11-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2018-01-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2018-02-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2018-04-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2018-06-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2018-07-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2018-08-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2018-10-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2018-11-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2018-12-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2019-02-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2019-04-01: :class:`NetworkInterfaceIPConfigurationsOperations` + """ + api_version = self._get_api_version('network_interface_ip_configurations') + if api_version == '2017-06-01': + from .v2017_06_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import NetworkInterfaceIPConfigurationsOperations 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 network_interface_load_balancers(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2017-08-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2017-09-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2017-10-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2017-11-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2018-01-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2018-02-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2018-04-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2018-06-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2018-07-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2018-08-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2018-10-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2018-11-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2018-12-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2019-02-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2019-04-01: :class:`NetworkInterfaceLoadBalancersOperations` + """ + api_version = self._get_api_version('network_interface_load_balancers') + if api_version == '2017-06-01': + from .v2017_06_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import NetworkInterfaceLoadBalancersOperations 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 network_interface_tap_configurations(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`NetworkInterfaceTapConfigurationsOperations` + * 2018-10-01: :class:`NetworkInterfaceTapConfigurationsOperations` + * 2018-11-01: :class:`NetworkInterfaceTapConfigurationsOperations` + * 2018-12-01: :class:`NetworkInterfaceTapConfigurationsOperations` + * 2019-02-01: :class:`NetworkInterfaceTapConfigurationsOperations` + * 2019-04-01: :class:`NetworkInterfaceTapConfigurationsOperations` + """ + api_version = self._get_api_version('network_interface_tap_configurations') + if api_version == '2018-08-01': + from .v2018_08_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import NetworkInterfaceTapConfigurationsOperations 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 network_interfaces(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`NetworkInterfacesOperations` + * 2016-09-01: :class:`NetworkInterfacesOperations` + * 2016-12-01: :class:`NetworkInterfacesOperations` + * 2017-03-01: :class:`NetworkInterfacesOperations` + * 2017-06-01: :class:`NetworkInterfacesOperations` + * 2017-08-01: :class:`NetworkInterfacesOperations` + * 2017-09-01: :class:`NetworkInterfacesOperations` + * 2017-10-01: :class:`NetworkInterfacesOperations` + * 2017-11-01: :class:`NetworkInterfacesOperations` + * 2018-01-01: :class:`NetworkInterfacesOperations` + * 2018-02-01: :class:`NetworkInterfacesOperations` + * 2018-04-01: :class:`NetworkInterfacesOperations` + * 2018-06-01: :class:`NetworkInterfacesOperations` + * 2018-07-01: :class:`NetworkInterfacesOperations` + * 2018-08-01: :class:`NetworkInterfacesOperations` + * 2018-10-01: :class:`NetworkInterfacesOperations` + * 2018-11-01: :class:`NetworkInterfacesOperations` + * 2018-12-01: :class:`NetworkInterfacesOperations` + * 2019-02-01: :class:`NetworkInterfacesOperations` + * 2019-04-01: :class:`NetworkInterfacesOperations` + """ + api_version = self._get_api_version('network_interfaces') + if api_version == '2015-06-15': + from .v2015_06_15.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import NetworkInterfacesOperations 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 network_profiles(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`NetworkProfilesOperations` + * 2018-10-01: :class:`NetworkProfilesOperations` + * 2018-11-01: :class:`NetworkProfilesOperations` + * 2018-12-01: :class:`NetworkProfilesOperations` + * 2019-02-01: :class:`NetworkProfilesOperations` + * 2019-04-01: :class:`NetworkProfilesOperations` + """ + api_version = self._get_api_version('network_profiles') + if api_version == '2018-08-01': + from .v2018_08_01.operations import NetworkProfilesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import NetworkProfilesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import NetworkProfilesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import NetworkProfilesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import NetworkProfilesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import NetworkProfilesOperations 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 network_security_groups(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`NetworkSecurityGroupsOperations` + * 2016-09-01: :class:`NetworkSecurityGroupsOperations` + * 2016-12-01: :class:`NetworkSecurityGroupsOperations` + * 2017-03-01: :class:`NetworkSecurityGroupsOperations` + * 2017-06-01: :class:`NetworkSecurityGroupsOperations` + * 2017-08-01: :class:`NetworkSecurityGroupsOperations` + * 2017-09-01: :class:`NetworkSecurityGroupsOperations` + * 2017-10-01: :class:`NetworkSecurityGroupsOperations` + * 2017-11-01: :class:`NetworkSecurityGroupsOperations` + * 2018-01-01: :class:`NetworkSecurityGroupsOperations` + * 2018-02-01: :class:`NetworkSecurityGroupsOperations` + * 2018-04-01: :class:`NetworkSecurityGroupsOperations` + * 2018-06-01: :class:`NetworkSecurityGroupsOperations` + * 2018-07-01: :class:`NetworkSecurityGroupsOperations` + * 2018-08-01: :class:`NetworkSecurityGroupsOperations` + * 2018-10-01: :class:`NetworkSecurityGroupsOperations` + * 2018-11-01: :class:`NetworkSecurityGroupsOperations` + * 2018-12-01: :class:`NetworkSecurityGroupsOperations` + * 2019-02-01: :class:`NetworkSecurityGroupsOperations` + * 2019-04-01: :class:`NetworkSecurityGroupsOperations` + """ + api_version = self._get_api_version('network_security_groups') + if api_version == '2015-06-15': + from .v2015_06_15.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import NetworkSecurityGroupsOperations 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 network_watchers(self): + """Instance depends on the API version: + + * 2016-09-01: :class:`NetworkWatchersOperations` + * 2016-12-01: :class:`NetworkWatchersOperations` + * 2017-03-01: :class:`NetworkWatchersOperations` + * 2017-06-01: :class:`NetworkWatchersOperations` + * 2017-08-01: :class:`NetworkWatchersOperations` + * 2017-09-01: :class:`NetworkWatchersOperations` + * 2017-10-01: :class:`NetworkWatchersOperations` + * 2017-11-01: :class:`NetworkWatchersOperations` + * 2018-01-01: :class:`NetworkWatchersOperations` + * 2018-02-01: :class:`NetworkWatchersOperations` + * 2018-04-01: :class:`NetworkWatchersOperations` + * 2018-06-01: :class:`NetworkWatchersOperations` + * 2018-07-01: :class:`NetworkWatchersOperations` + * 2018-08-01: :class:`NetworkWatchersOperations` + * 2018-10-01: :class:`NetworkWatchersOperations` + * 2018-11-01: :class:`NetworkWatchersOperations` + * 2018-12-01: :class:`NetworkWatchersOperations` + * 2019-02-01: :class:`NetworkWatchersOperations` + * 2019-04-01: :class:`NetworkWatchersOperations` + """ + api_version = self._get_api_version('network_watchers') + if api_version == '2016-09-01': + from .v2016_09_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import NetworkWatchersOperations 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): + """Instance depends on the API version: + + * 2017-09-01: :class:`Operations` + * 2017-10-01: :class:`Operations` + * 2017-11-01: :class:`Operations` + * 2018-01-01: :class:`Operations` + * 2018-02-01: :class:`Operations` + * 2018-04-01: :class:`Operations` + * 2018-06-01: :class:`Operations` + * 2018-07-01: :class:`Operations` + * 2018-08-01: :class:`Operations` + * 2018-10-01: :class:`Operations` + * 2018-11-01: :class:`Operations` + * 2018-12-01: :class:`Operations` + * 2019-02-01: :class:`Operations` + * 2019-04-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2017-09-01': + from .v2017_09_01.operations import Operations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import Operations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import Operations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import Operations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import Operations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import Operations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import Operations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import Operations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import Operations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import Operations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import Operations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import Operations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import Operations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import Operations 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 packet_captures(self): + """Instance depends on the API version: + + * 2016-09-01: :class:`PacketCapturesOperations` + * 2016-12-01: :class:`PacketCapturesOperations` + * 2017-03-01: :class:`PacketCapturesOperations` + * 2017-06-01: :class:`PacketCapturesOperations` + * 2017-08-01: :class:`PacketCapturesOperations` + * 2017-09-01: :class:`PacketCapturesOperations` + * 2017-10-01: :class:`PacketCapturesOperations` + * 2017-11-01: :class:`PacketCapturesOperations` + * 2018-01-01: :class:`PacketCapturesOperations` + * 2018-02-01: :class:`PacketCapturesOperations` + * 2018-04-01: :class:`PacketCapturesOperations` + * 2018-06-01: :class:`PacketCapturesOperations` + * 2018-07-01: :class:`PacketCapturesOperations` + * 2018-08-01: :class:`PacketCapturesOperations` + * 2018-10-01: :class:`PacketCapturesOperations` + * 2018-11-01: :class:`PacketCapturesOperations` + * 2018-12-01: :class:`PacketCapturesOperations` + * 2019-02-01: :class:`PacketCapturesOperations` + * 2019-04-01: :class:`PacketCapturesOperations` + """ + api_version = self._get_api_version('packet_captures') + if api_version == '2016-09-01': + from .v2016_09_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import PacketCapturesOperations 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 peer_express_route_circuit_connections(self): + """Instance depends on the API version: + + * 2018-12-01: :class:`PeerExpressRouteCircuitConnectionsOperations` + * 2019-02-01: :class:`PeerExpressRouteCircuitConnectionsOperations` + * 2019-04-01: :class:`PeerExpressRouteCircuitConnectionsOperations` + """ + api_version = self._get_api_version('peer_express_route_circuit_connections') + if api_version == '2018-12-01': + from .v2018_12_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import PeerExpressRouteCircuitConnectionsOperations 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 private_endpoints(self): + """Instance depends on the API version: + + * 2019-04-01: :class:`PrivateEndpointsOperations` + """ + api_version = self._get_api_version('private_endpoints') + if api_version == '2019-04-01': + from .v2019_04_01.operations import PrivateEndpointsOperations 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 private_link_services(self): + """Instance depends on the API version: + + * 2019-04-01: :class:`PrivateLinkServicesOperations` + """ + api_version = self._get_api_version('private_link_services') + if api_version == '2019-04-01': + from .v2019_04_01.operations import PrivateLinkServicesOperations 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 public_ip_addresses(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`PublicIPAddressesOperations` + * 2016-09-01: :class:`PublicIPAddressesOperations` + * 2016-12-01: :class:`PublicIPAddressesOperations` + * 2017-03-01: :class:`PublicIPAddressesOperations` + * 2017-06-01: :class:`PublicIPAddressesOperations` + * 2017-08-01: :class:`PublicIPAddressesOperations` + * 2017-09-01: :class:`PublicIPAddressesOperations` + * 2017-10-01: :class:`PublicIPAddressesOperations` + * 2017-11-01: :class:`PublicIPAddressesOperations` + * 2018-01-01: :class:`PublicIPAddressesOperations` + * 2018-02-01: :class:`PublicIPAddressesOperations` + * 2018-04-01: :class:`PublicIPAddressesOperations` + * 2018-06-01: :class:`PublicIPAddressesOperations` + * 2018-07-01: :class:`PublicIPAddressesOperations` + * 2018-08-01: :class:`PublicIPAddressesOperations` + * 2018-10-01: :class:`PublicIPAddressesOperations` + * 2018-11-01: :class:`PublicIPAddressesOperations` + * 2018-12-01: :class:`PublicIPAddressesOperations` + * 2019-02-01: :class:`PublicIPAddressesOperations` + * 2019-04-01: :class:`PublicIPAddressesOperations` + """ + api_version = self._get_api_version('public_ip_addresses') + if api_version == '2015-06-15': + from .v2015_06_15.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import PublicIPAddressesOperations 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 public_ip_prefixes(self): + """Instance depends on the API version: + + * 2018-07-01: :class:`PublicIPPrefixesOperations` + * 2018-08-01: :class:`PublicIPPrefixesOperations` + * 2018-10-01: :class:`PublicIPPrefixesOperations` + * 2018-11-01: :class:`PublicIPPrefixesOperations` + * 2018-12-01: :class:`PublicIPPrefixesOperations` + * 2019-02-01: :class:`PublicIPPrefixesOperations` + * 2019-04-01: :class:`PublicIPPrefixesOperations` + """ + api_version = self._get_api_version('public_ip_prefixes') + if api_version == '2018-07-01': + from .v2018_07_01.operations import PublicIPPrefixesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import PublicIPPrefixesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import PublicIPPrefixesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import PublicIPPrefixesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import PublicIPPrefixesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import PublicIPPrefixesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import PublicIPPrefixesOperations 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 resource_navigation_links(self): + """Instance depends on the API version: + + * 2019-02-01: :class:`ResourceNavigationLinksOperations` + * 2019-04-01: :class:`ResourceNavigationLinksOperations` + """ + api_version = self._get_api_version('resource_navigation_links') + if api_version == '2019-02-01': + from .v2019_02_01.operations import ResourceNavigationLinksOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ResourceNavigationLinksOperations 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 route_filter_rules(self): + """Instance depends on the API version: + + * 2016-12-01: :class:`RouteFilterRulesOperations` + * 2017-03-01: :class:`RouteFilterRulesOperations` + * 2017-06-01: :class:`RouteFilterRulesOperations` + * 2017-08-01: :class:`RouteFilterRulesOperations` + * 2017-09-01: :class:`RouteFilterRulesOperations` + * 2017-10-01: :class:`RouteFilterRulesOperations` + * 2017-11-01: :class:`RouteFilterRulesOperations` + * 2018-01-01: :class:`RouteFilterRulesOperations` + * 2018-02-01: :class:`RouteFilterRulesOperations` + * 2018-04-01: :class:`RouteFilterRulesOperations` + * 2018-06-01: :class:`RouteFilterRulesOperations` + * 2018-07-01: :class:`RouteFilterRulesOperations` + * 2018-08-01: :class:`RouteFilterRulesOperations` + * 2018-10-01: :class:`RouteFilterRulesOperations` + * 2018-11-01: :class:`RouteFilterRulesOperations` + * 2018-12-01: :class:`RouteFilterRulesOperations` + * 2019-02-01: :class:`RouteFilterRulesOperations` + * 2019-04-01: :class:`RouteFilterRulesOperations` + """ + api_version = self._get_api_version('route_filter_rules') + if api_version == '2016-12-01': + from .v2016_12_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import RouteFilterRulesOperations 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 route_filters(self): + """Instance depends on the API version: + + * 2016-12-01: :class:`RouteFiltersOperations` + * 2017-03-01: :class:`RouteFiltersOperations` + * 2017-06-01: :class:`RouteFiltersOperations` + * 2017-08-01: :class:`RouteFiltersOperations` + * 2017-09-01: :class:`RouteFiltersOperations` + * 2017-10-01: :class:`RouteFiltersOperations` + * 2017-11-01: :class:`RouteFiltersOperations` + * 2018-01-01: :class:`RouteFiltersOperations` + * 2018-02-01: :class:`RouteFiltersOperations` + * 2018-04-01: :class:`RouteFiltersOperations` + * 2018-06-01: :class:`RouteFiltersOperations` + * 2018-07-01: :class:`RouteFiltersOperations` + * 2018-08-01: :class:`RouteFiltersOperations` + * 2018-10-01: :class:`RouteFiltersOperations` + * 2018-11-01: :class:`RouteFiltersOperations` + * 2018-12-01: :class:`RouteFiltersOperations` + * 2019-02-01: :class:`RouteFiltersOperations` + * 2019-04-01: :class:`RouteFiltersOperations` + """ + api_version = self._get_api_version('route_filters') + if api_version == '2016-12-01': + from .v2016_12_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import RouteFiltersOperations 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 route_tables(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`RouteTablesOperations` + * 2016-09-01: :class:`RouteTablesOperations` + * 2016-12-01: :class:`RouteTablesOperations` + * 2017-03-01: :class:`RouteTablesOperations` + * 2017-06-01: :class:`RouteTablesOperations` + * 2017-08-01: :class:`RouteTablesOperations` + * 2017-09-01: :class:`RouteTablesOperations` + * 2017-10-01: :class:`RouteTablesOperations` + * 2017-11-01: :class:`RouteTablesOperations` + * 2018-01-01: :class:`RouteTablesOperations` + * 2018-02-01: :class:`RouteTablesOperations` + * 2018-04-01: :class:`RouteTablesOperations` + * 2018-06-01: :class:`RouteTablesOperations` + * 2018-07-01: :class:`RouteTablesOperations` + * 2018-08-01: :class:`RouteTablesOperations` + * 2018-10-01: :class:`RouteTablesOperations` + * 2018-11-01: :class:`RouteTablesOperations` + * 2018-12-01: :class:`RouteTablesOperations` + * 2019-02-01: :class:`RouteTablesOperations` + * 2019-04-01: :class:`RouteTablesOperations` + """ + api_version = self._get_api_version('route_tables') + if api_version == '2015-06-15': + from .v2015_06_15.operations import RouteTablesOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import RouteTablesOperations 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 routes(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`RoutesOperations` + * 2016-09-01: :class:`RoutesOperations` + * 2016-12-01: :class:`RoutesOperations` + * 2017-03-01: :class:`RoutesOperations` + * 2017-06-01: :class:`RoutesOperations` + * 2017-08-01: :class:`RoutesOperations` + * 2017-09-01: :class:`RoutesOperations` + * 2017-10-01: :class:`RoutesOperations` + * 2017-11-01: :class:`RoutesOperations` + * 2018-01-01: :class:`RoutesOperations` + * 2018-02-01: :class:`RoutesOperations` + * 2018-04-01: :class:`RoutesOperations` + * 2018-06-01: :class:`RoutesOperations` + * 2018-07-01: :class:`RoutesOperations` + * 2018-08-01: :class:`RoutesOperations` + * 2018-10-01: :class:`RoutesOperations` + * 2018-11-01: :class:`RoutesOperations` + * 2018-12-01: :class:`RoutesOperations` + * 2019-02-01: :class:`RoutesOperations` + * 2019-04-01: :class:`RoutesOperations` + """ + api_version = self._get_api_version('routes') + if api_version == '2015-06-15': + from .v2015_06_15.operations import RoutesOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import RoutesOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import RoutesOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import RoutesOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import RoutesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import RoutesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import RoutesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import RoutesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import RoutesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import RoutesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import RoutesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import RoutesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import RoutesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import RoutesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import RoutesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import RoutesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import RoutesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import RoutesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import RoutesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import RoutesOperations 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 security_rules(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`SecurityRulesOperations` + * 2016-09-01: :class:`SecurityRulesOperations` + * 2016-12-01: :class:`SecurityRulesOperations` + * 2017-03-01: :class:`SecurityRulesOperations` + * 2017-06-01: :class:`SecurityRulesOperations` + * 2017-08-01: :class:`SecurityRulesOperations` + * 2017-09-01: :class:`SecurityRulesOperations` + * 2017-10-01: :class:`SecurityRulesOperations` + * 2017-11-01: :class:`SecurityRulesOperations` + * 2018-01-01: :class:`SecurityRulesOperations` + * 2018-02-01: :class:`SecurityRulesOperations` + * 2018-04-01: :class:`SecurityRulesOperations` + * 2018-06-01: :class:`SecurityRulesOperations` + * 2018-07-01: :class:`SecurityRulesOperations` + * 2018-08-01: :class:`SecurityRulesOperations` + * 2018-10-01: :class:`SecurityRulesOperations` + * 2018-11-01: :class:`SecurityRulesOperations` + * 2018-12-01: :class:`SecurityRulesOperations` + * 2019-02-01: :class:`SecurityRulesOperations` + * 2019-04-01: :class:`SecurityRulesOperations` + """ + api_version = self._get_api_version('security_rules') + if api_version == '2015-06-15': + from .v2015_06_15.operations import SecurityRulesOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import SecurityRulesOperations 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 service_association_links(self): + """Instance depends on the API version: + + * 2019-02-01: :class:`ServiceAssociationLinksOperations` + * 2019-04-01: :class:`ServiceAssociationLinksOperations` + """ + api_version = self._get_api_version('service_association_links') + if api_version == '2019-02-01': + from .v2019_02_01.operations import ServiceAssociationLinksOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ServiceAssociationLinksOperations 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 service_endpoint_policies(self): + """Instance depends on the API version: + + * 2018-07-01: :class:`ServiceEndpointPoliciesOperations` + * 2018-08-01: :class:`ServiceEndpointPoliciesOperations` + * 2018-10-01: :class:`ServiceEndpointPoliciesOperations` + * 2018-11-01: :class:`ServiceEndpointPoliciesOperations` + * 2018-12-01: :class:`ServiceEndpointPoliciesOperations` + * 2019-02-01: :class:`ServiceEndpointPoliciesOperations` + * 2019-04-01: :class:`ServiceEndpointPoliciesOperations` + """ + api_version = self._get_api_version('service_endpoint_policies') + if api_version == '2018-07-01': + from .v2018_07_01.operations import ServiceEndpointPoliciesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import ServiceEndpointPoliciesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ServiceEndpointPoliciesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ServiceEndpointPoliciesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ServiceEndpointPoliciesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ServiceEndpointPoliciesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ServiceEndpointPoliciesOperations 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 service_endpoint_policy_definitions(self): + """Instance depends on the API version: + + * 2018-07-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + * 2018-08-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + * 2018-10-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + * 2018-11-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + * 2018-12-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + * 2019-02-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + * 2019-04-01: :class:`ServiceEndpointPolicyDefinitionsOperations` + """ + api_version = self._get_api_version('service_endpoint_policy_definitions') + if api_version == '2018-07-01': + from .v2018_07_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ServiceEndpointPolicyDefinitionsOperations 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 service_tags(self): + """Instance depends on the API version: + + * 2019-04-01: :class:`ServiceTagsOperations` + """ + api_version = self._get_api_version('service_tags') + if api_version == '2019-04-01': + from .v2019_04_01.operations import ServiceTagsOperations 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 subnets(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`SubnetsOperations` + * 2016-09-01: :class:`SubnetsOperations` + * 2016-12-01: :class:`SubnetsOperations` + * 2017-03-01: :class:`SubnetsOperations` + * 2017-06-01: :class:`SubnetsOperations` + * 2017-08-01: :class:`SubnetsOperations` + * 2017-09-01: :class:`SubnetsOperations` + * 2017-10-01: :class:`SubnetsOperations` + * 2017-11-01: :class:`SubnetsOperations` + * 2018-01-01: :class:`SubnetsOperations` + * 2018-02-01: :class:`SubnetsOperations` + * 2018-04-01: :class:`SubnetsOperations` + * 2018-06-01: :class:`SubnetsOperations` + * 2018-07-01: :class:`SubnetsOperations` + * 2018-08-01: :class:`SubnetsOperations` + * 2018-10-01: :class:`SubnetsOperations` + * 2018-11-01: :class:`SubnetsOperations` + * 2018-12-01: :class:`SubnetsOperations` + * 2019-02-01: :class:`SubnetsOperations` + * 2019-04-01: :class:`SubnetsOperations` + """ + api_version = self._get_api_version('subnets') + if api_version == '2015-06-15': + from .v2015_06_15.operations import SubnetsOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import SubnetsOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import SubnetsOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import SubnetsOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import SubnetsOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import SubnetsOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import SubnetsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import SubnetsOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import SubnetsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import SubnetsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import SubnetsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import SubnetsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import SubnetsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import SubnetsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import SubnetsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import SubnetsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import SubnetsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import SubnetsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import SubnetsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import SubnetsOperations 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 usages(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`UsagesOperations` + * 2016-09-01: :class:`UsagesOperations` + * 2016-12-01: :class:`UsagesOperations` + * 2017-03-01: :class:`UsagesOperations` + * 2017-06-01: :class:`UsagesOperations` + * 2017-08-01: :class:`UsagesOperations` + * 2017-09-01: :class:`UsagesOperations` + * 2017-10-01: :class:`UsagesOperations` + * 2017-11-01: :class:`UsagesOperations` + * 2018-01-01: :class:`UsagesOperations` + * 2018-02-01: :class:`UsagesOperations` + * 2018-04-01: :class:`UsagesOperations` + * 2018-06-01: :class:`UsagesOperations` + * 2018-07-01: :class:`UsagesOperations` + * 2018-08-01: :class:`UsagesOperations` + * 2018-10-01: :class:`UsagesOperations` + * 2018-11-01: :class:`UsagesOperations` + * 2018-12-01: :class:`UsagesOperations` + * 2019-02-01: :class:`UsagesOperations` + * 2019-04-01: :class:`UsagesOperations` + """ + api_version = self._get_api_version('usages') + if api_version == '2015-06-15': + from .v2015_06_15.operations import UsagesOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import UsagesOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import UsagesOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import UsagesOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import UsagesOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import UsagesOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import UsagesOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import UsagesOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import UsagesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import UsagesOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import UsagesOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import UsagesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import UsagesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import UsagesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import UsagesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import UsagesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import UsagesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import UsagesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import UsagesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import UsagesOperations 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 virtual_hubs(self): + """Instance depends on the API version: + + * 2018-04-01: :class:`VirtualHubsOperations` + * 2018-06-01: :class:`VirtualHubsOperations` + * 2018-07-01: :class:`VirtualHubsOperations` + * 2018-08-01: :class:`VirtualHubsOperations` + * 2018-10-01: :class:`VirtualHubsOperations` + * 2018-11-01: :class:`VirtualHubsOperations` + * 2018-12-01: :class:`VirtualHubsOperations` + * 2019-02-01: :class:`VirtualHubsOperations` + * 2019-04-01: :class:`VirtualHubsOperations` + """ + api_version = self._get_api_version('virtual_hubs') + if api_version == '2018-04-01': + from .v2018_04_01.operations import VirtualHubsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import VirtualHubsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import VirtualHubsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import VirtualHubsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import VirtualHubsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import VirtualHubsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import VirtualHubsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import VirtualHubsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import VirtualHubsOperations 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 virtual_network_gateway_connections(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2016-09-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2016-12-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2017-03-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2017-06-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2017-08-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2017-09-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2017-10-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2017-11-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2018-01-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2018-02-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2018-04-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2018-06-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2018-07-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2018-08-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2018-10-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2018-11-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2018-12-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2019-02-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2019-04-01: :class:`VirtualNetworkGatewayConnectionsOperations` + """ + api_version = self._get_api_version('virtual_network_gateway_connections') + if api_version == '2015-06-15': + from .v2015_06_15.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import VirtualNetworkGatewayConnectionsOperations 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 virtual_network_gateways(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`VirtualNetworkGatewaysOperations` + * 2016-09-01: :class:`VirtualNetworkGatewaysOperations` + * 2016-12-01: :class:`VirtualNetworkGatewaysOperations` + * 2017-03-01: :class:`VirtualNetworkGatewaysOperations` + * 2017-06-01: :class:`VirtualNetworkGatewaysOperations` + * 2017-08-01: :class:`VirtualNetworkGatewaysOperations` + * 2017-09-01: :class:`VirtualNetworkGatewaysOperations` + * 2017-10-01: :class:`VirtualNetworkGatewaysOperations` + * 2017-11-01: :class:`VirtualNetworkGatewaysOperations` + * 2018-01-01: :class:`VirtualNetworkGatewaysOperations` + * 2018-02-01: :class:`VirtualNetworkGatewaysOperations` + * 2018-04-01: :class:`VirtualNetworkGatewaysOperations` + * 2018-06-01: :class:`VirtualNetworkGatewaysOperations` + * 2018-07-01: :class:`VirtualNetworkGatewaysOperations` + * 2018-08-01: :class:`VirtualNetworkGatewaysOperations` + * 2018-10-01: :class:`VirtualNetworkGatewaysOperations` + * 2018-11-01: :class:`VirtualNetworkGatewaysOperations` + * 2018-12-01: :class:`VirtualNetworkGatewaysOperations` + * 2019-02-01: :class:`VirtualNetworkGatewaysOperations` + * 2019-04-01: :class:`VirtualNetworkGatewaysOperations` + """ + api_version = self._get_api_version('virtual_network_gateways') + if api_version == '2015-06-15': + from .v2015_06_15.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import VirtualNetworkGatewaysOperations 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 virtual_network_peerings(self): + """Instance depends on the API version: + + * 2016-09-01: :class:`VirtualNetworkPeeringsOperations` + * 2016-12-01: :class:`VirtualNetworkPeeringsOperations` + * 2017-03-01: :class:`VirtualNetworkPeeringsOperations` + * 2017-06-01: :class:`VirtualNetworkPeeringsOperations` + * 2017-08-01: :class:`VirtualNetworkPeeringsOperations` + * 2017-09-01: :class:`VirtualNetworkPeeringsOperations` + * 2017-10-01: :class:`VirtualNetworkPeeringsOperations` + * 2017-11-01: :class:`VirtualNetworkPeeringsOperations` + * 2018-01-01: :class:`VirtualNetworkPeeringsOperations` + * 2018-02-01: :class:`VirtualNetworkPeeringsOperations` + * 2018-04-01: :class:`VirtualNetworkPeeringsOperations` + * 2018-06-01: :class:`VirtualNetworkPeeringsOperations` + * 2018-07-01: :class:`VirtualNetworkPeeringsOperations` + * 2018-08-01: :class:`VirtualNetworkPeeringsOperations` + * 2018-10-01: :class:`VirtualNetworkPeeringsOperations` + * 2018-11-01: :class:`VirtualNetworkPeeringsOperations` + * 2018-12-01: :class:`VirtualNetworkPeeringsOperations` + * 2019-02-01: :class:`VirtualNetworkPeeringsOperations` + * 2019-04-01: :class:`VirtualNetworkPeeringsOperations` + """ + api_version = self._get_api_version('virtual_network_peerings') + if api_version == '2016-09-01': + from .v2016_09_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import VirtualNetworkPeeringsOperations 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 virtual_network_taps(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`VirtualNetworkTapsOperations` + * 2018-10-01: :class:`VirtualNetworkTapsOperations` + * 2018-11-01: :class:`VirtualNetworkTapsOperations` + * 2018-12-01: :class:`VirtualNetworkTapsOperations` + * 2019-02-01: :class:`VirtualNetworkTapsOperations` + * 2019-04-01: :class:`VirtualNetworkTapsOperations` + """ + api_version = self._get_api_version('virtual_network_taps') + if api_version == '2018-08-01': + from .v2018_08_01.operations import VirtualNetworkTapsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import VirtualNetworkTapsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import VirtualNetworkTapsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import VirtualNetworkTapsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import VirtualNetworkTapsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import VirtualNetworkTapsOperations 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 virtual_networks(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`VirtualNetworksOperations` + * 2016-09-01: :class:`VirtualNetworksOperations` + * 2016-12-01: :class:`VirtualNetworksOperations` + * 2017-03-01: :class:`VirtualNetworksOperations` + * 2017-06-01: :class:`VirtualNetworksOperations` + * 2017-08-01: :class:`VirtualNetworksOperations` + * 2017-09-01: :class:`VirtualNetworksOperations` + * 2017-10-01: :class:`VirtualNetworksOperations` + * 2017-11-01: :class:`VirtualNetworksOperations` + * 2018-01-01: :class:`VirtualNetworksOperations` + * 2018-02-01: :class:`VirtualNetworksOperations` + * 2018-04-01: :class:`VirtualNetworksOperations` + * 2018-06-01: :class:`VirtualNetworksOperations` + * 2018-07-01: :class:`VirtualNetworksOperations` + * 2018-08-01: :class:`VirtualNetworksOperations` + * 2018-10-01: :class:`VirtualNetworksOperations` + * 2018-11-01: :class:`VirtualNetworksOperations` + * 2018-12-01: :class:`VirtualNetworksOperations` + * 2019-02-01: :class:`VirtualNetworksOperations` + * 2019-04-01: :class:`VirtualNetworksOperations` + """ + api_version = self._get_api_version('virtual_networks') + if api_version == '2015-06-15': + from .v2015_06_15.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import VirtualNetworksOperations 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 virtual_wa_ns(self): + """Instance depends on the API version: + + * 2018-04-01: :class:`VirtualWANsOperations` + * 2018-06-01: :class:`VirtualWANsOperations` + * 2018-07-01: :class:`VirtualWANsOperations` + """ + api_version = self._get_api_version('virtual_wa_ns') + if api_version == '2018-04-01': + from .v2018_04_01.operations import VirtualWANsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import VirtualWANsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import VirtualWANsOperations 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 virtual_wans(self): + """Instance depends on the API version: + + * 2018-08-01: :class:`VirtualWansOperations` + * 2018-10-01: :class:`VirtualWansOperations` + * 2018-11-01: :class:`VirtualWansOperations` + * 2018-12-01: :class:`VirtualWansOperations` + * 2019-02-01: :class:`VirtualWansOperations` + * 2019-04-01: :class:`VirtualWansOperations` + """ + api_version = self._get_api_version('virtual_wans') + if api_version == '2018-08-01': + from .v2018_08_01.operations import VirtualWansOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import VirtualWansOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import VirtualWansOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import VirtualWansOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import VirtualWansOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import VirtualWansOperations 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 vpn_connections(self): + """Instance depends on the API version: + + * 2018-04-01: :class:`VpnConnectionsOperations` + * 2018-06-01: :class:`VpnConnectionsOperations` + * 2018-07-01: :class:`VpnConnectionsOperations` + * 2018-08-01: :class:`VpnConnectionsOperations` + * 2018-10-01: :class:`VpnConnectionsOperations` + * 2018-11-01: :class:`VpnConnectionsOperations` + * 2018-12-01: :class:`VpnConnectionsOperations` + * 2019-02-01: :class:`VpnConnectionsOperations` + * 2019-04-01: :class:`VpnConnectionsOperations` + """ + api_version = self._get_api_version('vpn_connections') + if api_version == '2018-04-01': + from .v2018_04_01.operations import VpnConnectionsOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import VpnConnectionsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import VpnConnectionsOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import VpnConnectionsOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import VpnConnectionsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import VpnConnectionsOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import VpnConnectionsOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import VpnConnectionsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import VpnConnectionsOperations 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 vpn_gateways(self): + """Instance depends on the API version: + + * 2018-04-01: :class:`VpnGatewaysOperations` + * 2018-06-01: :class:`VpnGatewaysOperations` + * 2018-07-01: :class:`VpnGatewaysOperations` + * 2018-08-01: :class:`VpnGatewaysOperations` + * 2018-10-01: :class:`VpnGatewaysOperations` + * 2018-11-01: :class:`VpnGatewaysOperations` + * 2018-12-01: :class:`VpnGatewaysOperations` + * 2019-02-01: :class:`VpnGatewaysOperations` + * 2019-04-01: :class:`VpnGatewaysOperations` + """ + api_version = self._get_api_version('vpn_gateways') + if api_version == '2018-04-01': + from .v2018_04_01.operations import VpnGatewaysOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import VpnGatewaysOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import VpnGatewaysOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import VpnGatewaysOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import VpnGatewaysOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import VpnGatewaysOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import VpnGatewaysOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import VpnGatewaysOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import VpnGatewaysOperations 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 vpn_sites(self): + """Instance depends on the API version: + + * 2018-04-01: :class:`VpnSitesOperations` + * 2018-06-01: :class:`VpnSitesOperations` + * 2018-07-01: :class:`VpnSitesOperations` + * 2018-08-01: :class:`VpnSitesOperations` + * 2018-10-01: :class:`VpnSitesOperations` + * 2018-11-01: :class:`VpnSitesOperations` + * 2018-12-01: :class:`VpnSitesOperations` + * 2019-02-01: :class:`VpnSitesOperations` + * 2019-04-01: :class:`VpnSitesOperations` + """ + api_version = self._get_api_version('vpn_sites') + if api_version == '2018-04-01': + from .v2018_04_01.operations import VpnSitesOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import VpnSitesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import VpnSitesOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import VpnSitesOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import VpnSitesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import VpnSitesOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import VpnSitesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import VpnSitesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import VpnSitesOperations 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 vpn_sites_configuration(self): + """Instance depends on the API version: + + * 2018-04-01: :class:`VpnSitesConfigurationOperations` + * 2018-06-01: :class:`VpnSitesConfigurationOperations` + * 2018-07-01: :class:`VpnSitesConfigurationOperations` + * 2018-08-01: :class:`VpnSitesConfigurationOperations` + * 2018-10-01: :class:`VpnSitesConfigurationOperations` + * 2018-11-01: :class:`VpnSitesConfigurationOperations` + * 2018-12-01: :class:`VpnSitesConfigurationOperations` + * 2019-02-01: :class:`VpnSitesConfigurationOperations` + * 2019-04-01: :class:`VpnSitesConfigurationOperations` + """ + api_version = self._get_api_version('vpn_sites_configuration') + if api_version == '2018-04-01': + from .v2018_04_01.operations import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import VpnSitesConfigurationOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import VpnSitesConfigurationOperations 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 web_application_firewall_policies(self): + """Instance depends on the API version: + + * 2018-12-01: :class:`WebApplicationFirewallPoliciesOperations` + * 2019-02-01: :class:`WebApplicationFirewallPoliciesOperations` + * 2019-04-01: :class:`WebApplicationFirewallPoliciesOperations` + """ + api_version = self._get_api_version('web_application_firewall_policies') + if api_version == '2018-12-01': + from .v2018_12_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import WebApplicationFirewallPoliciesOperations 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))) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/_operations_mixin.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/_operations_mixin.py new file mode 100644 index 000000000000..264c78dbcd0d --- /dev/null +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/_operations_mixin.py @@ -0,0 +1,130 @@ +# 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 import Serializer, Deserializer + + +class NetworkManagementClientOperationsMixin(object): + + + def check_dns_name_availability(self, location, domain_name_label, custom_headers=None, raw=False, **operation_config): + """Checks whether a domain name in the cloudapp.azure.com zone is + available for use. + + :param location: The location of the domain name. + :type location: str + :param domain_name_label: The domain name to be verified. It must + conform to the following regular expression: + ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + :type domain_name_label: 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: DnsNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.network.v2019_04_01.models.DnsNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + + """ + api_version = self._get_api_version('check_dns_name_availability') + if api_version == '2015-06-15': + from .v2015_06_15.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2016-09-01': + from .v2016_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-03-01': + from .v2017_03_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-08-01': + from .v2017_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-09-01': + from .v2017_09_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2017-11-01': + from .v2017_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-06-01': + from .v2018_06_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-08-01': + from .v2018_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + mixin_instance = OperationClass() + mixin_instance._client = self._client + mixin_instance.config = self.config + mixin_instance._serialize = Serializer(self._models_dict(api_version)) + mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) + return mixin_instance.check_dns_name_availability(location, domain_name_label, custom_headers, raw, **operation_config) + + def supported_security_providers(self, resource_group_name, virtual_wan_name, custom_headers=None, raw=False, **operation_config): + """Gives the supported security providers for the virtual wan. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param virtual_wan_name: The name of the VirtualWAN for which + supported security providers are needed. + :type virtual_wan_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: VirtualWanSecurityProviders or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.network.v2019_04_01.models.VirtualWanSecurityProviders or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + + """ + api_version = self._get_api_version('supported_security_providers') + if api_version == '2018-08-01': + from .v2018_08_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-10-01': + from .v2018_10_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2018-12-01': + from .v2018_12_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-02-01': + from .v2019_02_01.operations import NetworkManagementClientOperationsMixin as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import NetworkManagementClientOperationsMixin as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + mixin_instance = OperationClass() + mixin_instance._client = self._client + mixin_instance.config = self.config + mixin_instance._serialize = Serializer(self._models_dict(api_version)) + mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) + return mixin_instance.supported_security_providers(resource_group_name, virtual_wan_name, custom_headers, raw, **operation_config) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/models.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/models.py index 96c1d5c91c89..3d6772a11eb3 100644 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/models.py +++ b/sdk/network/azure-mgmt-network/azure/mgmt/network/models.py @@ -1,7 +1,26 @@ -# coding=utf-8 +# 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. # -------------------------------------------------------------------------- -from .v2019_04_01.models import * \ No newline at end of file +from .v2015_06_15.models import * +from .v2016_09_01.models import * +from .v2016_12_01.models import * +from .v2017_03_01.models import * +from .v2017_06_01.models import * +from .v2017_08_01.models import * +from .v2017_09_01.models import * +from .v2017_10_01.models import * +from .v2017_11_01.models import * +from .v2018_01_01.models import * +from .v2018_02_01.models import * +from .v2018_04_01.models import * +from .v2018_06_01.models import * +from .v2018_07_01.models import * +from .v2018_08_01.models import * +from .v2018_10_01.models import * +from .v2018_11_01.models import * +from .v2018_12_01.models import * +from .v2019_02_01.models import * +from .v2019_04_01.models import * diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/network_management_client.py deleted file mode 100644 index d171f3b3c28b..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/network_management_client.py +++ /dev/null @@ -1,3758 +0,0 @@ -# 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 azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin -from .version import VERSION - - -class NetworkManagementClientConfiguration(AzureConfiguration): - """Configuration for NetworkManagementClient - 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 subscription credentials which uniquely - identify the Microsoft Azure subscription. The subscription ID forms part - of the URI for every service call. - :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(NetworkManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('networkmanagementclient/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class NetworkManagementClient(MultiApiClientMixin, SDKClient): - """Network Client - - This ready contains multiple API versions, to help you deal with all Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, uses latest API version available on public Azure. - For production, you should stick a particular api-version and/or profile. - The profile sets a mapping between the operation group and an API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. - - :ivar config: Configuration for client. - :vartype config: NetworkManagementClientConfiguration - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. - :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 profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles - """ - - DEFAULT_API_VERSION = '2019-04-01' - _PROFILE_TAG = "azure.mgmt.network.NetworkManagementClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION - }}, - _PROFILE_TAG + " latest" - ) - - def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): - self.config = NetworkManagementClientConfiguration(credentials, subscription_id, base_url) - super(NetworkManagementClient, self).__init__( - credentials, - self.config, - api_version=api_version, - profile=profile - ) - - def check_dns_name_availability( - self, location, domain_name_label, custom_headers=None, raw=False, **operation_config): - """Checks whether a domain name in the cloudapp.azure.com zone is - available for use. - - :param location: The location of the domain name. - :type location: str - :param domain_name_label: The domain name to be verified. It must - conform to the following regular expression: - ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - :type domain_name_label: 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: :class:`DnsNameAvailabilityResult - ` or - :class:`ClientRawResponse` if - raw=true - :rtype: :class:`DnsNameAvailabilityResult - ` or - :class:`ClientRawResponse` - :raises: :class:`CloudError` - """ - api_version = self._get_api_version('check_dns_name_availability') - if api_version == '2019-04-01': - from .v2019_04_01 import NetworkManagementClient as ClientClass - elif api_version == '2019-02-01': - from .v2019_02_01 import NetworkManagementClient as ClientClass - elif api_version == '2018-12-01': - from .v2018_12_01 import NetworkManagementClient as ClientClass - elif api_version == '2018-11-01': - from .v2018_11_01 import NetworkManagementClient as ClientClass - elif api_version == '2018-10-01': - from .v2018_10_01 import NetworkManagementClient as ClientClass - elif api_version == '2018-08-01': - from .v2018_08_01 import NetworkManagementClient as ClientClass - elif api_version == '2018-07-01': - from .v2018_07_01 import NetworkManagementClient as ClientClass - elif api_version == '2018-06-01': - from .v2018_06_01 import NetworkManagementClient as ClientClass - elif api_version == '2018-04-01': - from .v2018_04_01 import NetworkManagementClient as ClientClass - elif api_version == '2018-02-01': - from .v2018_02_01 import NetworkManagementClient as ClientClass - elif api_version == '2018-01-01': - from .v2018_01_01 import NetworkManagementClient as ClientClass - elif api_version == '2017-11-01': - from .v2017_11_01 import NetworkManagementClient as ClientClass - elif api_version == '2017-10-01': - from .v2017_10_01 import NetworkManagementClient as ClientClass - elif api_version == '2017-09-01': - from .v2017_09_01 import NetworkManagementClient as ClientClass - elif api_version == '2017-08-01': - from .v2017_08_01 import NetworkManagementClient as ClientClass - elif api_version == '2017-06-01': - from .v2017_06_01 import NetworkManagementClient as ClientClass - elif api_version == '2017-03-01': - from .v2017_03_01 import NetworkManagementClient as ClientClass - elif api_version == '2016-12-01': - from .v2016_12_01 import NetworkManagementClient as ClientClass - elif api_version == '2016-09-01': - from .v2016_09_01 import NetworkManagementClient as ClientClass - elif api_version == '2015-06-15': - from .v2015_06_15 import NetworkManagementClient as ClientClass - localclient = ClientClass(self.config.credentials, - self.config.subscription_id, - self.config.base_url) - return localclient.check_dns_name_availability(location, - domain_name_label, - custom_headers, - raw, - **operation_config) - -############ 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: - - * 2015-06-15: :mod:`v2015_06_15.models` - * 2016-09-01: :mod:`v2016_09_01.models` - * 2016-12-01: :mod:`v2016_12_01.models` - * 2017-03-01: :mod:`v2017_03_01.models` - * 2017-06-01: :mod:`v2017_06_01.models` - * 2017-08-01: :mod:`v2017_08_01.models` - * 2017-09-01: :mod:`v2017_09_01.models` - * 2017-10-01: :mod:`v2017_10_01.models` - * 2017-11-01: :mod:`v2017_11_01.models` - * 2018-01-01: :mod:`v2018_01_01.models` - * 2018-02-01: :mod:`v2018_02_01.models` - * 2018-04-01: :mod:`v2018_04_01.models` - * 2018-06-01: :mod:`v2018_06_01.models` - * 2018-07-01: :mod:`v2018_07_01.models` - * 2018-08-01: :mod:`v2018_08_01.models` - * 2018-10-01: :mod:`v2018_10_01.models` - * 2018-11-01: :mod:`v2018_11_01.models` - * 2018-12-01: :mod:`v2018_12_01.models` - * 2019-02-01: :mod:`v2019_02_01.models` - * 2019-04-01: :mod:`v2019_04_01.models` - """ - if api_version == '2015-06-15': - from .v2015_06_15 import models - return models - elif api_version == '2016-09-01': - from .v2016_09_01 import models - return models - elif api_version == '2016-12-01': - from .v2016_12_01 import models - return models - elif api_version == '2017-03-01': - from .v2017_03_01 import models - return models - elif api_version == '2017-06-01': - from .v2017_06_01 import models - return models - elif api_version == '2017-08-01': - from .v2017_08_01 import models - return models - elif api_version == '2017-09-01': - from .v2017_09_01 import models - return models - elif api_version == '2017-10-01': - from .v2017_10_01 import models - return models - elif api_version == '2017-11-01': - from .v2017_11_01 import models - return models - elif api_version == '2018-01-01': - from .v2018_01_01 import models - return models - elif api_version == '2018-02-01': - from .v2018_02_01 import models - return models - elif api_version == '2018-04-01': - from .v2018_04_01 import models - return models - elif api_version == '2018-06-01': - from .v2018_06_01 import models - return models - elif api_version == '2018-07-01': - from .v2018_07_01 import models - return models - elif api_version == '2018-08-01': - from .v2018_08_01 import models - return models - elif api_version == '2018-10-01': - from .v2018_10_01 import models - return models - elif api_version == '2018-11-01': - from .v2018_11_01 import models - return models - elif api_version == '2018-12-01': - from .v2018_12_01 import models - return models - elif api_version == '2019-02-01': - from .v2019_02_01 import models - return models - elif api_version == '2019-04-01': - from .v2019_04_01 import models - return models - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - - @property - def application_gateways(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`ApplicationGatewaysOperations` - * 2016-09-01: :class:`ApplicationGatewaysOperations` - * 2016-12-01: :class:`ApplicationGatewaysOperations` - * 2017-03-01: :class:`ApplicationGatewaysOperations` - * 2017-06-01: :class:`ApplicationGatewaysOperations` - * 2017-08-01: :class:`ApplicationGatewaysOperations` - * 2017-09-01: :class:`ApplicationGatewaysOperations` - * 2017-10-01: :class:`ApplicationGatewaysOperations` - * 2017-11-01: :class:`ApplicationGatewaysOperations` - * 2018-01-01: :class:`ApplicationGatewaysOperations` - * 2018-02-01: :class:`ApplicationGatewaysOperations` - * 2018-04-01: :class:`ApplicationGatewaysOperations` - * 2018-06-01: :class:`ApplicationGatewaysOperations` - * 2018-07-01: :class:`ApplicationGatewaysOperations` - * 2018-08-01: :class:`ApplicationGatewaysOperations` - * 2018-10-01: :class:`ApplicationGatewaysOperations` - * 2018-11-01: :class:`ApplicationGatewaysOperations` - * 2018-12-01: :class:`ApplicationGatewaysOperations` - * 2019-02-01: :class:`ApplicationGatewaysOperations` - * 2019-04-01: :class:`ApplicationGatewaysOperations` - """ - api_version = self._get_api_version('application_gateways') - if api_version == '2015-06-15': - from .v2015_06_15.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ApplicationGatewaysOperations 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 application_security_groups(self): - """Instance depends on the API version: - - * 2017-09-01: :class:`ApplicationSecurityGroupsOperations` - * 2017-10-01: :class:`ApplicationSecurityGroupsOperations` - * 2017-11-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-01-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-02-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-04-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-06-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-07-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-08-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-10-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-11-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-12-01: :class:`ApplicationSecurityGroupsOperations` - * 2019-02-01: :class:`ApplicationSecurityGroupsOperations` - * 2019-04-01: :class:`ApplicationSecurityGroupsOperations` - """ - api_version = self._get_api_version('application_security_groups') - if api_version == '2017-09-01': - from .v2017_09_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ApplicationSecurityGroupsOperations 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 available_delegations(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`AvailableDelegationsOperations` - * 2018-10-01: :class:`AvailableDelegationsOperations` - * 2018-11-01: :class:`AvailableDelegationsOperations` - * 2018-12-01: :class:`AvailableDelegationsOperations` - * 2019-02-01: :class:`AvailableDelegationsOperations` - * 2019-04-01: :class:`AvailableDelegationsOperations` - """ - api_version = self._get_api_version('available_delegations') - if api_version == '2018-08-01': - from .v2018_08_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import AvailableDelegationsOperations 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 available_endpoint_services(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`AvailableEndpointServicesOperations` - * 2017-08-01: :class:`AvailableEndpointServicesOperations` - * 2017-09-01: :class:`AvailableEndpointServicesOperations` - * 2017-10-01: :class:`AvailableEndpointServicesOperations` - * 2017-11-01: :class:`AvailableEndpointServicesOperations` - * 2018-01-01: :class:`AvailableEndpointServicesOperations` - * 2018-02-01: :class:`AvailableEndpointServicesOperations` - * 2018-04-01: :class:`AvailableEndpointServicesOperations` - * 2018-06-01: :class:`AvailableEndpointServicesOperations` - * 2018-07-01: :class:`AvailableEndpointServicesOperations` - * 2018-08-01: :class:`AvailableEndpointServicesOperations` - * 2018-10-01: :class:`AvailableEndpointServicesOperations` - * 2018-11-01: :class:`AvailableEndpointServicesOperations` - * 2018-12-01: :class:`AvailableEndpointServicesOperations` - * 2019-02-01: :class:`AvailableEndpointServicesOperations` - * 2019-04-01: :class:`AvailableEndpointServicesOperations` - """ - api_version = self._get_api_version('available_endpoint_services') - if api_version == '2017-06-01': - from .v2017_06_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import AvailableEndpointServicesOperations 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 available_private_endpoint_types(self): - """Instance depends on the API version: - - * 2019-04-01: :class:`AvailablePrivateEndpointTypesOperations` - """ - api_version = self._get_api_version('available_private_endpoint_types') - if api_version == '2019-04-01': - from .v2019_04_01.operations import AvailablePrivateEndpointTypesOperations 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 available_resource_group_delegations(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2018-10-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2018-11-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2018-12-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2019-02-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2019-04-01: :class:`AvailableResourceGroupDelegationsOperations` - """ - api_version = self._get_api_version('available_resource_group_delegations') - if api_version == '2018-08-01': - from .v2018_08_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import AvailableResourceGroupDelegationsOperations 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 available_resource_group_private_endpoint_types(self): - """Instance depends on the API version: - - * 2019-04-01: :class:`AvailableResourceGroupPrivateEndpointTypesOperations` - """ - api_version = self._get_api_version('available_resource_group_private_endpoint_types') - if api_version == '2019-04-01': - from .v2019_04_01.operations import AvailableResourceGroupPrivateEndpointTypesOperations 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 azure_firewall_fqdn_tags(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`AzureFirewallFqdnTagsOperations` - * 2018-10-01: :class:`AzureFirewallFqdnTagsOperations` - * 2018-11-01: :class:`AzureFirewallFqdnTagsOperations` - * 2018-12-01: :class:`AzureFirewallFqdnTagsOperations` - * 2019-02-01: :class:`AzureFirewallFqdnTagsOperations` - * 2019-04-01: :class:`AzureFirewallFqdnTagsOperations` - """ - api_version = self._get_api_version('azure_firewall_fqdn_tags') - if api_version == '2018-08-01': - from .v2018_08_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import AzureFirewallFqdnTagsOperations 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 azure_firewalls(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`AzureFirewallsOperations` - * 2018-06-01: :class:`AzureFirewallsOperations` - * 2018-07-01: :class:`AzureFirewallsOperations` - * 2018-08-01: :class:`AzureFirewallsOperations` - * 2018-10-01: :class:`AzureFirewallsOperations` - * 2018-11-01: :class:`AzureFirewallsOperations` - * 2018-12-01: :class:`AzureFirewallsOperations` - * 2019-02-01: :class:`AzureFirewallsOperations` - * 2019-04-01: :class:`AzureFirewallsOperations` - """ - api_version = self._get_api_version('azure_firewalls') - if api_version == '2018-04-01': - from .v2018_04_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import AzureFirewallsOperations 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 bastion_hosts(self): - """Instance depends on the API version: - - * 2019-04-01: :class:`BastionHostsOperations` - """ - api_version = self._get_api_version('bastion_hosts') - if api_version == '2019-04-01': - from .v2019_04_01.operations import BastionHostsOperations 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 bgp_service_communities(self): - """Instance depends on the API version: - - * 2016-12-01: :class:`BgpServiceCommunitiesOperations` - * 2017-03-01: :class:`BgpServiceCommunitiesOperations` - * 2017-06-01: :class:`BgpServiceCommunitiesOperations` - * 2017-08-01: :class:`BgpServiceCommunitiesOperations` - * 2017-09-01: :class:`BgpServiceCommunitiesOperations` - * 2017-10-01: :class:`BgpServiceCommunitiesOperations` - * 2017-11-01: :class:`BgpServiceCommunitiesOperations` - * 2018-01-01: :class:`BgpServiceCommunitiesOperations` - * 2018-02-01: :class:`BgpServiceCommunitiesOperations` - * 2018-04-01: :class:`BgpServiceCommunitiesOperations` - * 2018-06-01: :class:`BgpServiceCommunitiesOperations` - * 2018-07-01: :class:`BgpServiceCommunitiesOperations` - * 2018-08-01: :class:`BgpServiceCommunitiesOperations` - * 2018-10-01: :class:`BgpServiceCommunitiesOperations` - * 2018-11-01: :class:`BgpServiceCommunitiesOperations` - * 2018-12-01: :class:`BgpServiceCommunitiesOperations` - * 2019-02-01: :class:`BgpServiceCommunitiesOperations` - * 2019-04-01: :class:`BgpServiceCommunitiesOperations` - """ - api_version = self._get_api_version('bgp_service_communities') - if api_version == '2016-12-01': - from .v2016_12_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import BgpServiceCommunitiesOperations 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 connection_monitors(self): - """Instance depends on the API version: - - * 2017-10-01: :class:`ConnectionMonitorsOperations` - * 2017-11-01: :class:`ConnectionMonitorsOperations` - * 2018-01-01: :class:`ConnectionMonitorsOperations` - * 2018-02-01: :class:`ConnectionMonitorsOperations` - * 2018-04-01: :class:`ConnectionMonitorsOperations` - * 2018-06-01: :class:`ConnectionMonitorsOperations` - * 2018-07-01: :class:`ConnectionMonitorsOperations` - * 2018-08-01: :class:`ConnectionMonitorsOperations` - * 2018-10-01: :class:`ConnectionMonitorsOperations` - * 2018-11-01: :class:`ConnectionMonitorsOperations` - * 2018-12-01: :class:`ConnectionMonitorsOperations` - * 2019-02-01: :class:`ConnectionMonitorsOperations` - * 2019-04-01: :class:`ConnectionMonitorsOperations` - """ - api_version = self._get_api_version('connection_monitors') - if api_version == '2017-10-01': - from .v2017_10_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ConnectionMonitorsOperations 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 ddos_custom_policies(self): - """Instance depends on the API version: - - * 2018-11-01: :class:`DdosCustomPoliciesOperations` - * 2018-12-01: :class:`DdosCustomPoliciesOperations` - * 2019-02-01: :class:`DdosCustomPoliciesOperations` - * 2019-04-01: :class:`DdosCustomPoliciesOperations` - """ - api_version = self._get_api_version('ddos_custom_policies') - if api_version == '2018-11-01': - from .v2018_11_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import DdosCustomPoliciesOperations 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 ddos_protection_plans(self): - """Instance depends on the API version: - - * 2018-02-01: :class:`DdosProtectionPlansOperations` - * 2018-04-01: :class:`DdosProtectionPlansOperations` - * 2018-06-01: :class:`DdosProtectionPlansOperations` - * 2018-07-01: :class:`DdosProtectionPlansOperations` - * 2018-08-01: :class:`DdosProtectionPlansOperations` - * 2018-10-01: :class:`DdosProtectionPlansOperations` - * 2018-11-01: :class:`DdosProtectionPlansOperations` - * 2018-12-01: :class:`DdosProtectionPlansOperations` - * 2019-02-01: :class:`DdosProtectionPlansOperations` - * 2019-04-01: :class:`DdosProtectionPlansOperations` - """ - api_version = self._get_api_version('ddos_protection_plans') - if api_version == '2018-02-01': - from .v2018_02_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import DdosProtectionPlansOperations 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 default_security_rules(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`DefaultSecurityRulesOperations` - * 2017-08-01: :class:`DefaultSecurityRulesOperations` - * 2017-09-01: :class:`DefaultSecurityRulesOperations` - * 2017-10-01: :class:`DefaultSecurityRulesOperations` - * 2017-11-01: :class:`DefaultSecurityRulesOperations` - * 2018-01-01: :class:`DefaultSecurityRulesOperations` - * 2018-02-01: :class:`DefaultSecurityRulesOperations` - * 2018-04-01: :class:`DefaultSecurityRulesOperations` - * 2018-06-01: :class:`DefaultSecurityRulesOperations` - * 2018-07-01: :class:`DefaultSecurityRulesOperations` - * 2018-08-01: :class:`DefaultSecurityRulesOperations` - * 2018-10-01: :class:`DefaultSecurityRulesOperations` - * 2018-11-01: :class:`DefaultSecurityRulesOperations` - * 2018-12-01: :class:`DefaultSecurityRulesOperations` - * 2019-02-01: :class:`DefaultSecurityRulesOperations` - * 2019-04-01: :class:`DefaultSecurityRulesOperations` - """ - api_version = self._get_api_version('default_security_rules') - if api_version == '2017-06-01': - from .v2017_06_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import DefaultSecurityRulesOperations 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 express_route_circuit_authorizations(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2016-09-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2016-12-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2017-03-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2017-06-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2017-08-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2017-09-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2017-10-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2017-11-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-01-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-02-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-04-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-06-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-07-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-08-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-10-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-11-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-12-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2019-02-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2019-04-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - """ - api_version = self._get_api_version('express_route_circuit_authorizations') - if api_version == '2015-06-15': - from .v2015_06_15.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteCircuitAuthorizationsOperations 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 express_route_circuit_connections(self): - """Instance depends on the API version: - - * 2018-02-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-04-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-06-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-07-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-08-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-10-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-11-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-12-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2019-02-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2019-04-01: :class:`ExpressRouteCircuitConnectionsOperations` - """ - api_version = self._get_api_version('express_route_circuit_connections') - if api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteCircuitConnectionsOperations 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 express_route_circuit_peerings(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`ExpressRouteCircuitPeeringsOperations` - * 2016-09-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2016-12-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2017-03-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2017-06-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2017-08-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2017-09-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2017-10-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2017-11-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-01-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-02-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-04-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-06-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-07-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-08-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-10-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-11-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-12-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2019-02-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2019-04-01: :class:`ExpressRouteCircuitPeeringsOperations` - """ - api_version = self._get_api_version('express_route_circuit_peerings') - if api_version == '2015-06-15': - from .v2015_06_15.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteCircuitPeeringsOperations 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 express_route_circuits(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`ExpressRouteCircuitsOperations` - * 2016-09-01: :class:`ExpressRouteCircuitsOperations` - * 2016-12-01: :class:`ExpressRouteCircuitsOperations` - * 2017-03-01: :class:`ExpressRouteCircuitsOperations` - * 2017-06-01: :class:`ExpressRouteCircuitsOperations` - * 2017-08-01: :class:`ExpressRouteCircuitsOperations` - * 2017-09-01: :class:`ExpressRouteCircuitsOperations` - * 2017-10-01: :class:`ExpressRouteCircuitsOperations` - * 2017-11-01: :class:`ExpressRouteCircuitsOperations` - * 2018-01-01: :class:`ExpressRouteCircuitsOperations` - * 2018-02-01: :class:`ExpressRouteCircuitsOperations` - * 2018-04-01: :class:`ExpressRouteCircuitsOperations` - * 2018-06-01: :class:`ExpressRouteCircuitsOperations` - * 2018-07-01: :class:`ExpressRouteCircuitsOperations` - * 2018-08-01: :class:`ExpressRouteCircuitsOperations` - * 2018-10-01: :class:`ExpressRouteCircuitsOperations` - * 2018-11-01: :class:`ExpressRouteCircuitsOperations` - * 2018-12-01: :class:`ExpressRouteCircuitsOperations` - * 2019-02-01: :class:`ExpressRouteCircuitsOperations` - * 2019-04-01: :class:`ExpressRouteCircuitsOperations` - """ - api_version = self._get_api_version('express_route_circuits') - if api_version == '2015-06-15': - from .v2015_06_15.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteCircuitsOperations 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 express_route_connections(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`ExpressRouteConnectionsOperations` - * 2018-10-01: :class:`ExpressRouteConnectionsOperations` - * 2018-11-01: :class:`ExpressRouteConnectionsOperations` - * 2018-12-01: :class:`ExpressRouteConnectionsOperations` - * 2019-02-01: :class:`ExpressRouteConnectionsOperations` - * 2019-04-01: :class:`ExpressRouteConnectionsOperations` - """ - api_version = self._get_api_version('express_route_connections') - if api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteConnectionsOperations 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 express_route_cross_connection_peerings(self): - """Instance depends on the API version: - - * 2018-02-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-04-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-06-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-07-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-08-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-10-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-11-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-12-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2019-02-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2019-04-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - """ - api_version = self._get_api_version('express_route_cross_connection_peerings') - if api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteCrossConnectionPeeringsOperations 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 express_route_cross_connections(self): - """Instance depends on the API version: - - * 2018-02-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-04-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-06-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-07-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-08-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-10-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-11-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-12-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2019-02-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2019-04-01: :class:`ExpressRouteCrossConnectionsOperations` - """ - api_version = self._get_api_version('express_route_cross_connections') - if api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteCrossConnectionsOperations 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 express_route_gateways(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`ExpressRouteGatewaysOperations` - * 2018-10-01: :class:`ExpressRouteGatewaysOperations` - * 2018-11-01: :class:`ExpressRouteGatewaysOperations` - * 2018-12-01: :class:`ExpressRouteGatewaysOperations` - * 2019-02-01: :class:`ExpressRouteGatewaysOperations` - * 2019-04-01: :class:`ExpressRouteGatewaysOperations` - """ - api_version = self._get_api_version('express_route_gateways') - if api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteGatewaysOperations 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 express_route_links(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`ExpressRouteLinksOperations` - * 2018-10-01: :class:`ExpressRouteLinksOperations` - * 2018-11-01: :class:`ExpressRouteLinksOperations` - * 2018-12-01: :class:`ExpressRouteLinksOperations` - * 2019-02-01: :class:`ExpressRouteLinksOperations` - * 2019-04-01: :class:`ExpressRouteLinksOperations` - """ - api_version = self._get_api_version('express_route_links') - if api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteLinksOperations 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 express_route_ports(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`ExpressRoutePortsOperations` - * 2018-10-01: :class:`ExpressRoutePortsOperations` - * 2018-11-01: :class:`ExpressRoutePortsOperations` - * 2018-12-01: :class:`ExpressRoutePortsOperations` - * 2019-02-01: :class:`ExpressRoutePortsOperations` - * 2019-04-01: :class:`ExpressRoutePortsOperations` - """ - api_version = self._get_api_version('express_route_ports') - if api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRoutePortsOperations 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 express_route_ports_locations(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`ExpressRoutePortsLocationsOperations` - * 2018-10-01: :class:`ExpressRoutePortsLocationsOperations` - * 2018-11-01: :class:`ExpressRoutePortsLocationsOperations` - * 2018-12-01: :class:`ExpressRoutePortsLocationsOperations` - * 2019-02-01: :class:`ExpressRoutePortsLocationsOperations` - * 2019-04-01: :class:`ExpressRoutePortsLocationsOperations` - """ - api_version = self._get_api_version('express_route_ports_locations') - if api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRoutePortsLocationsOperations 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 express_route_service_providers(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`ExpressRouteServiceProvidersOperations` - * 2016-09-01: :class:`ExpressRouteServiceProvidersOperations` - * 2016-12-01: :class:`ExpressRouteServiceProvidersOperations` - * 2017-03-01: :class:`ExpressRouteServiceProvidersOperations` - * 2017-06-01: :class:`ExpressRouteServiceProvidersOperations` - * 2017-08-01: :class:`ExpressRouteServiceProvidersOperations` - * 2017-09-01: :class:`ExpressRouteServiceProvidersOperations` - * 2017-10-01: :class:`ExpressRouteServiceProvidersOperations` - * 2017-11-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-01-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-02-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-04-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-06-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-07-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-08-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-10-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-11-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-12-01: :class:`ExpressRouteServiceProvidersOperations` - * 2019-02-01: :class:`ExpressRouteServiceProvidersOperations` - * 2019-04-01: :class:`ExpressRouteServiceProvidersOperations` - """ - api_version = self._get_api_version('express_route_service_providers') - if api_version == '2015-06-15': - from .v2015_06_15.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteServiceProvidersOperations 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 hub_virtual_network_connections(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2018-06-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2018-07-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2018-08-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2018-10-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2018-11-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2018-12-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2019-02-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2019-04-01: :class:`HubVirtualNetworkConnectionsOperations` - """ - api_version = self._get_api_version('hub_virtual_network_connections') - if api_version == '2018-04-01': - from .v2018_04_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import HubVirtualNetworkConnectionsOperations 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 inbound_nat_rules(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`InboundNatRulesOperations` - * 2017-08-01: :class:`InboundNatRulesOperations` - * 2017-09-01: :class:`InboundNatRulesOperations` - * 2017-10-01: :class:`InboundNatRulesOperations` - * 2017-11-01: :class:`InboundNatRulesOperations` - * 2018-01-01: :class:`InboundNatRulesOperations` - * 2018-02-01: :class:`InboundNatRulesOperations` - * 2018-04-01: :class:`InboundNatRulesOperations` - * 2018-06-01: :class:`InboundNatRulesOperations` - * 2018-07-01: :class:`InboundNatRulesOperations` - * 2018-08-01: :class:`InboundNatRulesOperations` - * 2018-10-01: :class:`InboundNatRulesOperations` - * 2018-11-01: :class:`InboundNatRulesOperations` - * 2018-12-01: :class:`InboundNatRulesOperations` - * 2019-02-01: :class:`InboundNatRulesOperations` - * 2019-04-01: :class:`InboundNatRulesOperations` - """ - api_version = self._get_api_version('inbound_nat_rules') - if api_version == '2017-06-01': - from .v2017_06_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import InboundNatRulesOperations 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 interface_endpoints(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`InterfaceEndpointsOperations` - * 2018-10-01: :class:`InterfaceEndpointsOperations` - * 2018-11-01: :class:`InterfaceEndpointsOperations` - * 2018-12-01: :class:`InterfaceEndpointsOperations` - * 2019-02-01: :class:`InterfaceEndpointsOperations` - """ - api_version = self._get_api_version('interface_endpoints') - if api_version == '2018-08-01': - from .v2018_08_01.operations import InterfaceEndpointsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import InterfaceEndpointsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import InterfaceEndpointsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import InterfaceEndpointsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import InterfaceEndpointsOperations 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 load_balancer_backend_address_pools(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2017-08-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2017-09-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2017-10-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2017-11-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-01-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-02-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-04-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-06-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-07-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-08-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-10-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-11-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-12-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2019-02-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2019-04-01: :class:`LoadBalancerBackendAddressPoolsOperations` - """ - api_version = self._get_api_version('load_balancer_backend_address_pools') - if api_version == '2017-06-01': - from .v2017_06_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancerBackendAddressPoolsOperations 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 load_balancer_frontend_ip_configurations(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2017-08-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2017-09-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2017-10-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2017-11-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-01-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-02-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-04-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-06-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-07-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-08-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-10-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-11-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-12-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2019-02-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2019-04-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - """ - api_version = self._get_api_version('load_balancer_frontend_ip_configurations') - if api_version == '2017-06-01': - from .v2017_06_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancerFrontendIPConfigurationsOperations 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 load_balancer_load_balancing_rules(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2017-08-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2017-09-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2017-10-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2017-11-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-01-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-02-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-04-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-06-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-07-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-08-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-10-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-11-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-12-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2019-02-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2019-04-01: :class:`LoadBalancerLoadBalancingRulesOperations` - """ - api_version = self._get_api_version('load_balancer_load_balancing_rules') - if api_version == '2017-06-01': - from .v2017_06_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancerLoadBalancingRulesOperations 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 load_balancer_network_interfaces(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2017-08-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2017-09-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2017-10-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2017-11-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-01-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-02-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-04-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-06-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-07-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-08-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-10-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-11-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-12-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2019-02-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2019-04-01: :class:`LoadBalancerNetworkInterfacesOperations` - """ - api_version = self._get_api_version('load_balancer_network_interfaces') - if api_version == '2017-06-01': - from .v2017_06_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancerNetworkInterfacesOperations 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 load_balancer_outbound_rules(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`LoadBalancerOutboundRulesOperations` - * 2018-10-01: :class:`LoadBalancerOutboundRulesOperations` - * 2018-11-01: :class:`LoadBalancerOutboundRulesOperations` - * 2018-12-01: :class:`LoadBalancerOutboundRulesOperations` - * 2019-02-01: :class:`LoadBalancerOutboundRulesOperations` - * 2019-04-01: :class:`LoadBalancerOutboundRulesOperations` - """ - api_version = self._get_api_version('load_balancer_outbound_rules') - if api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancerOutboundRulesOperations 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 load_balancer_probes(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`LoadBalancerProbesOperations` - * 2017-08-01: :class:`LoadBalancerProbesOperations` - * 2017-09-01: :class:`LoadBalancerProbesOperations` - * 2017-10-01: :class:`LoadBalancerProbesOperations` - * 2017-11-01: :class:`LoadBalancerProbesOperations` - * 2018-01-01: :class:`LoadBalancerProbesOperations` - * 2018-02-01: :class:`LoadBalancerProbesOperations` - * 2018-04-01: :class:`LoadBalancerProbesOperations` - * 2018-06-01: :class:`LoadBalancerProbesOperations` - * 2018-07-01: :class:`LoadBalancerProbesOperations` - * 2018-08-01: :class:`LoadBalancerProbesOperations` - * 2018-10-01: :class:`LoadBalancerProbesOperations` - * 2018-11-01: :class:`LoadBalancerProbesOperations` - * 2018-12-01: :class:`LoadBalancerProbesOperations` - * 2019-02-01: :class:`LoadBalancerProbesOperations` - * 2019-04-01: :class:`LoadBalancerProbesOperations` - """ - api_version = self._get_api_version('load_balancer_probes') - if api_version == '2017-06-01': - from .v2017_06_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancerProbesOperations 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 load_balancers(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`LoadBalancersOperations` - * 2016-09-01: :class:`LoadBalancersOperations` - * 2016-12-01: :class:`LoadBalancersOperations` - * 2017-03-01: :class:`LoadBalancersOperations` - * 2017-06-01: :class:`LoadBalancersOperations` - * 2017-08-01: :class:`LoadBalancersOperations` - * 2017-09-01: :class:`LoadBalancersOperations` - * 2017-10-01: :class:`LoadBalancersOperations` - * 2017-11-01: :class:`LoadBalancersOperations` - * 2018-01-01: :class:`LoadBalancersOperations` - * 2018-02-01: :class:`LoadBalancersOperations` - * 2018-04-01: :class:`LoadBalancersOperations` - * 2018-06-01: :class:`LoadBalancersOperations` - * 2018-07-01: :class:`LoadBalancersOperations` - * 2018-08-01: :class:`LoadBalancersOperations` - * 2018-10-01: :class:`LoadBalancersOperations` - * 2018-11-01: :class:`LoadBalancersOperations` - * 2018-12-01: :class:`LoadBalancersOperations` - * 2019-02-01: :class:`LoadBalancersOperations` - * 2019-04-01: :class:`LoadBalancersOperations` - """ - api_version = self._get_api_version('load_balancers') - if api_version == '2015-06-15': - from .v2015_06_15.operations import LoadBalancersOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancersOperations 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 local_network_gateways(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`LocalNetworkGatewaysOperations` - * 2016-09-01: :class:`LocalNetworkGatewaysOperations` - * 2016-12-01: :class:`LocalNetworkGatewaysOperations` - * 2017-03-01: :class:`LocalNetworkGatewaysOperations` - * 2017-06-01: :class:`LocalNetworkGatewaysOperations` - * 2017-08-01: :class:`LocalNetworkGatewaysOperations` - * 2017-09-01: :class:`LocalNetworkGatewaysOperations` - * 2017-10-01: :class:`LocalNetworkGatewaysOperations` - * 2017-11-01: :class:`LocalNetworkGatewaysOperations` - * 2018-01-01: :class:`LocalNetworkGatewaysOperations` - * 2018-02-01: :class:`LocalNetworkGatewaysOperations` - * 2018-04-01: :class:`LocalNetworkGatewaysOperations` - * 2018-06-01: :class:`LocalNetworkGatewaysOperations` - * 2018-07-01: :class:`LocalNetworkGatewaysOperations` - * 2018-08-01: :class:`LocalNetworkGatewaysOperations` - * 2018-10-01: :class:`LocalNetworkGatewaysOperations` - * 2018-11-01: :class:`LocalNetworkGatewaysOperations` - * 2018-12-01: :class:`LocalNetworkGatewaysOperations` - * 2019-02-01: :class:`LocalNetworkGatewaysOperations` - * 2019-04-01: :class:`LocalNetworkGatewaysOperations` - """ - api_version = self._get_api_version('local_network_gateways') - if api_version == '2015-06-15': - from .v2015_06_15.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LocalNetworkGatewaysOperations 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 nat_gateways(self): - """Instance depends on the API version: - - * 2019-02-01: :class:`NatGatewaysOperations` - * 2019-04-01: :class:`NatGatewaysOperations` - """ - api_version = self._get_api_version('nat_gateways') - if api_version == '2019-02-01': - from .v2019_02_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NatGatewaysOperations 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 network_interface_ip_configurations(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2017-08-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2017-09-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2017-10-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2017-11-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-01-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-02-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-04-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-06-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-07-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-08-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-10-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-11-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-12-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2019-02-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2019-04-01: :class:`NetworkInterfaceIPConfigurationsOperations` - """ - api_version = self._get_api_version('network_interface_ip_configurations') - if api_version == '2017-06-01': - from .v2017_06_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkInterfaceIPConfigurationsOperations 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 network_interface_load_balancers(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2017-08-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2017-09-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2017-10-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2017-11-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-01-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-02-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-04-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-06-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-07-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-08-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-10-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-11-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-12-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2019-02-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2019-04-01: :class:`NetworkInterfaceLoadBalancersOperations` - """ - api_version = self._get_api_version('network_interface_load_balancers') - if api_version == '2017-06-01': - from .v2017_06_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkInterfaceLoadBalancersOperations 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 network_interface_tap_configurations(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2018-10-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2018-11-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2018-12-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2019-02-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2019-04-01: :class:`NetworkInterfaceTapConfigurationsOperations` - """ - api_version = self._get_api_version('network_interface_tap_configurations') - if api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkInterfaceTapConfigurationsOperations 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 network_interfaces(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`NetworkInterfacesOperations` - * 2016-09-01: :class:`NetworkInterfacesOperations` - * 2016-12-01: :class:`NetworkInterfacesOperations` - * 2017-03-01: :class:`NetworkInterfacesOperations` - * 2017-06-01: :class:`NetworkInterfacesOperations` - * 2017-08-01: :class:`NetworkInterfacesOperations` - * 2017-09-01: :class:`NetworkInterfacesOperations` - * 2017-10-01: :class:`NetworkInterfacesOperations` - * 2017-11-01: :class:`NetworkInterfacesOperations` - * 2018-01-01: :class:`NetworkInterfacesOperations` - * 2018-02-01: :class:`NetworkInterfacesOperations` - * 2018-04-01: :class:`NetworkInterfacesOperations` - * 2018-06-01: :class:`NetworkInterfacesOperations` - * 2018-07-01: :class:`NetworkInterfacesOperations` - * 2018-08-01: :class:`NetworkInterfacesOperations` - * 2018-10-01: :class:`NetworkInterfacesOperations` - * 2018-11-01: :class:`NetworkInterfacesOperations` - * 2018-12-01: :class:`NetworkInterfacesOperations` - * 2019-02-01: :class:`NetworkInterfacesOperations` - * 2019-04-01: :class:`NetworkInterfacesOperations` - """ - api_version = self._get_api_version('network_interfaces') - if api_version == '2015-06-15': - from .v2015_06_15.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkInterfacesOperations 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 network_profiles(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`NetworkProfilesOperations` - * 2018-10-01: :class:`NetworkProfilesOperations` - * 2018-11-01: :class:`NetworkProfilesOperations` - * 2018-12-01: :class:`NetworkProfilesOperations` - * 2019-02-01: :class:`NetworkProfilesOperations` - * 2019-04-01: :class:`NetworkProfilesOperations` - """ - api_version = self._get_api_version('network_profiles') - if api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkProfilesOperations 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 network_security_groups(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`NetworkSecurityGroupsOperations` - * 2016-09-01: :class:`NetworkSecurityGroupsOperations` - * 2016-12-01: :class:`NetworkSecurityGroupsOperations` - * 2017-03-01: :class:`NetworkSecurityGroupsOperations` - * 2017-06-01: :class:`NetworkSecurityGroupsOperations` - * 2017-08-01: :class:`NetworkSecurityGroupsOperations` - * 2017-09-01: :class:`NetworkSecurityGroupsOperations` - * 2017-10-01: :class:`NetworkSecurityGroupsOperations` - * 2017-11-01: :class:`NetworkSecurityGroupsOperations` - * 2018-01-01: :class:`NetworkSecurityGroupsOperations` - * 2018-02-01: :class:`NetworkSecurityGroupsOperations` - * 2018-04-01: :class:`NetworkSecurityGroupsOperations` - * 2018-06-01: :class:`NetworkSecurityGroupsOperations` - * 2018-07-01: :class:`NetworkSecurityGroupsOperations` - * 2018-08-01: :class:`NetworkSecurityGroupsOperations` - * 2018-10-01: :class:`NetworkSecurityGroupsOperations` - * 2018-11-01: :class:`NetworkSecurityGroupsOperations` - * 2018-12-01: :class:`NetworkSecurityGroupsOperations` - * 2019-02-01: :class:`NetworkSecurityGroupsOperations` - * 2019-04-01: :class:`NetworkSecurityGroupsOperations` - """ - api_version = self._get_api_version('network_security_groups') - if api_version == '2015-06-15': - from .v2015_06_15.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkSecurityGroupsOperations 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 network_watchers(self): - """Instance depends on the API version: - - * 2016-09-01: :class:`NetworkWatchersOperations` - * 2016-12-01: :class:`NetworkWatchersOperations` - * 2017-03-01: :class:`NetworkWatchersOperations` - * 2017-06-01: :class:`NetworkWatchersOperations` - * 2017-08-01: :class:`NetworkWatchersOperations` - * 2017-09-01: :class:`NetworkWatchersOperations` - * 2017-10-01: :class:`NetworkWatchersOperations` - * 2017-11-01: :class:`NetworkWatchersOperations` - * 2018-01-01: :class:`NetworkWatchersOperations` - * 2018-02-01: :class:`NetworkWatchersOperations` - * 2018-04-01: :class:`NetworkWatchersOperations` - * 2018-06-01: :class:`NetworkWatchersOperations` - * 2018-07-01: :class:`NetworkWatchersOperations` - * 2018-08-01: :class:`NetworkWatchersOperations` - * 2018-10-01: :class:`NetworkWatchersOperations` - * 2018-11-01: :class:`NetworkWatchersOperations` - * 2018-12-01: :class:`NetworkWatchersOperations` - * 2019-02-01: :class:`NetworkWatchersOperations` - * 2019-04-01: :class:`NetworkWatchersOperations` - """ - api_version = self._get_api_version('network_watchers') - if api_version == '2016-09-01': - from .v2016_09_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkWatchersOperations 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): - """Instance depends on the API version: - - * 2017-09-01: :class:`Operations` - * 2017-10-01: :class:`Operations` - * 2017-11-01: :class:`Operations` - * 2018-01-01: :class:`Operations` - * 2018-02-01: :class:`Operations` - * 2018-04-01: :class:`Operations` - * 2018-06-01: :class:`Operations` - * 2018-07-01: :class:`Operations` - * 2018-08-01: :class:`Operations` - * 2018-10-01: :class:`Operations` - * 2018-11-01: :class:`Operations` - * 2018-12-01: :class:`Operations` - * 2019-02-01: :class:`Operations` - * 2019-04-01: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2017-09-01': - from .v2017_09_01.operations import Operations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import Operations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import Operations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import Operations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import Operations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import Operations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import Operations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import Operations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import Operations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import Operations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import Operations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import Operations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import Operations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import Operations 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 packet_captures(self): - """Instance depends on the API version: - - * 2016-09-01: :class:`PacketCapturesOperations` - * 2016-12-01: :class:`PacketCapturesOperations` - * 2017-03-01: :class:`PacketCapturesOperations` - * 2017-06-01: :class:`PacketCapturesOperations` - * 2017-08-01: :class:`PacketCapturesOperations` - * 2017-09-01: :class:`PacketCapturesOperations` - * 2017-10-01: :class:`PacketCapturesOperations` - * 2017-11-01: :class:`PacketCapturesOperations` - * 2018-01-01: :class:`PacketCapturesOperations` - * 2018-02-01: :class:`PacketCapturesOperations` - * 2018-04-01: :class:`PacketCapturesOperations` - * 2018-06-01: :class:`PacketCapturesOperations` - * 2018-07-01: :class:`PacketCapturesOperations` - * 2018-08-01: :class:`PacketCapturesOperations` - * 2018-10-01: :class:`PacketCapturesOperations` - * 2018-11-01: :class:`PacketCapturesOperations` - * 2018-12-01: :class:`PacketCapturesOperations` - * 2019-02-01: :class:`PacketCapturesOperations` - * 2019-04-01: :class:`PacketCapturesOperations` - """ - api_version = self._get_api_version('packet_captures') - if api_version == '2016-09-01': - from .v2016_09_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import PacketCapturesOperations 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 peer_express_route_circuit_connections(self): - """Instance depends on the API version: - - * 2018-12-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2019-02-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2019-04-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - """ - api_version = self._get_api_version('peer_express_route_circuit_connections') - if api_version == '2018-12-01': - from .v2018_12_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import PeerExpressRouteCircuitConnectionsOperations 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 private_endpoints(self): - """Instance depends on the API version: - - * 2019-04-01: :class:`PrivateEndpointsOperations` - """ - api_version = self._get_api_version('private_endpoints') - if api_version == '2019-04-01': - from .v2019_04_01.operations import PrivateEndpointsOperations 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 private_link_services(self): - """Instance depends on the API version: - - * 2019-04-01: :class:`PrivateLinkServicesOperations` - """ - api_version = self._get_api_version('private_link_services') - if api_version == '2019-04-01': - from .v2019_04_01.operations import PrivateLinkServicesOperations 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 public_ip_addresses(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`PublicIPAddressesOperations` - * 2016-09-01: :class:`PublicIPAddressesOperations` - * 2016-12-01: :class:`PublicIPAddressesOperations` - * 2017-03-01: :class:`PublicIPAddressesOperations` - * 2017-06-01: :class:`PublicIPAddressesOperations` - * 2017-08-01: :class:`PublicIPAddressesOperations` - * 2017-09-01: :class:`PublicIPAddressesOperations` - * 2017-10-01: :class:`PublicIPAddressesOperations` - * 2017-11-01: :class:`PublicIPAddressesOperations` - * 2018-01-01: :class:`PublicIPAddressesOperations` - * 2018-02-01: :class:`PublicIPAddressesOperations` - * 2018-04-01: :class:`PublicIPAddressesOperations` - * 2018-06-01: :class:`PublicIPAddressesOperations` - * 2018-07-01: :class:`PublicIPAddressesOperations` - * 2018-08-01: :class:`PublicIPAddressesOperations` - * 2018-10-01: :class:`PublicIPAddressesOperations` - * 2018-11-01: :class:`PublicIPAddressesOperations` - * 2018-12-01: :class:`PublicIPAddressesOperations` - * 2019-02-01: :class:`PublicIPAddressesOperations` - * 2019-04-01: :class:`PublicIPAddressesOperations` - """ - api_version = self._get_api_version('public_ip_addresses') - if api_version == '2015-06-15': - from .v2015_06_15.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import PublicIPAddressesOperations 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 public_ip_prefixes(self): - """Instance depends on the API version: - - * 2018-07-01: :class:`PublicIPPrefixesOperations` - * 2018-08-01: :class:`PublicIPPrefixesOperations` - * 2018-10-01: :class:`PublicIPPrefixesOperations` - * 2018-11-01: :class:`PublicIPPrefixesOperations` - * 2018-12-01: :class:`PublicIPPrefixesOperations` - * 2019-02-01: :class:`PublicIPPrefixesOperations` - * 2019-04-01: :class:`PublicIPPrefixesOperations` - """ - api_version = self._get_api_version('public_ip_prefixes') - if api_version == '2018-07-01': - from .v2018_07_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import PublicIPPrefixesOperations 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 resource_navigation_links(self): - """Instance depends on the API version: - - * 2019-02-01: :class:`ResourceNavigationLinksOperations` - * 2019-04-01: :class:`ResourceNavigationLinksOperations` - """ - api_version = self._get_api_version('resource_navigation_links') - if api_version == '2019-02-01': - from .v2019_02_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ResourceNavigationLinksOperations 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 route_filter_rules(self): - """Instance depends on the API version: - - * 2016-12-01: :class:`RouteFilterRulesOperations` - * 2017-03-01: :class:`RouteFilterRulesOperations` - * 2017-06-01: :class:`RouteFilterRulesOperations` - * 2017-08-01: :class:`RouteFilterRulesOperations` - * 2017-09-01: :class:`RouteFilterRulesOperations` - * 2017-10-01: :class:`RouteFilterRulesOperations` - * 2017-11-01: :class:`RouteFilterRulesOperations` - * 2018-01-01: :class:`RouteFilterRulesOperations` - * 2018-02-01: :class:`RouteFilterRulesOperations` - * 2018-04-01: :class:`RouteFilterRulesOperations` - * 2018-06-01: :class:`RouteFilterRulesOperations` - * 2018-07-01: :class:`RouteFilterRulesOperations` - * 2018-08-01: :class:`RouteFilterRulesOperations` - * 2018-10-01: :class:`RouteFilterRulesOperations` - * 2018-11-01: :class:`RouteFilterRulesOperations` - * 2018-12-01: :class:`RouteFilterRulesOperations` - * 2019-02-01: :class:`RouteFilterRulesOperations` - * 2019-04-01: :class:`RouteFilterRulesOperations` - """ - api_version = self._get_api_version('route_filter_rules') - if api_version == '2016-12-01': - from .v2016_12_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import RouteFilterRulesOperations 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 route_filters(self): - """Instance depends on the API version: - - * 2016-12-01: :class:`RouteFiltersOperations` - * 2017-03-01: :class:`RouteFiltersOperations` - * 2017-06-01: :class:`RouteFiltersOperations` - * 2017-08-01: :class:`RouteFiltersOperations` - * 2017-09-01: :class:`RouteFiltersOperations` - * 2017-10-01: :class:`RouteFiltersOperations` - * 2017-11-01: :class:`RouteFiltersOperations` - * 2018-01-01: :class:`RouteFiltersOperations` - * 2018-02-01: :class:`RouteFiltersOperations` - * 2018-04-01: :class:`RouteFiltersOperations` - * 2018-06-01: :class:`RouteFiltersOperations` - * 2018-07-01: :class:`RouteFiltersOperations` - * 2018-08-01: :class:`RouteFiltersOperations` - * 2018-10-01: :class:`RouteFiltersOperations` - * 2018-11-01: :class:`RouteFiltersOperations` - * 2018-12-01: :class:`RouteFiltersOperations` - * 2019-02-01: :class:`RouteFiltersOperations` - * 2019-04-01: :class:`RouteFiltersOperations` - """ - api_version = self._get_api_version('route_filters') - if api_version == '2016-12-01': - from .v2016_12_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import RouteFiltersOperations 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 route_tables(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`RouteTablesOperations` - * 2016-09-01: :class:`RouteTablesOperations` - * 2016-12-01: :class:`RouteTablesOperations` - * 2017-03-01: :class:`RouteTablesOperations` - * 2017-06-01: :class:`RouteTablesOperations` - * 2017-08-01: :class:`RouteTablesOperations` - * 2017-09-01: :class:`RouteTablesOperations` - * 2017-10-01: :class:`RouteTablesOperations` - * 2017-11-01: :class:`RouteTablesOperations` - * 2018-01-01: :class:`RouteTablesOperations` - * 2018-02-01: :class:`RouteTablesOperations` - * 2018-04-01: :class:`RouteTablesOperations` - * 2018-06-01: :class:`RouteTablesOperations` - * 2018-07-01: :class:`RouteTablesOperations` - * 2018-08-01: :class:`RouteTablesOperations` - * 2018-10-01: :class:`RouteTablesOperations` - * 2018-11-01: :class:`RouteTablesOperations` - * 2018-12-01: :class:`RouteTablesOperations` - * 2019-02-01: :class:`RouteTablesOperations` - * 2019-04-01: :class:`RouteTablesOperations` - """ - api_version = self._get_api_version('route_tables') - if api_version == '2015-06-15': - from .v2015_06_15.operations import RouteTablesOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import RouteTablesOperations 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 routes(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`RoutesOperations` - * 2016-09-01: :class:`RoutesOperations` - * 2016-12-01: :class:`RoutesOperations` - * 2017-03-01: :class:`RoutesOperations` - * 2017-06-01: :class:`RoutesOperations` - * 2017-08-01: :class:`RoutesOperations` - * 2017-09-01: :class:`RoutesOperations` - * 2017-10-01: :class:`RoutesOperations` - * 2017-11-01: :class:`RoutesOperations` - * 2018-01-01: :class:`RoutesOperations` - * 2018-02-01: :class:`RoutesOperations` - * 2018-04-01: :class:`RoutesOperations` - * 2018-06-01: :class:`RoutesOperations` - * 2018-07-01: :class:`RoutesOperations` - * 2018-08-01: :class:`RoutesOperations` - * 2018-10-01: :class:`RoutesOperations` - * 2018-11-01: :class:`RoutesOperations` - * 2018-12-01: :class:`RoutesOperations` - * 2019-02-01: :class:`RoutesOperations` - * 2019-04-01: :class:`RoutesOperations` - """ - api_version = self._get_api_version('routes') - if api_version == '2015-06-15': - from .v2015_06_15.operations import RoutesOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import RoutesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import RoutesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import RoutesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import RoutesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import RoutesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import RoutesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import RoutesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import RoutesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import RoutesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import RoutesOperations 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 security_rules(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`SecurityRulesOperations` - * 2016-09-01: :class:`SecurityRulesOperations` - * 2016-12-01: :class:`SecurityRulesOperations` - * 2017-03-01: :class:`SecurityRulesOperations` - * 2017-06-01: :class:`SecurityRulesOperations` - * 2017-08-01: :class:`SecurityRulesOperations` - * 2017-09-01: :class:`SecurityRulesOperations` - * 2017-10-01: :class:`SecurityRulesOperations` - * 2017-11-01: :class:`SecurityRulesOperations` - * 2018-01-01: :class:`SecurityRulesOperations` - * 2018-02-01: :class:`SecurityRulesOperations` - * 2018-04-01: :class:`SecurityRulesOperations` - * 2018-06-01: :class:`SecurityRulesOperations` - * 2018-07-01: :class:`SecurityRulesOperations` - * 2018-08-01: :class:`SecurityRulesOperations` - * 2018-10-01: :class:`SecurityRulesOperations` - * 2018-11-01: :class:`SecurityRulesOperations` - * 2018-12-01: :class:`SecurityRulesOperations` - * 2019-02-01: :class:`SecurityRulesOperations` - * 2019-04-01: :class:`SecurityRulesOperations` - """ - api_version = self._get_api_version('security_rules') - if api_version == '2015-06-15': - from .v2015_06_15.operations import SecurityRulesOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import SecurityRulesOperations 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 service_association_links(self): - """Instance depends on the API version: - - * 2019-02-01: :class:`ServiceAssociationLinksOperations` - * 2019-04-01: :class:`ServiceAssociationLinksOperations` - """ - api_version = self._get_api_version('service_association_links') - if api_version == '2019-02-01': - from .v2019_02_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ServiceAssociationLinksOperations 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 service_endpoint_policies(self): - """Instance depends on the API version: - - * 2018-07-01: :class:`ServiceEndpointPoliciesOperations` - * 2018-08-01: :class:`ServiceEndpointPoliciesOperations` - * 2018-10-01: :class:`ServiceEndpointPoliciesOperations` - * 2018-11-01: :class:`ServiceEndpointPoliciesOperations` - * 2018-12-01: :class:`ServiceEndpointPoliciesOperations` - * 2019-02-01: :class:`ServiceEndpointPoliciesOperations` - * 2019-04-01: :class:`ServiceEndpointPoliciesOperations` - """ - api_version = self._get_api_version('service_endpoint_policies') - if api_version == '2018-07-01': - from .v2018_07_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ServiceEndpointPoliciesOperations 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 service_endpoint_policy_definitions(self): - """Instance depends on the API version: - - * 2018-07-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2018-08-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2018-10-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2018-11-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2018-12-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2019-02-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2019-04-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - """ - api_version = self._get_api_version('service_endpoint_policy_definitions') - if api_version == '2018-07-01': - from .v2018_07_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ServiceEndpointPolicyDefinitionsOperations 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 service_tags(self): - """Instance depends on the API version: - - * 2019-04-01: :class:`ServiceTagsOperations` - """ - api_version = self._get_api_version('service_tags') - if api_version == '2019-04-01': - from .v2019_04_01.operations import ServiceTagsOperations 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 subnets(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`SubnetsOperations` - * 2016-09-01: :class:`SubnetsOperations` - * 2016-12-01: :class:`SubnetsOperations` - * 2017-03-01: :class:`SubnetsOperations` - * 2017-06-01: :class:`SubnetsOperations` - * 2017-08-01: :class:`SubnetsOperations` - * 2017-09-01: :class:`SubnetsOperations` - * 2017-10-01: :class:`SubnetsOperations` - * 2017-11-01: :class:`SubnetsOperations` - * 2018-01-01: :class:`SubnetsOperations` - * 2018-02-01: :class:`SubnetsOperations` - * 2018-04-01: :class:`SubnetsOperations` - * 2018-06-01: :class:`SubnetsOperations` - * 2018-07-01: :class:`SubnetsOperations` - * 2018-08-01: :class:`SubnetsOperations` - * 2018-10-01: :class:`SubnetsOperations` - * 2018-11-01: :class:`SubnetsOperations` - * 2018-12-01: :class:`SubnetsOperations` - * 2019-02-01: :class:`SubnetsOperations` - * 2019-04-01: :class:`SubnetsOperations` - """ - api_version = self._get_api_version('subnets') - if api_version == '2015-06-15': - from .v2015_06_15.operations import SubnetsOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import SubnetsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import SubnetsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import SubnetsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import SubnetsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import SubnetsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import SubnetsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import SubnetsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import SubnetsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import SubnetsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import SubnetsOperations 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 usages(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`UsagesOperations` - * 2016-09-01: :class:`UsagesOperations` - * 2016-12-01: :class:`UsagesOperations` - * 2017-03-01: :class:`UsagesOperations` - * 2017-06-01: :class:`UsagesOperations` - * 2017-08-01: :class:`UsagesOperations` - * 2017-09-01: :class:`UsagesOperations` - * 2017-10-01: :class:`UsagesOperations` - * 2017-11-01: :class:`UsagesOperations` - * 2018-01-01: :class:`UsagesOperations` - * 2018-02-01: :class:`UsagesOperations` - * 2018-04-01: :class:`UsagesOperations` - * 2018-06-01: :class:`UsagesOperations` - * 2018-07-01: :class:`UsagesOperations` - * 2018-08-01: :class:`UsagesOperations` - * 2018-10-01: :class:`UsagesOperations` - * 2018-11-01: :class:`UsagesOperations` - * 2018-12-01: :class:`UsagesOperations` - * 2019-02-01: :class:`UsagesOperations` - * 2019-04-01: :class:`UsagesOperations` - """ - api_version = self._get_api_version('usages') - if api_version == '2015-06-15': - from .v2015_06_15.operations import UsagesOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import UsagesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import UsagesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import UsagesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import UsagesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import UsagesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import UsagesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import UsagesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import UsagesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import UsagesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import UsagesOperations 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 virtual_hubs(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`VirtualHubsOperations` - * 2018-06-01: :class:`VirtualHubsOperations` - * 2018-07-01: :class:`VirtualHubsOperations` - * 2018-08-01: :class:`VirtualHubsOperations` - * 2018-10-01: :class:`VirtualHubsOperations` - * 2018-11-01: :class:`VirtualHubsOperations` - * 2018-12-01: :class:`VirtualHubsOperations` - * 2019-02-01: :class:`VirtualHubsOperations` - * 2019-04-01: :class:`VirtualHubsOperations` - """ - api_version = self._get_api_version('virtual_hubs') - if api_version == '2018-04-01': - from .v2018_04_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualHubsOperations 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 virtual_network_gateway_connections(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2016-09-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2016-12-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2017-03-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2017-06-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2017-08-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2017-09-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2017-10-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2017-11-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-01-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-02-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-04-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-06-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-07-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-08-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-10-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-11-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-12-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2019-02-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2019-04-01: :class:`VirtualNetworkGatewayConnectionsOperations` - """ - api_version = self._get_api_version('virtual_network_gateway_connections') - if api_version == '2015-06-15': - from .v2015_06_15.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualNetworkGatewayConnectionsOperations 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 virtual_network_gateways(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualNetworkGatewaysOperations` - * 2016-09-01: :class:`VirtualNetworkGatewaysOperations` - * 2016-12-01: :class:`VirtualNetworkGatewaysOperations` - * 2017-03-01: :class:`VirtualNetworkGatewaysOperations` - * 2017-06-01: :class:`VirtualNetworkGatewaysOperations` - * 2017-08-01: :class:`VirtualNetworkGatewaysOperations` - * 2017-09-01: :class:`VirtualNetworkGatewaysOperations` - * 2017-10-01: :class:`VirtualNetworkGatewaysOperations` - * 2017-11-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-01-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-02-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-04-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-06-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-07-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-08-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-10-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-11-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-12-01: :class:`VirtualNetworkGatewaysOperations` - * 2019-02-01: :class:`VirtualNetworkGatewaysOperations` - * 2019-04-01: :class:`VirtualNetworkGatewaysOperations` - """ - api_version = self._get_api_version('virtual_network_gateways') - if api_version == '2015-06-15': - from .v2015_06_15.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualNetworkGatewaysOperations 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 virtual_network_peerings(self): - """Instance depends on the API version: - - * 2016-09-01: :class:`VirtualNetworkPeeringsOperations` - * 2016-12-01: :class:`VirtualNetworkPeeringsOperations` - * 2017-03-01: :class:`VirtualNetworkPeeringsOperations` - * 2017-06-01: :class:`VirtualNetworkPeeringsOperations` - * 2017-08-01: :class:`VirtualNetworkPeeringsOperations` - * 2017-09-01: :class:`VirtualNetworkPeeringsOperations` - * 2017-10-01: :class:`VirtualNetworkPeeringsOperations` - * 2017-11-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-01-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-02-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-04-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-06-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-07-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-08-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-10-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-11-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-12-01: :class:`VirtualNetworkPeeringsOperations` - * 2019-02-01: :class:`VirtualNetworkPeeringsOperations` - * 2019-04-01: :class:`VirtualNetworkPeeringsOperations` - """ - api_version = self._get_api_version('virtual_network_peerings') - if api_version == '2016-09-01': - from .v2016_09_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualNetworkPeeringsOperations 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 virtual_network_taps(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`VirtualNetworkTapsOperations` - * 2018-10-01: :class:`VirtualNetworkTapsOperations` - * 2018-11-01: :class:`VirtualNetworkTapsOperations` - * 2018-12-01: :class:`VirtualNetworkTapsOperations` - * 2019-02-01: :class:`VirtualNetworkTapsOperations` - * 2019-04-01: :class:`VirtualNetworkTapsOperations` - """ - api_version = self._get_api_version('virtual_network_taps') - if api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualNetworkTapsOperations 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 virtual_networks(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualNetworksOperations` - * 2016-09-01: :class:`VirtualNetworksOperations` - * 2016-12-01: :class:`VirtualNetworksOperations` - * 2017-03-01: :class:`VirtualNetworksOperations` - * 2017-06-01: :class:`VirtualNetworksOperations` - * 2017-08-01: :class:`VirtualNetworksOperations` - * 2017-09-01: :class:`VirtualNetworksOperations` - * 2017-10-01: :class:`VirtualNetworksOperations` - * 2017-11-01: :class:`VirtualNetworksOperations` - * 2018-01-01: :class:`VirtualNetworksOperations` - * 2018-02-01: :class:`VirtualNetworksOperations` - * 2018-04-01: :class:`VirtualNetworksOperations` - * 2018-06-01: :class:`VirtualNetworksOperations` - * 2018-07-01: :class:`VirtualNetworksOperations` - * 2018-08-01: :class:`VirtualNetworksOperations` - * 2018-10-01: :class:`VirtualNetworksOperations` - * 2018-11-01: :class:`VirtualNetworksOperations` - * 2018-12-01: :class:`VirtualNetworksOperations` - * 2019-02-01: :class:`VirtualNetworksOperations` - * 2019-04-01: :class:`VirtualNetworksOperations` - """ - api_version = self._get_api_version('virtual_networks') - if api_version == '2015-06-15': - from .v2015_06_15.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualNetworksOperations 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 virtual_wa_ns(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`VirtualWANsOperations` - * 2018-06-01: :class:`VirtualWANsOperations` - * 2018-07-01: :class:`VirtualWANsOperations` - """ - api_version = self._get_api_version('virtual_wa_ns') - if api_version == '2018-04-01': - from .v2018_04_01.operations import VirtualWANsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VirtualWANsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VirtualWANsOperations 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 virtual_wans(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`VirtualWansOperations` - * 2018-10-01: :class:`VirtualWansOperations` - * 2018-11-01: :class:`VirtualWansOperations` - * 2018-12-01: :class:`VirtualWansOperations` - * 2019-02-01: :class:`VirtualWansOperations` - * 2019-04-01: :class:`VirtualWansOperations` - """ - api_version = self._get_api_version('virtual_wans') - if api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualWansOperations 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 vpn_connections(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`VpnConnectionsOperations` - * 2018-06-01: :class:`VpnConnectionsOperations` - * 2018-07-01: :class:`VpnConnectionsOperations` - * 2018-08-01: :class:`VpnConnectionsOperations` - * 2018-10-01: :class:`VpnConnectionsOperations` - * 2018-11-01: :class:`VpnConnectionsOperations` - * 2018-12-01: :class:`VpnConnectionsOperations` - * 2019-02-01: :class:`VpnConnectionsOperations` - * 2019-04-01: :class:`VpnConnectionsOperations` - """ - api_version = self._get_api_version('vpn_connections') - if api_version == '2018-04-01': - from .v2018_04_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VpnConnectionsOperations 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 vpn_gateways(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`VpnGatewaysOperations` - * 2018-06-01: :class:`VpnGatewaysOperations` - * 2018-07-01: :class:`VpnGatewaysOperations` - * 2018-08-01: :class:`VpnGatewaysOperations` - * 2018-10-01: :class:`VpnGatewaysOperations` - * 2018-11-01: :class:`VpnGatewaysOperations` - * 2018-12-01: :class:`VpnGatewaysOperations` - * 2019-02-01: :class:`VpnGatewaysOperations` - * 2019-04-01: :class:`VpnGatewaysOperations` - """ - api_version = self._get_api_version('vpn_gateways') - if api_version == '2018-04-01': - from .v2018_04_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VpnGatewaysOperations 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 vpn_sites(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`VpnSitesOperations` - * 2018-06-01: :class:`VpnSitesOperations` - * 2018-07-01: :class:`VpnSitesOperations` - * 2018-08-01: :class:`VpnSitesOperations` - * 2018-10-01: :class:`VpnSitesOperations` - * 2018-11-01: :class:`VpnSitesOperations` - * 2018-12-01: :class:`VpnSitesOperations` - * 2019-02-01: :class:`VpnSitesOperations` - * 2019-04-01: :class:`VpnSitesOperations` - """ - api_version = self._get_api_version('vpn_sites') - if api_version == '2018-04-01': - from .v2018_04_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VpnSitesOperations 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 vpn_sites_configuration(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`VpnSitesConfigurationOperations` - * 2018-06-01: :class:`VpnSitesConfigurationOperations` - * 2018-07-01: :class:`VpnSitesConfigurationOperations` - * 2018-08-01: :class:`VpnSitesConfigurationOperations` - * 2018-10-01: :class:`VpnSitesConfigurationOperations` - * 2018-11-01: :class:`VpnSitesConfigurationOperations` - * 2018-12-01: :class:`VpnSitesConfigurationOperations` - * 2019-02-01: :class:`VpnSitesConfigurationOperations` - * 2019-04-01: :class:`VpnSitesConfigurationOperations` - """ - api_version = self._get_api_version('vpn_sites_configuration') - if api_version == '2018-04-01': - from .v2018_04_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VpnSitesConfigurationOperations 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 web_application_firewall_policies(self): - """Instance depends on the API version: - - * 2018-12-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2019-02-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2019-04-01: :class:`WebApplicationFirewallPoliciesOperations` - """ - api_version = self._get_api_version('web_application_firewall_policies') - if api_version == '2018-12-01': - from .v2018_12_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import WebApplicationFirewallPoliciesOperations 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))) diff --git a/sdk/network/azure-mgmt-network/dev_requirements.txt b/sdk/network/azure-mgmt-network/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/network/azure-mgmt-network/dev_requirements.txt +++ b/sdk/network/azure-mgmt-network/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/notificationhubs/azure-mgmt-notificationhubs/dev_requirements.txt b/sdk/notificationhubs/azure-mgmt-notificationhubs/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/notificationhubs/azure-mgmt-notificationhubs/dev_requirements.txt +++ b/sdk/notificationhubs/azure-mgmt-notificationhubs/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/rdbms/azure-mgmt-rdbms/HISTORY.rst b/sdk/rdbms/azure-mgmt-rdbms/HISTORY.rst index 7ab8056e9fef..3f7254f10e8f 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/HISTORY.rst +++ b/sdk/rdbms/azure-mgmt-rdbms/HISTORY.rst @@ -3,6 +3,14 @@ Release History =============== +1.9.0 (2019-06-04) +++++++++++++++++++ + +**Features** + +- Add storage_autogrow in all DB +- Support for PG11 + 1.8.0 (2019-04-08) ++++++++++++++++++ diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/__init__.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/__init__.py index 43aba9fbd4ef..b5fb08027522 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/__init__.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/__init__.py @@ -73,6 +73,7 @@ SslEnforcementEnum, ServerState, GeoRedundantBackup, + StorageAutogrow, SkuTier, VirtualNetworkRuleState, OperationOrigin, @@ -116,6 +117,7 @@ 'SslEnforcementEnum', 'ServerState', 'GeoRedundantBackup', + 'StorageAutogrow', 'SkuTier', 'VirtualNetworkRuleState', 'OperationOrigin', diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/maria_db_management_client_enums.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/maria_db_management_client_enums.py index 9ee8ed1ee785..741cf2c884d9 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/maria_db_management_client_enums.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/maria_db_management_client_enums.py @@ -37,6 +37,12 @@ class GeoRedundantBackup(str, Enum): disabled = "Disabled" +class StorageAutogrow(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class SkuTier(str, Enum): basic = "Basic" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile.py index 3af4d11079a5..79fddd2a0c15 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile.py @@ -23,12 +23,17 @@ class StorageProfile(Model): ~azure.mgmt.rdbms.mariadb.models.GeoRedundantBackup :param storage_mb: Max storage allowed for a server. :type storage_mb: int + :param storage_autogrow: Enable Storage Auto Grow. Possible values + include: 'Enabled', 'Disabled' + :type storage_autogrow: str or + ~azure.mgmt.rdbms.mariadb.models.StorageAutogrow """ _attribute_map = { 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + 'storage_autogrow': {'key': 'storageAutogrow', 'type': 'str'}, } def __init__(self, **kwargs): @@ -36,3 +41,4 @@ def __init__(self, **kwargs): self.backup_retention_days = kwargs.get('backup_retention_days', None) self.geo_redundant_backup = kwargs.get('geo_redundant_backup', None) self.storage_mb = kwargs.get('storage_mb', None) + self.storage_autogrow = kwargs.get('storage_autogrow', None) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile_py3.py index e231ef1873a7..a38cb348e932 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile_py3.py @@ -23,16 +23,22 @@ class StorageProfile(Model): ~azure.mgmt.rdbms.mariadb.models.GeoRedundantBackup :param storage_mb: Max storage allowed for a server. :type storage_mb: int + :param storage_autogrow: Enable Storage Auto Grow. Possible values + include: 'Enabled', 'Disabled' + :type storage_autogrow: str or + ~azure.mgmt.rdbms.mariadb.models.StorageAutogrow """ _attribute_map = { 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + 'storage_autogrow': {'key': 'storageAutogrow', 'type': 'str'}, } - def __init__(self, *, backup_retention_days: int=None, geo_redundant_backup=None, storage_mb: int=None, **kwargs) -> None: + def __init__(self, *, backup_retention_days: int=None, geo_redundant_backup=None, storage_mb: int=None, storage_autogrow=None, **kwargs) -> None: super(StorageProfile, self).__init__(**kwargs) self.backup_retention_days = backup_retention_days self.geo_redundant_backup = geo_redundant_backup self.storage_mb = storage_mb + self.storage_autogrow = storage_autogrow diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py index 7abae0f1efde..8120d277bc4a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py @@ -73,6 +73,7 @@ SslEnforcementEnum, ServerState, GeoRedundantBackup, + StorageAutogrow, SkuTier, VirtualNetworkRuleState, OperationOrigin, @@ -116,6 +117,7 @@ 'SslEnforcementEnum', 'ServerState', 'GeoRedundantBackup', + 'StorageAutogrow', 'SkuTier', 'VirtualNetworkRuleState', 'OperationOrigin', diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/my_sql_management_client_enums.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/my_sql_management_client_enums.py index 9ee8ed1ee785..741cf2c884d9 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/my_sql_management_client_enums.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/my_sql_management_client_enums.py @@ -37,6 +37,12 @@ class GeoRedundantBackup(str, Enum): disabled = "Disabled" +class StorageAutogrow(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class SkuTier(str, Enum): basic = "Basic" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/storage_profile.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/storage_profile.py index c40172fb058b..65f0a5aa1bd6 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/storage_profile.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/storage_profile.py @@ -23,12 +23,17 @@ class StorageProfile(Model): ~azure.mgmt.rdbms.mysql.models.GeoRedundantBackup :param storage_mb: Max storage allowed for a server. :type storage_mb: int + :param storage_autogrow: Enable Storage Auto Grow. Possible values + include: 'Enabled', 'Disabled' + :type storage_autogrow: str or + ~azure.mgmt.rdbms.mysql.models.StorageAutogrow """ _attribute_map = { 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + 'storage_autogrow': {'key': 'storageAutogrow', 'type': 'str'}, } def __init__(self, **kwargs): @@ -36,3 +41,4 @@ def __init__(self, **kwargs): self.backup_retention_days = kwargs.get('backup_retention_days', None) self.geo_redundant_backup = kwargs.get('geo_redundant_backup', None) self.storage_mb = kwargs.get('storage_mb', None) + self.storage_autogrow = kwargs.get('storage_autogrow', None) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/storage_profile_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/storage_profile_py3.py index 8a50588949d4..626fee4542cc 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/storage_profile_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/storage_profile_py3.py @@ -23,16 +23,22 @@ class StorageProfile(Model): ~azure.mgmt.rdbms.mysql.models.GeoRedundantBackup :param storage_mb: Max storage allowed for a server. :type storage_mb: int + :param storage_autogrow: Enable Storage Auto Grow. Possible values + include: 'Enabled', 'Disabled' + :type storage_autogrow: str or + ~azure.mgmt.rdbms.mysql.models.StorageAutogrow """ _attribute_map = { 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + 'storage_autogrow': {'key': 'storageAutogrow', 'type': 'str'}, } - def __init__(self, *, backup_retention_days: int=None, geo_redundant_backup=None, storage_mb: int=None, **kwargs) -> None: + def __init__(self, *, backup_retention_days: int=None, geo_redundant_backup=None, storage_mb: int=None, storage_autogrow=None, **kwargs) -> None: super(StorageProfile, self).__init__(**kwargs) self.backup_retention_days = backup_retention_days self.geo_redundant_backup = geo_redundant_backup self.storage_mb = storage_mb + self.storage_autogrow = storage_autogrow diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/__init__.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/__init__.py index b379fd180afb..b817ca63f163 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/__init__.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/__init__.py @@ -73,6 +73,7 @@ SslEnforcementEnum, ServerState, GeoRedundantBackup, + StorageAutogrow, SkuTier, VirtualNetworkRuleState, OperationOrigin, @@ -116,6 +117,7 @@ 'SslEnforcementEnum', 'ServerState', 'GeoRedundantBackup', + 'StorageAutogrow', 'SkuTier', 'VirtualNetworkRuleState', 'OperationOrigin', diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/postgre_sql_management_client_enums.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/postgre_sql_management_client_enums.py index 58b3c8ce4f2b..9a8ee77dd1c9 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/postgre_sql_management_client_enums.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/postgre_sql_management_client_enums.py @@ -19,6 +19,7 @@ class ServerVersion(str, Enum): one_zero = "10" one_zero_full_stop_zero = "10.0" one_zero_full_stop_two = "10.2" + one_one = "11" class SslEnforcementEnum(str, Enum): @@ -40,6 +41,12 @@ class GeoRedundantBackup(str, Enum): disabled = "Disabled" +class StorageAutogrow(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class SkuTier(str, Enum): basic = "Basic" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server.py index b013c94ca165..4a38d78bf634 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server.py @@ -37,7 +37,7 @@ class Server(TrackedResource): for creation). :type administrator_login: str :param version: Server version. Possible values include: '9.5', '9.6', - '10', '10.0', '10.2' + '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create.py index a0e4e5e6a0eb..907554612a63 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create.py @@ -23,7 +23,7 @@ class ServerPropertiesForCreate(Model): All required parameters must be populated in order to send to Azure. :param version: Server version. Possible values include: '9.5', '9.6', - '10', '10.0', '10.2' + '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create_py3.py index a1399f063c1d..e82ec7694b1a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create_py3.py @@ -23,7 +23,7 @@ class ServerPropertiesForCreate(Model): All required parameters must be populated in order to send to Azure. :param version: Server version. Possible values include: '9.5', '9.6', - '10', '10.0', '10.2' + '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_default_create.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_default_create.py index da6fd136fecf..4bac0251986c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_default_create.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_default_create.py @@ -18,7 +18,7 @@ class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate): All required parameters must be populated in order to send to Azure. :param version: Server version. Possible values include: '9.5', '9.6', - '10', '10.0', '10.2' + '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_default_create_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_default_create_py3.py index 3cef4094aa1c..e4a996f1abaa 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_default_create_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_default_create_py3.py @@ -18,7 +18,7 @@ class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate): All required parameters must be populated in order to send to Azure. :param version: Server version. Possible values include: '9.5', '9.6', - '10', '10.0', '10.2' + '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_geo_restore.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_geo_restore.py index 195d1fe26c04..52b030c07b8a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_geo_restore.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_geo_restore.py @@ -19,7 +19,7 @@ class ServerPropertiesForGeoRestore(ServerPropertiesForCreate): All required parameters must be populated in order to send to Azure. :param version: Server version. Possible values include: '9.5', '9.6', - '10', '10.0', '10.2' + '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_geo_restore_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_geo_restore_py3.py index bc8ac2dd410f..773d57cbb351 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_geo_restore_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_geo_restore_py3.py @@ -19,7 +19,7 @@ class ServerPropertiesForGeoRestore(ServerPropertiesForCreate): All required parameters must be populated in order to send to Azure. :param version: Server version. Possible values include: '9.5', '9.6', - '10', '10.0', '10.2' + '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_replica.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_replica.py index 8ae0b355a7a0..de45ede3b84b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_replica.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_replica.py @@ -18,7 +18,7 @@ class ServerPropertiesForReplica(ServerPropertiesForCreate): All required parameters must be populated in order to send to Azure. :param version: Server version. Possible values include: '9.5', '9.6', - '10', '10.0', '10.2' + '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_replica_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_replica_py3.py index 0597ec24e6ef..a2d98db8cc5c 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_replica_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_replica_py3.py @@ -18,7 +18,7 @@ class ServerPropertiesForReplica(ServerPropertiesForCreate): All required parameters must be populated in order to send to Azure. :param version: Server version. Possible values include: '9.5', '9.6', - '10', '10.0', '10.2' + '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_restore.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_restore.py index 95559a5fe787..54ad82a03ffb 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_restore.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_restore.py @@ -18,7 +18,7 @@ class ServerPropertiesForRestore(ServerPropertiesForCreate): All required parameters must be populated in order to send to Azure. :param version: Server version. Possible values include: '9.5', '9.6', - '10', '10.0', '10.2' + '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_restore_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_restore_py3.py index 29afafba30c4..24f13907f170 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_restore_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_restore_py3.py @@ -18,7 +18,7 @@ class ServerPropertiesForRestore(ServerPropertiesForCreate): All required parameters must be populated in order to send to Azure. :param version: Server version. Possible values include: '9.5', '9.6', - '10', '10.0', '10.2' + '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_py3.py index 5e399520528e..0209acc46fb5 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_py3.py @@ -37,7 +37,7 @@ class Server(TrackedResource): for creation). :type administrator_login: str :param version: Server version. Possible values include: '9.5', '9.6', - '10', '10.0', '10.2' + '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters.py index 1fd60d536a78..4363701bc22a 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters.py @@ -23,7 +23,7 @@ class ServerUpdateParameters(Model): login. :type administrator_login_password: str :param version: The version of a server. Possible values include: '9.5', - '9.6', '10', '10.0', '10.2' + '9.6', '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters_py3.py index 8d077bdbf99c..2f1f1fe2d799 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters_py3.py @@ -23,7 +23,7 @@ class ServerUpdateParameters(Model): login. :type administrator_login_password: str :param version: The version of a server. Possible values include: '9.5', - '9.6', '10', '10.0', '10.2' + '9.6', '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/storage_profile.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/storage_profile.py index 52d2ce839cdc..e91b687dd805 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/storage_profile.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/storage_profile.py @@ -23,12 +23,17 @@ class StorageProfile(Model): ~azure.mgmt.rdbms.postgresql.models.GeoRedundantBackup :param storage_mb: Max storage allowed for a server. :type storage_mb: int + :param storage_autogrow: Enable Storage Auto Grow. Possible values + include: 'Enabled', 'Disabled' + :type storage_autogrow: str or + ~azure.mgmt.rdbms.postgresql.models.StorageAutogrow """ _attribute_map = { 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + 'storage_autogrow': {'key': 'storageAutogrow', 'type': 'str'}, } def __init__(self, **kwargs): @@ -36,3 +41,4 @@ def __init__(self, **kwargs): self.backup_retention_days = kwargs.get('backup_retention_days', None) self.geo_redundant_backup = kwargs.get('geo_redundant_backup', None) self.storage_mb = kwargs.get('storage_mb', None) + self.storage_autogrow = kwargs.get('storage_autogrow', None) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/storage_profile_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/storage_profile_py3.py index bd6e048710a2..53cf00673677 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/storage_profile_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/storage_profile_py3.py @@ -23,16 +23,22 @@ class StorageProfile(Model): ~azure.mgmt.rdbms.postgresql.models.GeoRedundantBackup :param storage_mb: Max storage allowed for a server. :type storage_mb: int + :param storage_autogrow: Enable Storage Auto Grow. Possible values + include: 'Enabled', 'Disabled' + :type storage_autogrow: str or + ~azure.mgmt.rdbms.postgresql.models.StorageAutogrow """ _attribute_map = { 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + 'storage_autogrow': {'key': 'storageAutogrow', 'type': 'str'}, } - def __init__(self, *, backup_retention_days: int=None, geo_redundant_backup=None, storage_mb: int=None, **kwargs) -> None: + def __init__(self, *, backup_retention_days: int=None, geo_redundant_backup=None, storage_mb: int=None, storage_autogrow=None, **kwargs) -> None: super(StorageProfile, self).__init__(**kwargs) self.backup_retention_days = backup_retention_days self.geo_redundant_backup = geo_redundant_backup self.storage_mb = storage_mb + self.storage_autogrow = storage_autogrow diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py index baeaf696f567..5650dfeffe00 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "1.8.0" +VERSION = "1.9.0" diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/dev_requirements.txt b/sdk/recoveryservices/azure-mgmt-recoveryservices/dev_requirements.txt index 19da03a19652..1cfa079cdfb1 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/dev_requirements.txt +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/dev_requirements.txt @@ -1,2 +1,2 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools -e ../../resources/azure-mgmt-resource diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/dev_requirements.txt b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/dev_requirements.txt index 4e153661d407..4a31f2fd0b70 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/dev_requirements.txt +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/dev_requirements.txt @@ -1,2 +1,2 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools -e ../azure-mgmt-recoveryservices diff --git a/sdk/redis/azure-mgmt-redis/dev_requirements.txt b/sdk/redis/azure-mgmt-redis/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/redis/azure-mgmt-redis/dev_requirements.txt +++ b/sdk/redis/azure-mgmt-redis/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/relay/azure-mgmt-relay/dev_requirements.txt b/sdk/relay/azure-mgmt-relay/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/relay/azure-mgmt-relay/dev_requirements.txt +++ b/sdk/relay/azure-mgmt-relay/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/reservations/azure-mgmt-reservations/dev_requirements.txt b/sdk/reservations/azure-mgmt-reservations/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/reservations/azure-mgmt-reservations/dev_requirements.txt +++ b/sdk/reservations/azure-mgmt-reservations/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/resources/azure-mgmt-resource/dev_requirements.txt b/sdk/resources/azure-mgmt-resource/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/resources/azure-mgmt-resource/dev_requirements.txt +++ b/sdk/resources/azure-mgmt-resource/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/resources/azure-mgmt-resourcegraph/dev_requirements.txt b/sdk/resources/azure-mgmt-resourcegraph/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/resources/azure-mgmt-resourcegraph/dev_requirements.txt +++ b/sdk/resources/azure-mgmt-resourcegraph/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/scheduler/azure-mgmt-scheduler/dev_requirements.txt b/sdk/scheduler/azure-mgmt-scheduler/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/scheduler/azure-mgmt-scheduler/dev_requirements.txt +++ b/sdk/scheduler/azure-mgmt-scheduler/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/search/azure-mgmt-search/dev_requirements.txt b/sdk/search/azure-mgmt-search/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/search/azure-mgmt-search/dev_requirements.txt +++ b/sdk/search/azure-mgmt-search/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/servermanager/azure-mgmt-servermanager/dev_requirements.txt b/sdk/servermanager/azure-mgmt-servermanager/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/servermanager/azure-mgmt-servermanager/dev_requirements.txt +++ b/sdk/servermanager/azure-mgmt-servermanager/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/servicebus/azure-mgmt-servicebus/dev_requirements.txt b/sdk/servicebus/azure-mgmt-servicebus/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/servicebus/azure-mgmt-servicebus/dev_requirements.txt +++ b/sdk/servicebus/azure-mgmt-servicebus/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/servicebus/azure-servicebus/dev_requirements.txt b/sdk/servicebus/azure-servicebus/dev_requirements.txt index c11052a81f54..261b2a73dece 100644 --- a/sdk/servicebus/azure-servicebus/dev_requirements.txt +++ b/sdk/servicebus/azure-servicebus/dev_requirements.txt @@ -1,3 +1,3 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools pylint==2.1.1; python_version >= '3.4' pylint==1.8.4; python_version < '3.4' diff --git a/sdk/sql/azure-mgmt-sql/dev_requirements.txt b/sdk/sql/azure-mgmt-sql/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/sql/azure-mgmt-sql/dev_requirements.txt +++ b/sdk/sql/azure-mgmt-sql/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/HISTORY.rst b/sdk/sql/azure-mgmt-sqlvirtualmachine/HISTORY.rst index b89a8f95b90e..8788ff4aae2b 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/HISTORY.rst +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/HISTORY.rst @@ -3,6 +3,13 @@ Release History =============== +0.3.0 (2019-06-03) +++++++++++++++++++ + +**Features** + +- sql_image_sku is now writable + 0.2.0 (2018-12-07) ++++++++++++++++++ diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/MANIFEST.in b/sdk/sql/azure-mgmt-sqlvirtualmachine/MANIFEST.in index 6ceb27f7a96e..e4884efef41b 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/MANIFEST.in +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/MANIFEST.in @@ -1,3 +1,4 @@ +recursive-include tests *.py *.yaml include *.rst include azure/__init__.py include azure/mgmt/__init__.py diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/README.rst b/sdk/sql/azure-mgmt-sqlvirtualmachine/README.rst index 392751eca897..90cbcf8688b9 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/README.rst +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener.py index 0647367c314f..c34d27fb606c 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener.py @@ -24,7 +24,7 @@ class AvailabilityGroupListener(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar provisioning_state: Provisioning state to track the aysnc operation + :ivar provisioning_state: Provisioning state to track the async operation status. :vartype provisioning_state: str :param availability_group_name: Name of the availability group. diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener_py3.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener_py3.py index 2f290deacd45..a1c2beb48414 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener_py3.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener_py3.py @@ -24,7 +24,7 @@ class AvailabilityGroupListener(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar provisioning_state: Provisioning state to track the aysnc operation + :ivar provisioning_state: Provisioning state to track the async operation status. :vartype provisioning_state: str :param availability_group_name: Name of the availability group. diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings.py index 9698b522e3cb..10091fe3b693 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings.py @@ -17,22 +17,22 @@ class SqlStorageUpdateSettings(Model): :param disk_count: Virtual machine disk count. :type disk_count: int + :param starting_device_id: Device id of the first disk to be updated. + :type starting_device_id: int :param disk_configuration_type: Disk configuration to apply to SQL Server. Possible values include: 'NEW', 'EXTEND', 'ADD' :type disk_configuration_type: str or ~azure.mgmt.sqlvirtualmachine.models.DiskConfigurationType - :param starting_device_id: Device id of the first disk to be updated. - :type starting_device_id: int """ _attribute_map = { 'disk_count': {'key': 'diskCount', 'type': 'int'}, - 'disk_configuration_type': {'key': 'diskConfigurationType', 'type': 'str'}, 'starting_device_id': {'key': 'startingDeviceId', 'type': 'int'}, + 'disk_configuration_type': {'key': 'diskConfigurationType', 'type': 'str'}, } def __init__(self, **kwargs): super(SqlStorageUpdateSettings, self).__init__(**kwargs) self.disk_count = kwargs.get('disk_count', None) - self.disk_configuration_type = kwargs.get('disk_configuration_type', None) self.starting_device_id = kwargs.get('starting_device_id', None) + self.disk_configuration_type = kwargs.get('disk_configuration_type', None) diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings_py3.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings_py3.py index a392f27f9089..1948c580be7a 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings_py3.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings_py3.py @@ -17,22 +17,22 @@ class SqlStorageUpdateSettings(Model): :param disk_count: Virtual machine disk count. :type disk_count: int + :param starting_device_id: Device id of the first disk to be updated. + :type starting_device_id: int :param disk_configuration_type: Disk configuration to apply to SQL Server. Possible values include: 'NEW', 'EXTEND', 'ADD' :type disk_configuration_type: str or ~azure.mgmt.sqlvirtualmachine.models.DiskConfigurationType - :param starting_device_id: Device id of the first disk to be updated. - :type starting_device_id: int """ _attribute_map = { 'disk_count': {'key': 'diskCount', 'type': 'int'}, - 'disk_configuration_type': {'key': 'diskConfigurationType', 'type': 'str'}, 'starting_device_id': {'key': 'startingDeviceId', 'type': 'int'}, + 'disk_configuration_type': {'key': 'diskConfigurationType', 'type': 'str'}, } - def __init__(self, *, disk_count: int=None, disk_configuration_type=None, starting_device_id: int=None, **kwargs) -> None: + def __init__(self, *, disk_count: int=None, starting_device_id: int=None, disk_configuration_type=None, **kwargs) -> None: super(SqlStorageUpdateSettings, self).__init__(**kwargs) self.disk_count = disk_count - self.disk_configuration_type = disk_configuration_type self.starting_device_id = starting_device_id + self.disk_configuration_type = disk_configuration_type diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine.py index c72dc4d1a1f3..061c98882703 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine.py @@ -35,7 +35,7 @@ class SqlVirtualMachine(TrackedResource): :param virtual_machine_resource_id: ARM Resource id of underlying virtual machine created from SQL marketplace image. :type virtual_machine_resource_id: str - :ivar provisioning_state: Provisioning state to track the aysnc operation + :ivar provisioning_state: Provisioning state to track the async operation status. :vartype provisioning_state: str :ivar sql_image_offer: SQL image offer. Examples include SQL2016-WS2016, @@ -45,9 +45,9 @@ class SqlVirtualMachine(TrackedResource): include: 'PAYG', 'AHUB' :type sql_server_license_type: str or ~azure.mgmt.sqlvirtualmachine.models.SqlServerLicenseType - :ivar sql_image_sku: SQL image sku. Possible values include: 'Developer', - 'Express', 'Standard', 'Enterprise', 'Web' - :vartype sql_image_sku: str or + :param sql_image_sku: SQL Server edition type. Possible values include: + 'Developer', 'Express', 'Standard', 'Enterprise', 'Web' + :type sql_image_sku: str or ~azure.mgmt.sqlvirtualmachine.models.SqlImageSku :param sql_virtual_machine_group_resource_id: ARM resource id of the SQL virtual machine group this SQL virtual machine is or will be part of. @@ -79,7 +79,6 @@ class SqlVirtualMachine(TrackedResource): 'location': {'required': True}, 'provisioning_state': {'readonly': True}, 'sql_image_offer': {'readonly': True}, - 'sql_image_sku': {'readonly': True}, } _attribute_map = { @@ -109,7 +108,7 @@ def __init__(self, **kwargs): self.provisioning_state = None self.sql_image_offer = None self.sql_server_license_type = kwargs.get('sql_server_license_type', None) - self.sql_image_sku = None + self.sql_image_sku = kwargs.get('sql_image_sku', None) self.sql_virtual_machine_group_resource_id = kwargs.get('sql_virtual_machine_group_resource_id', None) self.wsfc_domain_credentials = kwargs.get('wsfc_domain_credentials', None) self.auto_patching_settings = kwargs.get('auto_patching_settings', None) diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group.py index 81cd2b479027..538c955f7fc8 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group.py @@ -30,7 +30,7 @@ class SqlVirtualMachineGroup(TrackedResource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :ivar provisioning_state: Provisioning state to track the aysnc operation + :ivar provisioning_state: Provisioning state to track the async operation status. :vartype provisioning_state: str :param sql_image_offer: SQL image offer. Examples may include diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_py3.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_py3.py index 93b3b2e08a6c..f538fee0a410 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_py3.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_py3.py @@ -30,7 +30,7 @@ class SqlVirtualMachineGroup(TrackedResource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :ivar provisioning_state: Provisioning state to track the aysnc operation + :ivar provisioning_state: Provisioning state to track the async operation status. :vartype provisioning_state: str :param sql_image_offer: SQL image offer. Examples may include diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_py3.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_py3.py index d63a77f1c398..2a1072594bad 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_py3.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_py3.py @@ -35,7 +35,7 @@ class SqlVirtualMachine(TrackedResource): :param virtual_machine_resource_id: ARM Resource id of underlying virtual machine created from SQL marketplace image. :type virtual_machine_resource_id: str - :ivar provisioning_state: Provisioning state to track the aysnc operation + :ivar provisioning_state: Provisioning state to track the async operation status. :vartype provisioning_state: str :ivar sql_image_offer: SQL image offer. Examples include SQL2016-WS2016, @@ -45,9 +45,9 @@ class SqlVirtualMachine(TrackedResource): include: 'PAYG', 'AHUB' :type sql_server_license_type: str or ~azure.mgmt.sqlvirtualmachine.models.SqlServerLicenseType - :ivar sql_image_sku: SQL image sku. Possible values include: 'Developer', - 'Express', 'Standard', 'Enterprise', 'Web' - :vartype sql_image_sku: str or + :param sql_image_sku: SQL Server edition type. Possible values include: + 'Developer', 'Express', 'Standard', 'Enterprise', 'Web' + :type sql_image_sku: str or ~azure.mgmt.sqlvirtualmachine.models.SqlImageSku :param sql_virtual_machine_group_resource_id: ARM resource id of the SQL virtual machine group this SQL virtual machine is or will be part of. @@ -79,7 +79,6 @@ class SqlVirtualMachine(TrackedResource): 'location': {'required': True}, 'provisioning_state': {'readonly': True}, 'sql_image_offer': {'readonly': True}, - 'sql_image_sku': {'readonly': True}, } _attribute_map = { @@ -102,14 +101,14 @@ class SqlVirtualMachine(TrackedResource): 'server_configurations_management_settings': {'key': 'properties.serverConfigurationsManagementSettings', 'type': 'ServerConfigurationsManagementSettings'}, } - def __init__(self, *, location: str, tags=None, identity=None, virtual_machine_resource_id: str=None, sql_server_license_type=None, sql_virtual_machine_group_resource_id: str=None, wsfc_domain_credentials=None, auto_patching_settings=None, auto_backup_settings=None, key_vault_credential_settings=None, server_configurations_management_settings=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, identity=None, virtual_machine_resource_id: str=None, sql_server_license_type=None, sql_image_sku=None, sql_virtual_machine_group_resource_id: str=None, wsfc_domain_credentials=None, auto_patching_settings=None, auto_backup_settings=None, key_vault_credential_settings=None, server_configurations_management_settings=None, **kwargs) -> None: super(SqlVirtualMachine, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.virtual_machine_resource_id = virtual_machine_resource_id self.provisioning_state = None self.sql_image_offer = None self.sql_server_license_type = sql_server_license_type - self.sql_image_sku = None + self.sql_image_sku = sql_image_sku self.sql_virtual_machine_group_resource_id = sql_virtual_machine_group_resource_id self.wsfc_domain_credentials = wsfc_domain_credentials self.auto_patching_settings = auto_patching_settings diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/sql_virtual_machines_operations.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/sql_virtual_machines_operations.py index efb68b3f404b..4d79d8516fd7 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/sql_virtual_machines_operations.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/sql_virtual_machines_operations.py @@ -39,6 +39,70 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets all SQL virtual machines in a 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 SqlVirtualMachine + :rtype: + ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachinePaged[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachine] + :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') + } + 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.SqlVirtualMachinePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SqlVirtualMachinePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines'} + def get( self, resource_group_name, sql_virtual_machine_name, expand=None, custom_headers=None, raw=False, **operation_config): """Gets a SQL virtual machine. @@ -465,67 +529,3 @@ def internal_paging(next_link=None, raw=False): return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets all SQL virtual machines in a 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 SqlVirtualMachine - :rtype: - ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachinePaged[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachine] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.SqlVirtualMachinePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SqlVirtualMachinePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines'} diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/version.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/version.py index 9bd1dfac7ecb..3e682bbd5fb1 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/version.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.2.0" +VERSION = "0.3.0" diff --git a/sdk/sql/azure-mgmt-sqlvirtualmachine/setup.py b/sdk/sql/azure-mgmt-sqlvirtualmachine/setup.py index 3f4d10f6f2a1..2a25c71dac1f 100644 --- a/sdk/sql/azure-mgmt-sqlvirtualmachine/setup.py +++ b/sdk/sql/azure-mgmt-sqlvirtualmachine/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com', diff --git a/sdk/storage/azure-mgmt-storage/HISTORY.rst b/sdk/storage/azure-mgmt-storage/HISTORY.rst index 8da09f156843..d04b736a7d34 100644 --- a/sdk/storage/azure-mgmt-storage/HISTORY.rst +++ b/sdk/storage/azure-mgmt-storage/HISTORY.rst @@ -3,6 +3,38 @@ Release History =============== +4.0.0 (2019-06-12) +++++++++++++++++++ + +**Features** + +- Model StorageAccount has a new parameter azure_files_identity_based_authentication +- Model StorageAccountCreateParameters has a new parameter azure_files_identity_based_authentication +- Model StorageAccountUpdateParameters has a new parameter azure_files_identity_based_authentication + +**Breaking changes** + +- Model StorageAccount no longer has parameter enable_azure_files_aad_integration +- Model StorageAccountCreateParameters no longer has parameter enable_azure_files_aad_integration +- Model StorageAccountUpdateParameters no longer has parameter enable_azure_files_aad_integration + +**Breaking changes** + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes while using imports. +In summary, some modules were incorrectly visible/importable and have been renamed. This fixed several issues caused by usage of classes that were not supposed to be used in the first place. + +- StorageManagementClient cannot be imported from `azure.mgmt.storage.storage_management_client` anymore (import from `azure.mgmt.storage` works like before) +- StorageManagementClientConfiguration import has been moved from `azure.mgmt.storage.network_management_client` to `azure.mgmt.storage` +- StorageManagementClient cannot be imported from `azure.mgmt.storage.v20xx_yy_zz.network_management_client` anymore (import from `azure.mgmt.storage.v20xx_yy_zz` works like before) +- StorageManagementClientConfiguration import has been moved from `azure.mgmt.storage.v20xx_yy_zz.network_management_client` to `azure.mgmt.storage.v20xx_yy_zz` +- A model `MyClass` from a "models" sub-module cannot be imported anymore using `azure.mgmt.storage.v20xx_yy_zz.models.my_class` (import from `azure.mgmt.storage.v20xx_yy_zz.models` works like before) +- An operation class `MyClassOperations` from an `operations` sub-module cannot be imported anymore using `azure.mgmt.storage.v20xx_yy_zz.operations.my_class_operations` (import from `azure.mgmt.storage.v20xx_yy_zz.operations` works like before) + +Last but not least, HTTP connection pooling is now enabled by default. You should always use a client as a context manager, or call close(), or use no more than one storage mgmt client per process. + + 3.3.0 (2019-04-22) ++++++++++++++++++ diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/__init__.py index 65d9ded91f58..da2c3f969e67 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/__init__.py @@ -9,9 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient -from .version import VERSION +from ._configuration import StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] -__all__ = ['StorageManagementClient'] +from .version import VERSION __version__ = VERSION + diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_configuration.py new file mode 100644 index 000000000000..57fa5132dc82 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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 ID of the target subscription. + :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(StorageManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py new file mode 100644 index 000000000000..3db1f662464e --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py @@ -0,0 +1,333 @@ +# 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 azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin +from .version import VERSION +from ._configuration import StorageManagementClientConfiguration + + + +class StorageManagementClient(MultiApiClientMixin, SDKClient): + """The Azure Storage Management API. + + This ready contains multiple API versions, to help you deal with all Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, uses latest API version available on public Azure. + For production, you should stick a particular api-version and/or profile. + The profile sets a mapping between the operation group and an API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :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 profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles + """ + + DEFAULT_API_VERSION = '2019-04-01' + _PROFILE_TAG = "azure.mgmt.storage.StorageManagementClient" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { + 'usage': '2018-02-01', + None: DEFAULT_API_VERSION + }}, + _PROFILE_TAG + " latest" + ) + + def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, self).__init__( + credentials, + self.config, + api_version=api_version, + profile=profile + ) + + @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: + + * 2015-06-15: :mod:`v2015_06_15.models` + * 2016-01-01: :mod:`v2016_01_01.models` + * 2016-12-01: :mod:`v2016_12_01.models` + * 2017-06-01: :mod:`v2017_06_01.models` + * 2017-10-01: :mod:`v2017_10_01.models` + * 2018-02-01: :mod:`v2018_02_01.models` + * 2018-03-01-preview: :mod:`v2018_03_01_preview.models` + * 2018-07-01: :mod:`v2018_07_01.models` + * 2018-11-01: :mod:`v2018_11_01.models` + * 2019-04-01: :mod:`v2019_04_01.models` + """ + if api_version == '2015-06-15': + from .v2015_06_15 import models + return models + elif api_version == '2016-01-01': + from .v2016_01_01 import models + return models + elif api_version == '2016-12-01': + from .v2016_12_01 import models + return models + elif api_version == '2017-06-01': + from .v2017_06_01 import models + return models + elif api_version == '2017-10-01': + from .v2017_10_01 import models + return models + elif api_version == '2018-02-01': + from .v2018_02_01 import models + return models + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview import models + return models + elif api_version == '2018-07-01': + from .v2018_07_01 import models + return models + elif api_version == '2018-11-01': + from .v2018_11_01 import models + return models + elif api_version == '2019-04-01': + from .v2019_04_01 import models + return models + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + + @property + def blob_containers(self): + """Instance depends on the API version: + + * 2018-02-01: :class:`BlobContainersOperations` + * 2018-03-01-preview: :class:`BlobContainersOperations` + * 2018-07-01: :class:`BlobContainersOperations` + * 2018-11-01: :class:`BlobContainersOperations` + * 2019-04-01: :class:`BlobContainersOperations` + """ + api_version = self._get_api_version('blob_containers') + if api_version == '2018-02-01': + from .v2018_02_01.operations import BlobContainersOperations as OperationClass + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview.operations import BlobContainersOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import BlobContainersOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import BlobContainersOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import BlobContainersOperations 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 blob_services(self): + """Instance depends on the API version: + + * 2018-07-01: :class:`BlobServicesOperations` + * 2018-11-01: :class:`BlobServicesOperations` + * 2019-04-01: :class:`BlobServicesOperations` + """ + api_version = self._get_api_version('blob_services') + if api_version == '2018-07-01': + from .v2018_07_01.operations import BlobServicesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import BlobServicesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import BlobServicesOperations 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 management_policies(self): + """Instance depends on the API version: + + * 2018-07-01: :class:`ManagementPoliciesOperations` + * 2018-11-01: :class:`ManagementPoliciesOperations` + * 2019-04-01: :class:`ManagementPoliciesOperations` + """ + api_version = self._get_api_version('management_policies') + if api_version == '2018-07-01': + from .v2018_07_01.operations import ManagementPoliciesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ManagementPoliciesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ManagementPoliciesOperations 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): + """Instance depends on the API version: + + * 2017-06-01: :class:`Operations` + * 2017-10-01: :class:`Operations` + * 2018-02-01: :class:`Operations` + * 2018-03-01-preview: :class:`Operations` + * 2018-07-01: :class:`Operations` + * 2018-11-01: :class:`Operations` + * 2019-04-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2017-06-01': + from .v2017_06_01.operations import Operations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import Operations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import Operations as OperationClass + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview.operations import Operations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import Operations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import Operations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import Operations 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 skus(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`SkusOperations` + * 2017-10-01: :class:`SkusOperations` + * 2018-02-01: :class:`SkusOperations` + * 2018-03-01-preview: :class:`SkusOperations` + * 2018-07-01: :class:`SkusOperations` + * 2018-11-01: :class:`SkusOperations` + * 2019-04-01: :class:`SkusOperations` + """ + api_version = self._get_api_version('skus') + if api_version == '2017-06-01': + from .v2017_06_01.operations import SkusOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import SkusOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import SkusOperations as OperationClass + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview.operations import SkusOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import SkusOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import SkusOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import SkusOperations 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 storage_accounts(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`StorageAccountsOperations` + * 2016-01-01: :class:`StorageAccountsOperations` + * 2016-12-01: :class:`StorageAccountsOperations` + * 2017-06-01: :class:`StorageAccountsOperations` + * 2017-10-01: :class:`StorageAccountsOperations` + * 2018-02-01: :class:`StorageAccountsOperations` + * 2018-03-01-preview: :class:`StorageAccountsOperations` + * 2018-07-01: :class:`StorageAccountsOperations` + * 2018-11-01: :class:`StorageAccountsOperations` + * 2019-04-01: :class:`StorageAccountsOperations` + """ + api_version = self._get_api_version('storage_accounts') + if api_version == '2015-06-15': + from .v2015_06_15.operations import StorageAccountsOperations as OperationClass + elif api_version == '2016-01-01': + from .v2016_01_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview.operations import StorageAccountsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import StorageAccountsOperations 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 usage(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`UsageOperations` + * 2016-01-01: :class:`UsageOperations` + * 2016-12-01: :class:`UsageOperations` + * 2017-06-01: :class:`UsageOperations` + * 2017-10-01: :class:`UsageOperations` + * 2018-02-01: :class:`UsageOperations` + """ + api_version = self._get_api_version('usage') + if api_version == '2015-06-15': + from .v2015_06_15.operations import UsageOperations as OperationClass + elif api_version == '2016-01-01': + from .v2016_01_01.operations import UsageOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import UsageOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import UsageOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import UsageOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import UsageOperations 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 usages(self): + """Instance depends on the API version: + + * 2018-03-01-preview: :class:`UsagesOperations` + * 2018-07-01: :class:`UsagesOperations` + * 2018-11-01: :class:`UsagesOperations` + * 2019-04-01: :class:`UsagesOperations` + """ + api_version = self._get_api_version('usages') + if api_version == '2018-03-01-preview': + from .v2018_03_01_preview.operations import UsagesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import UsagesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import UsagesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import UsagesOperations 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))) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/models.py index 96c1d5c91c89..7e77a50bfd13 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/models.py @@ -1,7 +1,16 @@ -# coding=utf-8 +# 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. # -------------------------------------------------------------------------- -from .v2019_04_01.models import * \ No newline at end of file +from .v2015_06_15.models import * +from .v2016_01_01.models import * +from .v2016_12_01.models import * +from .v2017_06_01.models import * +from .v2017_10_01.models import * +from .v2018_02_01.models import * +from .v2018_03_01_preview.models import * +from .v2018_07_01.models import * +from .v2018_11_01.models import * +from .v2019_04_01.models import * diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py deleted file mode 100644 index 5e78bbb5ad4a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py +++ /dev/null @@ -1,367 +0,0 @@ -# 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 azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin -from .version import VERSION - - -class StorageManagementClientConfiguration(AzureConfiguration): - """Configuration for StorageManagementClient - 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: Gets subscription credentials which uniquely - identify the Microsoft Azure subscription. The subscription ID forms part - of the URI for every service call. - :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(StorageManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class StorageManagementClient(MultiApiClientMixin, SDKClient): - """The Azure Storage Management API. - - This ready contains multiple API versions, to help you deal with all Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, uses latest API version available on public Azure. - For production, you should stick a particular api-version and/or profile. - The profile sets a mapping between the operation group and an API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. - - :ivar config: Configuration for client. - :vartype config: StorageManagementClientConfiguration - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - Microsoft Azure subscription. The subscription ID forms part of the URI - for every service call. - :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 profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles - """ - - DEFAULT_API_VERSION='2019-04-01' - _PROFILE_TAG = "azure.mgmt.storage.StorageManagementClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION - }}, - _PROFILE_TAG + " latest" - ) - - def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): - self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - super(StorageManagementClient, self).__init__( - credentials, - self.config, - api_version=api_version, - profile=profile - ) - -############ 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: - - * 2015-06-15: :mod:`v2015_06_15.models` - * 2016-01-01: :mod:`v2016_01_01.models` - * 2016-12-01: :mod:`v2016_12_01.models` - * 2017-06-01: :mod:`v2017_06_01.models` - * 2017-10-01: :mod:`v2017_10_01.models` - * 2018-02-01: :mod:`v2018_02_01.models` - * 2018-03-01-preview: :mod:`v2018_03_01_preview.models` - * 2018-07-01: :mod:`v2018_07_01.models` - * 2018-11-01: :mod:`v2018_11_01.models` - * 2019-04-01: :mod:`v2019_04_01.models` - """ - if api_version == '2015-06-15': - from .v2015_06_15 import models - return models - elif api_version == '2016-01-01': - from .v2016_01_01 import models - return models - elif api_version == '2016-12-01': - from .v2016_12_01 import models - return models - elif api_version == '2017-06-01': - from .v2017_06_01 import models - return models - elif api_version == '2017-10-01': - from .v2017_10_01 import models - return models - elif api_version == '2018-02-01': - from .v2018_02_01 import models - return models - elif api_version == '2018-03-01-preview': - from .v2018_03_01_preview import models - return models - elif api_version == '2018-07-01': - from .v2018_07_01 import models - return models - elif api_version == '2018-11-01': - from .v2018_11_01 import models - return models - elif api_version == '2019-04-01': - from .v2019_04_01 import models - return models - raise NotImplementedError("APIVersion {} is not available".format(api_version)) - - @property - def blob_containers(self): - """Instance depends on the API version: - - * 2018-02-01: :class:`BlobContainersOperations` - * 2018-03-01-preview: :class:`BlobContainersOperations` - * 2018-07-01: :class:`BlobContainersOperations` - * 2018-11-01: :class:`BlobContainersOperations` - * 2019-04-01: :class:`BlobContainersOperations` - """ - api_version = self._get_api_version('blob_containers') - if api_version == '2018-02-01': - from .v2018_02_01.operations import BlobContainersOperations as OperationClass - elif api_version == '2018-03-01-preview': - from .v2018_03_01_preview.operations import BlobContainersOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import BlobContainersOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import BlobContainersOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import BlobContainersOperations 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 blob_services(self): - """Instance depends on the API version: - - * 2018-07-01: :class:`BlobServicesOperations` - * 2018-11-01: :class:`BlobServicesOperations` - * 2019-04-01: :class:`BlobServicesOperations` - """ - api_version = self._get_api_version('blob_services') - if api_version == '2018-07-01': - from .v2018_07_01.operations import BlobServicesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import BlobServicesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import BlobServicesOperations 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 management_policies(self): - """Instance depends on the API version: - - * 2018-07-01: :class:`ManagementPoliciesOperations` - * 2018-11-01: :class:`ManagementPoliciesOperations` - * 2019-04-01: :class:`ManagementPoliciesOperations` - """ - api_version = self._get_api_version('management_policies') - if api_version == '2018-07-01': - from .v2018_07_01.operations import ManagementPoliciesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ManagementPoliciesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ManagementPoliciesOperations 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): - """Instance depends on the API version: - - * 2017-06-01: :class:`Operations` - * 2017-10-01: :class:`Operations` - * 2018-02-01: :class:`Operations` - * 2018-03-01-preview: :class:`Operations` - * 2018-07-01: :class:`Operations` - * 2018-11-01: :class:`Operations` - * 2019-04-01: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2017-06-01': - from .v2017_06_01.operations import Operations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import Operations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import Operations as OperationClass - elif api_version == '2018-03-01-preview': - from .v2018_03_01_preview.operations import Operations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import Operations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import Operations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import Operations 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 skus(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`SkusOperations` - * 2017-10-01: :class:`SkusOperations` - * 2018-02-01: :class:`SkusOperations` - * 2018-03-01-preview: :class:`SkusOperations` - * 2018-07-01: :class:`SkusOperations` - * 2018-11-01: :class:`SkusOperations` - * 2019-04-01: :class:`SkusOperations` - """ - api_version = self._get_api_version('skus') - if api_version == '2017-06-01': - from .v2017_06_01.operations import SkusOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import SkusOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import SkusOperations as OperationClass - elif api_version == '2018-03-01-preview': - from .v2018_03_01_preview.operations import SkusOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import SkusOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import SkusOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import SkusOperations 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 storage_accounts(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`StorageAccountsOperations` - * 2016-01-01: :class:`StorageAccountsOperations` - * 2016-12-01: :class:`StorageAccountsOperations` - * 2017-06-01: :class:`StorageAccountsOperations` - * 2017-10-01: :class:`StorageAccountsOperations` - * 2018-02-01: :class:`StorageAccountsOperations` - * 2018-03-01-preview: :class:`StorageAccountsOperations` - * 2018-07-01: :class:`StorageAccountsOperations` - * 2018-11-01: :class:`StorageAccountsOperations` - * 2019-04-01: :class:`StorageAccountsOperations` - """ - api_version = self._get_api_version('storage_accounts') - if api_version == '2015-06-15': - from .v2015_06_15.operations import StorageAccountsOperations as OperationClass - elif api_version == '2016-01-01': - from .v2016_01_01.operations import StorageAccountsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import StorageAccountsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import StorageAccountsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import StorageAccountsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import StorageAccountsOperations as OperationClass - elif api_version == '2018-03-01-preview': - from .v2018_03_01_preview.operations import StorageAccountsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import StorageAccountsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import StorageAccountsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import StorageAccountsOperations 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 usage(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`UsageOperations` - * 2016-01-01: :class:`UsageOperations` - * 2016-12-01: :class:`UsageOperations` - * 2017-06-01: :class:`UsageOperations` - * 2017-10-01: :class:`UsageOperations` - * 2018-02-01: :class:`UsageOperations` - """ - api_version = self._get_api_version('usage') - if api_version == '2015-06-15': - from .v2015_06_15.operations import UsageOperations as OperationClass - elif api_version == '2016-01-01': - from .v2016_01_01.operations import UsageOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import UsageOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import UsageOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import UsageOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import UsageOperations 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 usages(self): - """Instance depends on the API version: - - * 2018-03-01-preview: :class:`UsagesOperations` - * 2018-07-01: :class:`UsagesOperations` - * 2018-11-01: :class:`UsagesOperations` - * 2019-04-01: :class:`UsagesOperations` - """ - api_version = self._get_api_version('usages') - if api_version == '2018-03-01-preview': - from .v2018_03_01_preview.operations import UsagesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import UsagesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import UsagesOperations 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))) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/__init__.py index 0854715e0c10..da2c3f969e67 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient -from .version import VERSION +from ._configuration import StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] -__all__ = ['StorageManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_configuration.py new file mode 100644 index 000000000000..43e998d6c7b9 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_configuration.py @@ -0,0 +1,50 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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: Subscription credentials which uniquely identify + the Microsoft Azure subscription. The subscription ID forms part of the + URI for every service call. + :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(StorageManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_storage_management_client.py new file mode 100644 index 000000000000..7c7c379b8e4d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_storage_management_client.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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import StorageManagementClientConfiguration +from .operations import StorageAccountsOperations +from .operations import UsageOperations +from . import models + + +class StorageManagementClient(SDKClient): + """The Azure Storage Management API. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2015_06_15.operations.StorageAccountsOperations + :ivar usage: Usage operations + :vartype usage: azure.mgmt.storage.v2015_06_15.operations.UsageOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + the Microsoft Azure subscription. The subscription ID forms part of the + URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, 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 = '2015-06-15' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/__init__.py index c3427e9e6690..36d639338f53 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/__init__.py @@ -10,34 +10,34 @@ # -------------------------------------------------------------------------- try: - from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters - from .check_name_availability_result_py3 import CheckNameAvailabilityResult - from .storage_account_create_parameters_py3 import StorageAccountCreateParameters - from .endpoints_py3 import Endpoints - from .custom_domain_py3 import CustomDomain - from .storage_account_py3 import StorageAccount - from .storage_account_keys_py3 import StorageAccountKeys - from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters - from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters - from .usage_name_py3 import UsageName - from .usage_py3 import Usage - from .resource_py3 import Resource + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CustomDomain + from ._models_py3 import Endpoints + from ._models_py3 import Resource + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountKeys + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import Usage + from ._models_py3 import UsageName except (SyntaxError, ImportError): - from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters - from .check_name_availability_result import CheckNameAvailabilityResult - from .storage_account_create_parameters import StorageAccountCreateParameters - from .endpoints import Endpoints - from .custom_domain import CustomDomain - from .storage_account import StorageAccount - from .storage_account_keys import StorageAccountKeys - from .storage_account_update_parameters import StorageAccountUpdateParameters - from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters - from .usage_name import UsageName - from .usage import Usage - from .resource import Resource -from .storage_account_paged import StorageAccountPaged -from .usage_paged import UsagePaged -from .storage_management_client_enums import ( + from ._models import CheckNameAvailabilityResult + from ._models import CustomDomain + from ._models import Endpoints + from ._models import Resource + from ._models import StorageAccount + from ._models import StorageAccountCheckNameAvailabilityParameters + from ._models import StorageAccountCreateParameters + from ._models import StorageAccountKeys + from ._models import StorageAccountRegenerateKeyParameters + from ._models import StorageAccountUpdateParameters + from ._models import Usage + from ._models import UsageName +from ._paged_models import StorageAccountPaged +from ._paged_models import UsagePaged +from ._storage_management_client_enums import ( Reason, AccountType, ProvisioningState, @@ -46,18 +46,18 @@ ) __all__ = [ - 'StorageAccountCheckNameAvailabilityParameters', 'CheckNameAvailabilityResult', - 'StorageAccountCreateParameters', - 'Endpoints', 'CustomDomain', + 'Endpoints', + 'Resource', 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', 'StorageAccountKeys', - 'StorageAccountUpdateParameters', 'StorageAccountRegenerateKeyParameters', - 'UsageName', + 'StorageAccountUpdateParameters', 'Usage', - 'Resource', + 'UsageName', 'StorageAccountPaged', 'UsagePaged', 'Reason', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/_models.py new file mode 100644 index 000000000000..23f717b4ecd0 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/_models.py @@ -0,0 +1,458 @@ +# 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 CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + :param name_available: Boolean value that indicates whether the name is + available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :type name_available: bool + :param reason: The reason that a storage account name could not be used. + The Reason element is only returned if NameAvailable is false. Possible + values include: 'AccountNameInvalid', 'AlreadyExists' + :type reason: str or ~azure.mgmt.storage.v2015_06_15.models.Reason + :param message: The error message explaining the Reason value in more + detail. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The custom domain name. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue or + table object. + + :param blob: The blob endpoint. + :type blob: str + :param queue: The queue endpoint. + :type queue: str + :param table: The table endpoint. + :type table: str + :param file: The file endpoint. + :type file: str + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.queue = kwargs.get('queue', None) + self.table = kwargs.get('table', None) + self.file = kwargs.get('file', None) + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, 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'}, + '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) + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param provisioning_state: The status of the storage account at the time + the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :type provisioning_state: str or + ~azure.mgmt.storage.v2015_06_15.models.ProvisioningState + :param account_type: The type of the storage account. Possible values + include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', + 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountType + :param primary_endpoints: The URLs that are used to perform a retrieval of + a public blob, queue, or table object. Note that Standard_ZRS and + Premium_LRS accounts only return the blob endpoint. + :type primary_endpoints: ~azure.mgmt.storage.v2015_06_15.models.Endpoints + :param primary_location: The location of the primary data center for the + storage account. + :type primary_location: str + :param status_of_primary: The status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'Available', 'Unavailable' + :type status_of_primary: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountStatus + :param last_geo_failover_time: The timestamp of the most recent instance + of a failover to the secondary location. Only the most recent timestamp is + retained. This element is not returned if there has never been a failover + instance. Only available if the accountType is Standard_GRS or + Standard_RAGRS. + :type last_geo_failover_time: datetime + :param secondary_location: The location of the geo-replicated secondary + for the storage account. Only available if the accountType is Standard_GRS + or Standard_RAGRS. + :type secondary_location: str + :param status_of_secondary: The status indicating whether the secondary + location of the storage account is available or unavailable. Only + available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'Available', 'Unavailable' + :type status_of_secondary: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountStatus + :param creation_time: The creation date and time of the storage account in + UTC. + :type creation_time: datetime + :param custom_domain: The custom domain the user assigned to this storage + account. + :type custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain + :param secondary_endpoints: The URLs that are used to perform a retrieval + of a public blob, queue, or table object from the secondary location of + the storage account. Only available if the SKU name is Standard_RAGRS. + :type secondary_endpoints: + ~azure.mgmt.storage.v2015_06_15.models.Endpoints + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.account_type = kwargs.get('account_type', None) + self.primary_endpoints = kwargs.get('primary_endpoints', None) + self.primary_location = kwargs.get('primary_location', None) + self.status_of_primary = kwargs.get('status_of_primary', None) + self.last_geo_failover_time = kwargs.get('last_geo_failover_time', None) + self.secondary_location = kwargs.get('secondary_location', None) + self.status_of_secondary = kwargs.get('status_of_secondary', None) + self.creation_time = kwargs.get('creation_time', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.secondary_endpoints = kwargs.get('secondary_endpoints', None) + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param type: Default value: "Microsoft.Storage/storageAccounts" . + :type type: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', "Microsoft.Storage/storageAccounts") + + +class StorageAccountCreateParameters(Model): + """The parameters to provide for the account. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. This will be one + of the supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). The geo region of a resource cannot be changed once + it is created, but if an identical geo region is specified on update, the + request will succeed. + :type location: str + :param tags: A list of key value pairs that describe the resource. These + tags can be used for viewing and grouping this resource (across resource + groups). A maximum of 15 tags can be provided for a resource. Each tag + must have a key with a length no greater than 128 characters and a value + with a length no greater than 256 characters. + :type tags: dict[str, str] + :param account_type: Required. The sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountType + """ + + _validation = { + 'location': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.account_type = kwargs.get('account_type', None) + + +class StorageAccountKeys(Model): + """The access keys for the storage account. + + :param key1: The value of key 1. + :type key1: str + :param key2: The value of key 2. + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKeys, self).__init__(**kwargs) + self.key1 = kwargs.get('key1', None) + self.key2 = kwargs.get('key2', None) + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class StorageAccountUpdateParameters(Model): + """The parameters to update on the account. + + :param tags: Resource tags + :type tags: dict[str, str] + :param account_type: The account type. Note that StandardZRS and + PremiumLRS accounts cannot be changed to other account types, and other + account types cannot be changed to StandardZRS or PremiumLRS. Possible + values include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', + 'Standard_RAGRS', 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountType + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.account_type = kwargs.get('account_type', None) + self.custom_domain = kwargs.get('custom_domain', None) + + +class Usage(Model): + """Describes Storage Resource Usage. + + All required parameters must be populated in order to send to Azure. + + :param unit: Required. The unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :type unit: str or ~azure.mgmt.storage.v2015_06_15.models.UsageUnit + :param current_value: Required. The current count of the allocated + resources in the subscription. + :type current_value: int + :param limit: Required. The maximum count of the resources that can be + allocated in the subscription. + :type limit: int + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.storage.v2015_06_15.models.UsageName + """ + + _validation = { + 'unit': {'required': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = kwargs.get('unit', None) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) + + +class UsageName(Model): + """The Usage Names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/_models_py3.py new file mode 100644 index 000000000000..31ef7d066179 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/_models_py3.py @@ -0,0 +1,458 @@ +# 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 CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + :param name_available: Boolean value that indicates whether the name is + available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :type name_available: bool + :param reason: The reason that a storage account name could not be used. + The Reason element is only returned if NameAvailable is false. Possible + values include: 'AccountNameInvalid', 'AlreadyExists' + :type reason: str or ~azure.mgmt.storage.v2015_06_15.models.Reason + :param message: The error message explaining the Reason value in more + detail. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason=None, message: str=None, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The custom domain name. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue or + table object. + + :param blob: The blob endpoint. + :type blob: str + :param queue: The queue endpoint. + :type queue: str + :param table: The table endpoint. + :type table: str + :param file: The file endpoint. + :type file: str + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, *, blob: str=None, queue: str=None, table: str=None, file: str=None, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = blob + self.queue = queue + self.table = table + self.file = file + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param provisioning_state: The status of the storage account at the time + the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :type provisioning_state: str or + ~azure.mgmt.storage.v2015_06_15.models.ProvisioningState + :param account_type: The type of the storage account. Possible values + include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', + 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountType + :param primary_endpoints: The URLs that are used to perform a retrieval of + a public blob, queue, or table object. Note that Standard_ZRS and + Premium_LRS accounts only return the blob endpoint. + :type primary_endpoints: ~azure.mgmt.storage.v2015_06_15.models.Endpoints + :param primary_location: The location of the primary data center for the + storage account. + :type primary_location: str + :param status_of_primary: The status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'Available', 'Unavailable' + :type status_of_primary: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountStatus + :param last_geo_failover_time: The timestamp of the most recent instance + of a failover to the secondary location. Only the most recent timestamp is + retained. This element is not returned if there has never been a failover + instance. Only available if the accountType is Standard_GRS or + Standard_RAGRS. + :type last_geo_failover_time: datetime + :param secondary_location: The location of the geo-replicated secondary + for the storage account. Only available if the accountType is Standard_GRS + or Standard_RAGRS. + :type secondary_location: str + :param status_of_secondary: The status indicating whether the secondary + location of the storage account is available or unavailable. Only + available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'Available', 'Unavailable' + :type status_of_secondary: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountStatus + :param creation_time: The creation date and time of the storage account in + UTC. + :type creation_time: datetime + :param custom_domain: The custom domain the user assigned to this storage + account. + :type custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain + :param secondary_endpoints: The URLs that are used to perform a retrieval + of a public blob, queue, or table object from the secondary location of + the storage account. Only available if the SKU name is Standard_RAGRS. + :type secondary_endpoints: + ~azure.mgmt.storage.v2015_06_15.models.Endpoints + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + } + + def __init__(self, *, location: str=None, tags=None, provisioning_state=None, account_type=None, primary_endpoints=None, primary_location: str=None, status_of_primary=None, last_geo_failover_time=None, secondary_location: str=None, status_of_secondary=None, creation_time=None, custom_domain=None, secondary_endpoints=None, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.account_type = account_type + self.primary_endpoints = primary_endpoints + self.primary_location = primary_location + self.status_of_primary = status_of_primary + self.last_geo_failover_time = last_geo_failover_time + self.secondary_location = secondary_location + self.status_of_secondary = status_of_secondary + self.creation_time = creation_time + self.custom_domain = custom_domain + self.secondary_endpoints = secondary_endpoints + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param type: Default value: "Microsoft.Storage/storageAccounts" . + :type type: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str, type: str="Microsoft.Storage/storageAccounts", **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + self.type = type + + +class StorageAccountCreateParameters(Model): + """The parameters to provide for the account. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. This will be one + of the supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). The geo region of a resource cannot be changed once + it is created, but if an identical geo region is specified on update, the + request will succeed. + :type location: str + :param tags: A list of key value pairs that describe the resource. These + tags can be used for viewing and grouping this resource (across resource + groups). A maximum of 15 tags can be provided for a resource. Each tag + must have a key with a length no greater than 128 characters and a value + with a length no greater than 256 characters. + :type tags: dict[str, str] + :param account_type: Required. The sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountType + """ + + _validation = { + 'location': {'required': True}, + 'account_type': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, + } + + def __init__(self, *, location: str, account_type, tags=None, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.account_type = account_type + + +class StorageAccountKeys(Model): + """The access keys for the storage account. + + :param key1: The value of key 1. + :type key1: str + :param key2: The value of key 2. + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: + super(StorageAccountKeys, self).__init__(**kwargs) + self.key1 = key1 + self.key2 = key2 + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(Model): + """The parameters to update on the account. + + :param tags: Resource tags + :type tags: dict[str, str] + :param account_type: The account type. Note that StandardZRS and + PremiumLRS accounts cannot be changed to other account types, and other + account types cannot be changed to StandardZRS or PremiumLRS. Possible + values include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', + 'Standard_RAGRS', 'Premium_LRS' + :type account_type: str or + ~azure.mgmt.storage.v2015_06_15.models.AccountType + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + } + + def __init__(self, *, tags=None, account_type=None, custom_domain=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.account_type = account_type + self.custom_domain = custom_domain + + +class Usage(Model): + """Describes Storage Resource Usage. + + All required parameters must be populated in order to send to Azure. + + :param unit: Required. The unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :type unit: str or ~azure.mgmt.storage.v2015_06_15.models.UsageUnit + :param current_value: Required. The current count of the allocated + resources in the subscription. + :type current_value: int + :param limit: Required. The maximum count of the resources that can be + allocated in the subscription. + :type limit: int + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.storage.v2015_06_15.models.UsageName + """ + + _validation = { + 'unit': {'required': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, *, unit, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = unit + self.current_value = current_value + self.limit = limit + self.name = name + + +class UsageName(Model): + """The Usage Names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/_paged_models.py new file mode 100644 index 000000000000..b6a43b9a4a77 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/_paged_models.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.paging import Paged + + +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/_storage_management_client_enums.py similarity index 100% rename from sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_management_client_enums.py rename to sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/_storage_management_client_enums.py diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result.py deleted file mode 100644 index 1548dba81ccc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - :param name_available: Boolean value that indicates whether the name is - available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :type name_available: bool - :param reason: The reason that a storage account name could not be used. - The Reason element is only returned if NameAvailable is false. Possible - values include: 'AccountNameInvalid', 'AlreadyExists' - :type reason: str or ~azure.mgmt.storage.v2015_06_15.models.Reason - :param message: The error message explaining the Reason value in more - detail. - :type message: str - """ - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResult, 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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result_py3.py deleted file mode 100644 index 807be8e571c9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/check_name_availability_result_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - :param name_available: Boolean value that indicates whether the name is - available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :type name_available: bool - :param reason: The reason that a storage account name could not be used. - The Reason element is only returned if NameAvailable is false. Possible - values include: 'AccountNameInvalid', 'AlreadyExists' - :type reason: str or ~azure.mgmt.storage.v2015_06_15.models.Reason - :param message: The error message explaining the Reason value in more - detail. - :type message: str - """ - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, name_available: bool=None, reason=None, message: str=None, **kwargs) -> None: - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = name_available - self.reason = reason - self.message = message diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain.py deleted file mode 100644 index afcb1da852e8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The custom domain name. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(CustomDomain, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain_py3.py deleted file mode 100644 index c3e61f459265..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/custom_domain_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The custom domain name. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: - super(CustomDomain, self).__init__(**kwargs) - self.name = name - self.use_sub_domain_name = use_sub_domain_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints.py deleted file mode 100644 index a79d2687f891..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue or - table object. - - :param blob: The blob endpoint. - :type blob: str - :param queue: The queue endpoint. - :type queue: str - :param table: The table endpoint. - :type table: str - :param file: The file endpoint. - :type file: str - """ - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Endpoints, self).__init__(**kwargs) - self.blob = kwargs.get('blob', None) - self.queue = kwargs.get('queue', None) - self.table = kwargs.get('table', None) - self.file = kwargs.get('file', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints_py3.py deleted file mode 100644 index f05bb4b0aec3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/endpoints_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue or - table object. - - :param blob: The blob endpoint. - :type blob: str - :param queue: The queue endpoint. - :type queue: str - :param table: The table endpoint. - :type table: str - :param file: The file endpoint. - :type file: str - """ - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__(self, *, blob: str=None, queue: str=None, table: str=None, file: str=None, **kwargs) -> None: - super(Endpoints, self).__init__(**kwargs) - self.blob = blob - self.queue = queue - self.table = table - self.file = file diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource.py deleted file mode 100644 index 00300c71662b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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): - """Describes a storage resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, 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'}, - '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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource_py3.py deleted file mode 100644 index bcd12774c0c9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/resource_py3.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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): - """Describes a storage resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, 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'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, location: str=None, 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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account.py deleted file mode 100644 index 93989a1a1871..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 StorageAccount(Resource): - """The storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param provisioning_state: The status of the storage account at the time - the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :type provisioning_state: str or - ~azure.mgmt.storage.v2015_06_15.models.ProvisioningState - :param account_type: The type of the storage account. Possible values - include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', - 'Premium_LRS' - :type account_type: str or - ~azure.mgmt.storage.v2015_06_15.models.AccountType - :param primary_endpoints: The URLs that are used to perform a retrieval of - a public blob, queue, or table object. Note that Standard_ZRS and - Premium_LRS accounts only return the blob endpoint. - :type primary_endpoints: ~azure.mgmt.storage.v2015_06_15.models.Endpoints - :param primary_location: The location of the primary data center for the - storage account. - :type primary_location: str - :param status_of_primary: The status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'Available', 'Unavailable' - :type status_of_primary: str or - ~azure.mgmt.storage.v2015_06_15.models.AccountStatus - :param last_geo_failover_time: The timestamp of the most recent instance - of a failover to the secondary location. Only the most recent timestamp is - retained. This element is not returned if there has never been a failover - instance. Only available if the accountType is Standard_GRS or - Standard_RAGRS. - :type last_geo_failover_time: datetime - :param secondary_location: The location of the geo-replicated secondary - for the storage account. Only available if the accountType is Standard_GRS - or Standard_RAGRS. - :type secondary_location: str - :param status_of_secondary: The status indicating whether the secondary - location of the storage account is available or unavailable. Only - available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'Available', 'Unavailable' - :type status_of_secondary: str or - ~azure.mgmt.storage.v2015_06_15.models.AccountStatus - :param creation_time: The creation date and time of the storage account in - UTC. - :type creation_time: datetime - :param custom_domain: The custom domain the user assigned to this storage - account. - :type custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain - :param secondary_endpoints: The URLs that are used to perform a retrieval - of a public blob, queue, or table object from the secondary location of - the storage account. Only available if the SKU name is Standard_RAGRS. - :type secondary_endpoints: - ~azure.mgmt.storage.v2015_06_15.models.Endpoints - """ - - _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'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - } - - def __init__(self, **kwargs): - super(StorageAccount, self).__init__(**kwargs) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.account_type = kwargs.get('account_type', None) - self.primary_endpoints = kwargs.get('primary_endpoints', None) - self.primary_location = kwargs.get('primary_location', None) - self.status_of_primary = kwargs.get('status_of_primary', None) - self.last_geo_failover_time = kwargs.get('last_geo_failover_time', None) - self.secondary_location = kwargs.get('secondary_location', None) - self.status_of_secondary = kwargs.get('status_of_secondary', None) - self.creation_time = kwargs.get('creation_time', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.secondary_endpoints = kwargs.get('secondary_endpoints', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters.py deleted file mode 100644 index 82b38b81b3d8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. - :type name: str - :param type: Default value: "Microsoft.Storage/storageAccounts" . - :type type: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', "Microsoft.Storage/storageAccounts") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters_py3.py deleted file mode 100644 index b63ecec997f4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_check_name_availability_parameters_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. - :type name: str - :param type: Default value: "Microsoft.Storage/storageAccounts" . - :type type: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, *, name: str, type: str="Microsoft.Storage/storageAccounts", **kwargs) -> None: - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = name - self.type = type diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters.py deleted file mode 100644 index 852d51b76294..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters to provide for the account. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one - of the supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). The geo region of a resource cannot be changed once - it is created, but if an identical geo region is specified on update, the - request will succeed. - :type location: str - :param tags: A list of key value pairs that describe the resource. These - tags can be used for viewing and grouping this resource (across resource - groups). A maximum of 15 tags can be provided for a resource. Each tag - must have a key with a length no greater than 128 characters and a value - with a length no greater than 256 characters. - :type tags: dict[str, str] - :param account_type: Required. The sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', 'Premium_LRS' - :type account_type: str or - ~azure.mgmt.storage.v2015_06_15.models.AccountType - """ - - _validation = { - 'location': {'required': True}, - 'account_type': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, - } - - def __init__(self, **kwargs): - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.account_type = kwargs.get('account_type', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters_py3.py deleted file mode 100644 index e90af5ec5564..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_create_parameters_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters to provide for the account. - - All required parameters must be populated in order to send to Azure. - - :param location: Required. The location of the resource. This will be one - of the supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). The geo region of a resource cannot be changed once - it is created, but if an identical geo region is specified on update, the - request will succeed. - :type location: str - :param tags: A list of key value pairs that describe the resource. These - tags can be used for viewing and grouping this resource (across resource - groups). A maximum of 15 tags can be provided for a resource. Each tag - must have a key with a length no greater than 128 characters and a value - with a length no greater than 256 characters. - :type tags: dict[str, str] - :param account_type: Required. The sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', 'Premium_LRS' - :type account_type: str or - ~azure.mgmt.storage.v2015_06_15.models.AccountType - """ - - _validation = { - 'location': {'required': True}, - 'account_type': {'required': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, - } - - def __init__(self, *, location: str, account_type, tags=None, **kwargs) -> None: - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.location = location - self.tags = tags - self.account_type = account_type diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys.py deleted file mode 100644 index 8bf214b2625a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 StorageAccountKeys(Model): - """The access keys for the storage account. - - :param key1: The value of key 1. - :type key1: str - :param key2: The value of key 2. - :type key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountKeys, self).__init__(**kwargs) - self.key1 = kwargs.get('key1', None) - self.key2 = kwargs.get('key2', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys_py3.py deleted file mode 100644 index 34d336be577d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_keys_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 StorageAccountKeys(Model): - """The access keys for the storage account. - - :param key1: The value of key 1. - :type key1: str - :param key2: The value of key 2. - :type key2: str - """ - - _attribute_map = { - 'key1': {'key': 'key1', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - } - - def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: - super(StorageAccountKeys, self).__init__(**kwargs) - self.key1 = key1 - self.key2 = key2 diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_paged.py deleted file mode 100644 index 8acca12f90b6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 StorageAccountPaged(Paged): - """ - A paging container for iterating over a list of :class:`StorageAccount ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[StorageAccount]'} - } - - def __init__(self, *args, **kwargs): - - super(StorageAccountPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_py3.py deleted file mode 100644 index d4e2d6a59ab7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_py3.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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_py3 import Resource - - -class StorageAccount(Resource): - """The storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param provisioning_state: The status of the storage account at the time - the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :type provisioning_state: str or - ~azure.mgmt.storage.v2015_06_15.models.ProvisioningState - :param account_type: The type of the storage account. Possible values - include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', 'Standard_RAGRS', - 'Premium_LRS' - :type account_type: str or - ~azure.mgmt.storage.v2015_06_15.models.AccountType - :param primary_endpoints: The URLs that are used to perform a retrieval of - a public blob, queue, or table object. Note that Standard_ZRS and - Premium_LRS accounts only return the blob endpoint. - :type primary_endpoints: ~azure.mgmt.storage.v2015_06_15.models.Endpoints - :param primary_location: The location of the primary data center for the - storage account. - :type primary_location: str - :param status_of_primary: The status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'Available', 'Unavailable' - :type status_of_primary: str or - ~azure.mgmt.storage.v2015_06_15.models.AccountStatus - :param last_geo_failover_time: The timestamp of the most recent instance - of a failover to the secondary location. Only the most recent timestamp is - retained. This element is not returned if there has never been a failover - instance. Only available if the accountType is Standard_GRS or - Standard_RAGRS. - :type last_geo_failover_time: datetime - :param secondary_location: The location of the geo-replicated secondary - for the storage account. Only available if the accountType is Standard_GRS - or Standard_RAGRS. - :type secondary_location: str - :param status_of_secondary: The status indicating whether the secondary - location of the storage account is available or unavailable. Only - available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'Available', 'Unavailable' - :type status_of_secondary: str or - ~azure.mgmt.storage.v2015_06_15.models.AccountStatus - :param creation_time: The creation date and time of the storage account in - UTC. - :type creation_time: datetime - :param custom_domain: The custom domain the user assigned to this storage - account. - :type custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain - :param secondary_endpoints: The URLs that are used to perform a retrieval - of a public blob, queue, or table object from the secondary location of - the storage account. Only available if the SKU name is Standard_RAGRS. - :type secondary_endpoints: - ~azure.mgmt.storage.v2015_06_15.models.Endpoints - """ - - _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'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - } - - def __init__(self, *, location: str=None, tags=None, provisioning_state=None, account_type=None, primary_endpoints=None, primary_location: str=None, status_of_primary=None, last_geo_failover_time=None, secondary_location: str=None, status_of_secondary=None, creation_time=None, custom_domain=None, secondary_endpoints=None, **kwargs) -> None: - super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) - self.provisioning_state = provisioning_state - self.account_type = account_type - self.primary_endpoints = primary_endpoints - self.primary_location = primary_location - self.status_of_primary = status_of_primary - self.last_geo_failover_time = last_geo_failover_time - self.secondary_location = secondary_location - self.status_of_secondary = status_of_secondary - self.creation_time = creation_time - self.custom_domain = custom_domain - self.secondary_endpoints = secondary_endpoints diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters.py deleted file mode 100644 index 2c7a28c67fcb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters_py3.py deleted file mode 100644 index 7db8cb2a22c8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_regenerate_key_parameters_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = key_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters.py deleted file mode 100644 index fe75ca2c19d7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters to update on the account. - - :param tags: Resource tags - :type tags: dict[str, str] - :param account_type: The account type. Note that StandardZRS and - PremiumLRS accounts cannot be changed to other account types, and other - account types cannot be changed to StandardZRS or PremiumLRS. Possible - values include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', - 'Standard_RAGRS', 'Premium_LRS' - :type account_type: str or - ~azure.mgmt.storage.v2015_06_15.models.AccountType - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - } - - def __init__(self, **kwargs): - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.account_type = kwargs.get('account_type', None) - self.custom_domain = kwargs.get('custom_domain', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters_py3.py deleted file mode 100644 index 209bbe72a289..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/storage_account_update_parameters_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters to update on the account. - - :param tags: Resource tags - :type tags: dict[str, str] - :param account_type: The account type. Note that StandardZRS and - PremiumLRS accounts cannot be changed to other account types, and other - account types cannot be changed to StandardZRS or PremiumLRS. Possible - values include: 'Standard_LRS', 'Standard_ZRS', 'Standard_GRS', - 'Standard_RAGRS', 'Premium_LRS' - :type account_type: str or - ~azure.mgmt.storage.v2015_06_15.models.AccountType - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'account_type': {'key': 'properties.accountType', 'type': 'AccountType'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - } - - def __init__(self, *, tags=None, account_type=None, custom_domain=None, **kwargs) -> None: - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.account_type = account_type - self.custom_domain = custom_domain diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage.py deleted file mode 100644 index ccf7c87a712a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - All required parameters must be populated in order to send to Azure. - - :param unit: Required. The unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :type unit: str or ~azure.mgmt.storage.v2015_06_15.models.UsageUnit - :param current_value: Required. The current count of the allocated - resources in the subscription. - :type current_value: int - :param limit: Required. The maximum count of the resources that can be - allocated in the subscription. - :type limit: int - :param name: Required. The name of the type of usage. - :type name: ~azure.mgmt.storage.v2015_06_15.models.UsageName - """ - - _validation = { - 'unit': {'required': True}, - 'current_value': {'required': True}, - 'limit': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs): - super(Usage, self).__init__(**kwargs) - self.unit = kwargs.get('unit', None) - self.current_value = kwargs.get('current_value', None) - self.limit = kwargs.get('limit', None) - self.name = kwargs.get('name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name.py deleted file mode 100644 index 1c1c30fcd44f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 UsageName(Model): - """The Usage Names. - - :param value: A string describing the resource name. - :type value: str - :param localized_value: A localized string describing the resource name. - :type localized_value: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageName, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.localized_value = kwargs.get('localized_value', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name_py3.py deleted file mode 100644 index f6177205032b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_name_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 UsageName(Model): - """The Usage Names. - - :param value: A string describing the resource name. - :type value: str - :param localized_value: A localized string describing the resource name. - :type localized_value: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: - super(UsageName, self).__init__(**kwargs) - self.value = value - self.localized_value = localized_value diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_paged.py deleted file mode 100644 index 431af4b57458..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 UsagePaged(Paged): - """ - A paging container for iterating over a list of :class:`Usage ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Usage]'} - } - - def __init__(self, *args, **kwargs): - - super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_py3.py deleted file mode 100644 index 2f833b9c55bb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/models/usage_py3.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - All required parameters must be populated in order to send to Azure. - - :param unit: Required. The unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :type unit: str or ~azure.mgmt.storage.v2015_06_15.models.UsageUnit - :param current_value: Required. The current count of the allocated - resources in the subscription. - :type current_value: int - :param limit: Required. The maximum count of the resources that can be - allocated in the subscription. - :type limit: int - :param name: Required. The name of the type of usage. - :type name: ~azure.mgmt.storage.v2015_06_15.models.UsageName - """ - - _validation = { - 'unit': {'required': True}, - 'current_value': {'required': True}, - 'limit': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, *, unit, current_value: int, limit: int, name, **kwargs) -> None: - super(Usage, self).__init__(**kwargs) - self.unit = unit - self.current_value = current_value - self.limit = limit - self.name = name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/__init__.py index 6c2bfe9071f6..d7cfb1e879a7 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_accounts_operations import StorageAccountsOperations -from .usage_operations import UsageOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._usage_operations import UsageOperations __all__ = [ 'StorageAccountsOperations', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..54dc1b88f988 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_storage_accounts_operations.py @@ -0,0 +1,696 @@ +# 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 StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Client Api Version. Constant value: "2015-06-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-06-15" + + self.config = config + + def check_name_availability( + self, name, type="Microsoft.Storage/storageAccounts", custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: + :type name: str + :param type: + :type type: 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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2015_06_15.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name, type=type) + + # 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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2015_06_15.models.StorageAccountCreateParameters + :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 StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2015_06_15.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2015_06_15.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2015_06_15.models.StorageAccountUpdateParameters + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2015_06_15.models.StorageAccountPaged[~azure.mgmt.storage.v2015_06_15.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2015_06_15.models.StorageAccountPaged[~azure.mgmt.storage.v2015_06_15.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + '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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccountKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccountKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: + :type key_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: StorageAccountKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccountKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_usage_operations.py new file mode 100644 index 000000000000..7790482c560b --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_usage_operations.py @@ -0,0 +1,107 @@ +# 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 UsageOperations(object): + """UsageOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Client Api Version. Constant value: "2015-06-15". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-06-15" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the current usage count and the limit for the resources under the + 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 Usage + :rtype: + ~azure.mgmt.storage.v2015_06_15.models.UsagePaged[~azure.mgmt.storage.v2015_06_15.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/storage_accounts_operations.py deleted file mode 100644 index c44cd75ef9c8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/storage_accounts_operations.py +++ /dev/null @@ -1,695 +0,0 @@ -# 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 StorageAccountsOperations(object): - """StorageAccountsOperations 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: Client Api Version. Constant value: "2015-06-15". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2015-06-15" - - self.config = config - - def check_name_availability( - self, name, type="Microsoft.Storage/storageAccounts", custom_headers=None, raw=False, **operation_config): - """Checks that the storage account name is valid and is not already in - use. - - :param name: - :type name: str - :param type: - :type type: 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: CheckNameAvailabilityResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2015_06_15.models.CheckNameAvailabilityResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name, type=type) - - # 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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('CheckNameAvailabilityResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} - - - def _create_initial( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountCreateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Asynchronously creates a new storage account with the specified - parameters. If an account is already created and a subsequent create - request is issued with different properties, the account properties - will be updated. If an account is already created and a subsequent - create or update request is issued with the exact same set of - properties, the request will succeed. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the created account. - :type parameters: - ~azure.mgmt.storage.v2015_06_15.models.StorageAccountCreateParameters - :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 StorageAccount or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2015_06_15.models.StorageAccount] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2015_06_15.models.StorageAccount]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes a storage account in Microsoft Azure. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def get_properties( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Returns the properties for the specified storage account including but - not limited to name, SKU name, location, and account status. The - ListKeys operation should be used to retrieve storage keys. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def update( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """The update operation can be used to update the SKU, encryption, access - tier, or tags for a storage account. It can also be used to map the - account to a custom domain. Only one custom domain is supported per - storage account; the replacement/change of custom domain is not - supported. In order to replace an old custom domain, the old value must - be cleared/unregistered before a new value can be set. The update of - multiple properties is supported. This call does not change the storage - keys for the account. If you want to change the storage account keys, - use the regenerate keys operation. The location and name of the storage - account cannot be changed after creation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the updated account. - :type parameters: - ~azure.mgmt.storage.v2015_06_15.models.StorageAccountUpdateParameters - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the subscription. Note - that storage keys are not returned; use the ListKeys operation for - this. - - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2015_06_15.models.StorageAccountPaged[~azure.mgmt.storage.v2015_06_15.models.StorageAccount] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the given resource - group. Note that storage keys are not returned; use the ListKeys - operation for this. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2015_06_15.models.StorageAccountPaged[~azure.mgmt.storage.v2015_06_15.models.StorageAccount] - :raises: :class:`CloudError` - """ - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(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.Storage/storageAccounts'} - - def list_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccountKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountKeys or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccountKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} - - def regenerate_key( - self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerates one of the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param key_name: - :type key_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: StorageAccountKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountKeys or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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_key1, 'StorageAccountRegenerateKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccountKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/usage_operations.py deleted file mode 100644 index 12c0cbc8f433..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/usage_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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 UsageOperations(object): - """UsageOperations 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: Client Api Version. Constant value: "2015-06-15". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2015-06-15" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists the current usage count and the limit for the resources under the - 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 Usage - :rtype: - ~azure.mgmt.storage.v2015_06_15.models.UsagePaged[~azure.mgmt.storage.v2015_06_15.models.Usage] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.UsagePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/storage_management_client.py deleted file mode 100644 index 650b2da7afd5..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/storage_management_client.py +++ /dev/null @@ -1,90 +0,0 @@ -# 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.storage_accounts_operations import StorageAccountsOperations -from .operations.usage_operations import UsageOperations -from . import models - - -class StorageManagementClientConfiguration(AzureConfiguration): - """Configuration for StorageManagementClient - 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: Subscription credentials which uniquely identify - the Microsoft Azure subscription. The subscription ID forms part of the - URI for every service call. - :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(StorageManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class StorageManagementClient(SDKClient): - """The Azure Storage Management API. - - :ivar config: Configuration for client. - :vartype config: StorageManagementClientConfiguration - - :ivar storage_accounts: StorageAccounts operations - :vartype storage_accounts: azure.mgmt.storage.v2015_06_15.operations.StorageAccountsOperations - :ivar usage: Usage operations - :vartype usage: azure.mgmt.storage.v2015_06_15.operations.UsageOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Subscription credentials which uniquely identify - the Microsoft Azure subscription. The subscription ID forms part of the - URI for every service call. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - super(StorageManagementClient, 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 = '2015-06-15' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.storage_accounts = StorageAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.usage = UsageOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/__init__.py index 0854715e0c10..da2c3f969e67 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient -from .version import VERSION +from ._configuration import StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] -__all__ = ['StorageManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_configuration.py new file mode 100644 index 000000000000..aa38f01bcbf5 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_configuration.py @@ -0,0 +1,50 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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: Gets subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :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(StorageManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_storage_management_client.py new file mode 100644 index 000000000000..0169d15adc93 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_storage_management_client.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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import StorageManagementClientConfiguration +from .operations import StorageAccountsOperations +from .operations import UsageOperations +from . import models + + +class StorageManagementClient(SDKClient): + """The Storage Management Client. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2016_01_01.operations.StorageAccountsOperations + :ivar usage: Usage operations + :vartype usage: azure.mgmt.storage.v2016_01_01.operations.UsageOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, 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 = '2016-01-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/__init__.py index 75c1e72f7e5a..e16f09f60b20 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/__init__.py @@ -10,44 +10,44 @@ # -------------------------------------------------------------------------- try: - from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters - from .check_name_availability_result_py3 import CheckNameAvailabilityResult - from .sku_py3 import Sku - from .custom_domain_py3 import CustomDomain - from .encryption_service_py3 import EncryptionService - from .encryption_services_py3 import EncryptionServices - from .encryption_py3 import Encryption - from .storage_account_create_parameters_py3 import StorageAccountCreateParameters - from .endpoints_py3 import Endpoints - from .storage_account_py3 import StorageAccount - from .storage_account_key_py3 import StorageAccountKey - from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters - from .usage_name_py3 import UsageName - from .usage_py3 import Usage - from .resource_py3 import Resource + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CustomDomain + from ._models_py3 import Encryption + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import Resource + from ._models_py3 import Sku + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import Usage + from ._models_py3 import UsageName except (SyntaxError, ImportError): - from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters - from .check_name_availability_result import CheckNameAvailabilityResult - from .sku import Sku - from .custom_domain import CustomDomain - from .encryption_service import EncryptionService - from .encryption_services import EncryptionServices - from .encryption import Encryption - from .storage_account_create_parameters import StorageAccountCreateParameters - from .endpoints import Endpoints - from .storage_account import StorageAccount - from .storage_account_key import StorageAccountKey - from .storage_account_list_keys_result import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters import StorageAccountUpdateParameters - from .usage_name import UsageName - from .usage import Usage - from .resource import Resource -from .storage_account_paged import StorageAccountPaged -from .usage_paged import UsagePaged -from .storage_management_client_enums import ( + from ._models import CheckNameAvailabilityResult + from ._models import CustomDomain + from ._models import Encryption + from ._models import EncryptionService + from ._models import EncryptionServices + from ._models import Endpoints + from ._models import Resource + from ._models import Sku + from ._models import StorageAccount + from ._models import StorageAccountCheckNameAvailabilityParameters + from ._models import StorageAccountCreateParameters + from ._models import StorageAccountKey + from ._models import StorageAccountListKeysResult + from ._models import StorageAccountRegenerateKeyParameters + from ._models import StorageAccountUpdateParameters + from ._models import Usage + from ._models import UsageName +from ._paged_models import StorageAccountPaged +from ._paged_models import UsagePaged +from ._storage_management_client_enums import ( Reason, SkuName, SkuTier, @@ -60,23 +60,23 @@ ) __all__ = [ - 'StorageAccountCheckNameAvailabilityParameters', 'CheckNameAvailabilityResult', - 'Sku', 'CustomDomain', + 'Encryption', 'EncryptionService', 'EncryptionServices', - 'Encryption', - 'StorageAccountCreateParameters', 'Endpoints', + 'Resource', + 'Sku', 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', 'StorageAccountKey', 'StorageAccountListKeysResult', 'StorageAccountRegenerateKeyParameters', 'StorageAccountUpdateParameters', - 'UsageName', 'Usage', - 'Resource', + 'UsageName', 'StorageAccountPaged', 'UsagePaged', 'Reason', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models.py new file mode 100644 index 000000000000..556ca0668f21 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models.py @@ -0,0 +1,715 @@ +# 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 CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2016_01_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class Encryption(Model): + """The encryption settings on the storage account. + + 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 services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2016_01_01.models.EncryptionServices + :ivar key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage. Default value: + "Microsoft.Storage" . + :vartype key_source: str + """ + + _validation = { + 'key_source': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + } + + key_source = "Microsoft.Storage" + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2016_01_01.models.EncryptionService + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + } + + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, 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'}, + '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) + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2016_01_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2016_01_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2016_01_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2016_01_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2016_01_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'Available', 'Unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2016_01_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'Available', 'Unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2016_01_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2016_01_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2016_01_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2016_01_01.models.AccessTier + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'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'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """StorageAccountCheckNameAvailabilityParameters. + + 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. + :type name: str + :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" + . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_01_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_01_01.models.AccessTier + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'READ', 'FULL' + :vartype permissions: str or + ~azure.mgmt.storage.v2016_01_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2016_01_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """StorageAccountRegenerateKeyParameters. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_01_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_01_01.models.AccessTier + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2016_01_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2016_01_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models_py3.py new file mode 100644 index 000000000000..da2a0f8870b6 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models_py3.py @@ -0,0 +1,715 @@ +# 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 CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2016_01_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class Encryption(Model): + """The encryption settings on the storage account. + + 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 services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2016_01_01.models.EncryptionServices + :ivar key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage. Default value: + "Microsoft.Storage" . + :vartype key_source: str + """ + + _validation = { + 'key_source': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + } + + key_source = "Microsoft.Storage" + + def __init__(self, *, services=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2016_01_01.models.EncryptionService + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2016_01_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2016_01_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2016_01_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2016_01_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2016_01_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'Available', 'Unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2016_01_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'Available', 'Unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2016_01_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2016_01_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2016_01_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2016_01_01.models.AccessTier + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'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'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = None + self.kind = None + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """StorageAccountCheckNameAvailabilityParameters. + + 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. + :type name: str + :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" + . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_01_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_01_01.models.AccessTier + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, custom_domain=None, encryption=None, access_tier=None, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'READ', 'FULL' + :vartype permissions: str or + ~azure.mgmt.storage.v2016_01_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2016_01_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """StorageAccountRegenerateKeyParameters. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_01_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_01_01.models.AccessTier + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + } + + def __init__(self, *, sku=None, tags=None, custom_domain=None, encryption=None, access_tier=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2016_01_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2016_01_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_paged_models.py new file mode 100644 index 000000000000..1a86c59873ba --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_paged_models.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.paging import Paged + + +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_storage_management_client_enums.py similarity index 100% rename from sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_management_client_enums.py rename to sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_storage_management_client_enums.py diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result.py deleted file mode 100644 index 607746dcc9c6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2016_01_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result_py3.py deleted file mode 100644 index 1097df019f89..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/check_name_availability_result_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2016_01_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain.py deleted file mode 100644 index d5cc10da36cb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(CustomDomain, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain_py3.py deleted file mode 100644 index 25dce0b57aee..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/custom_domain_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: - super(CustomDomain, self).__init__(**kwargs) - self.name = name - self.use_sub_domain_name = use_sub_domain_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption.py deleted file mode 100644 index c46481adbbc4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - 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 services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2016_01_01.models.EncryptionServices - :ivar key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage. Default value: - "Microsoft.Storage" . - :vartype key_source: str - """ - - _validation = { - 'key_source': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - } - - key_source = "Microsoft.Storage" - - def __init__(self, **kwargs): - super(Encryption, self).__init__(**kwargs) - self.services = kwargs.get('services', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_py3.py deleted file mode 100644 index 383fa5043505..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - 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 services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2016_01_01.models.EncryptionServices - :ivar key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage. Default value: - "Microsoft.Storage" . - :vartype key_source: str - """ - - _validation = { - 'key_source': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - } - - key_source = "Microsoft.Storage" - - def __init__(self, *, services=None, **kwargs) -> None: - super(Encryption, self).__init__(**kwargs) - self.services = services diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service.py deleted file mode 100644 index 3a020c468f64..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(EncryptionService, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service_py3.py deleted file mode 100644 index 0566050c6155..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_service_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, enabled: bool=None, **kwargs) -> None: - super(EncryptionService, self).__init__(**kwargs) - self.enabled = enabled - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services.py deleted file mode 100644 index 3a4b4220b30c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2016_01_01.models.EncryptionService - """ - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - } - - def __init__(self, **kwargs): - super(EncryptionServices, self).__init__(**kwargs) - self.blob = kwargs.get('blob', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services_py3.py deleted file mode 100644 index f532ee943c44..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/encryption_services_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2016_01_01.models.EncryptionService - """ - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - } - - def __init__(self, *, blob=None, **kwargs) -> None: - super(EncryptionServices, self).__init__(**kwargs) - self.blob = blob diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints.py deleted file mode 100644 index ec345fceac47..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, or - table object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints_py3.py deleted file mode 100644 index a186e9c8d6a9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/endpoints_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, or - table object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource.py deleted file mode 100644 index 507c1d65d1f1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, 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'}, - '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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource_py3.py deleted file mode 100644 index 5ac41076732b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/resource_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, 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'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, location: str=None, 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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku.py deleted file mode 100644 index 7c56ee2a4425..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - :type name: str or ~azure.mgmt.storage.v2016_01_01.models.SkuName - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2016_01_01.models.SkuTier - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - } - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku_py3.py deleted file mode 100644 index af05828327a9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/sku_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - :type name: str or ~azure.mgmt.storage.v2016_01_01.models.SkuName - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2016_01_01.models.SkuTier - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - } - - def __init__(self, *, name, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account.py deleted file mode 100644 index 12960dd593c2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account.py +++ /dev/null @@ -1,150 +0,0 @@ -# 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 StorageAccount(Resource): - """The storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, str] - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2016_01_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2016_01_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2016_01_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'Available', 'Unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2016_01_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'Available', 'Unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2016_01_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2016_01_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2016_01_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2016_01_01.models.AccessTier - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'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'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - } - - def __init__(self, **kwargs): - super(StorageAccount, self).__init__(**kwargs) - self.sku = None - self.kind = None - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters.py deleted file mode 100644 index 9a2d8ca2606d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """StorageAccountCheckNameAvailabilityParameters. - - 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. - :type name: str - :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" - . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, **kwargs): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters_py3.py deleted file mode 100644 index 18b651d829cf..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_check_name_availability_parameters_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """StorageAccountCheckNameAvailabilityParameters. - - 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. - :type name: str - :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" - . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, *, name: str, **kwargs) -> None: - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters.py deleted file mode 100644 index 288c7841a3e4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters.py +++ /dev/null @@ -1,77 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the sku name. - :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2016_01_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2016_01_01.models.AccessTier - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - } - - def __init__(self, **kwargs): - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.access_tier = kwargs.get('access_tier', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters_py3.py deleted file mode 100644 index e97e1a0118bc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_create_parameters_py3.py +++ /dev/null @@ -1,77 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the sku name. - :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2016_01_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2016_01_01.models.AccessTier - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - } - - def __init__(self, *, sku, kind, location: str, tags=None, custom_domain=None, encryption=None, access_tier=None, **kwargs) -> None: - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key.py deleted file mode 100644 index b1ffbda9be4d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'READ', 'FULL' - :vartype permissions: str or - ~azure.mgmt.storage.v2016_01_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs): - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key_py3.py deleted file mode 100644 index 85b307d1ca63..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_key_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'READ', 'FULL' - :vartype permissions: str or - ~azure.mgmt.storage.v2016_01_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result.py deleted file mode 100644 index 4112d1bb62eb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2016_01_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs): - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result_py3.py deleted file mode 100644 index 877ab0fe34f2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_list_keys_result_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2016_01_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_paged.py deleted file mode 100644 index 6e668765eea0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 StorageAccountPaged(Paged): - """ - A paging container for iterating over a list of :class:`StorageAccount ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[StorageAccount]'} - } - - def __init__(self, *args, **kwargs): - - super(StorageAccountPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_py3.py deleted file mode 100644 index a19cb04871a3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_py3.py +++ /dev/null @@ -1,150 +0,0 @@ -# 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_py3 import Resource - - -class StorageAccount(Resource): - """The storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, str] - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2016_01_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2016_01_01.models.Kind - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2016_01_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2016_01_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'Available', 'Unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2016_01_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'Available', 'Unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2016_01_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2016_01_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2016_01_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2016_01_01.models.AccessTier - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'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'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - } - - def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: - super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) - self.sku = None - self.kind = None - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters.py deleted file mode 100644 index 594bb550c5da..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """StorageAccountRegenerateKeyParameters. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters_py3.py deleted file mode 100644 index 30cb1c6f312b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_regenerate_key_parameters_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """StorageAccountRegenerateKeyParameters. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = key_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters.py deleted file mode 100644 index 705ccbf2421f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku - names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2016_01_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2016_01_01.models.AccessTier - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - } - - def __init__(self, **kwargs): - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.access_tier = kwargs.get('access_tier', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters_py3.py deleted file mode 100644 index 377e7f343884..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/storage_account_update_parameters_py3.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku - names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2016_01_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2016_01_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2016_01_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2016_01_01.models.AccessTier - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - } - - def __init__(self, *, sku=None, tags=None, custom_domain=None, encryption=None, access_tier=None, **kwargs) -> None: - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = sku - self.tags = tags - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage.py deleted file mode 100644 index bf3ddefc1e62..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2016_01_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2016_01_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs): - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name.py deleted file mode 100644 index e4082bf52384..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name_py3.py deleted file mode 100644 index f519bb5072b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_name_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_paged.py deleted file mode 100644 index 24d2dcb6f9eb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 UsagePaged(Paged): - """ - A paging container for iterating over a list of :class:`Usage ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Usage]'} - } - - def __init__(self, *args, **kwargs): - - super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_py3.py deleted file mode 100644 index a0bbc747199c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/usage_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2016_01_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2016_01_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs) -> None: - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/__init__.py index 6c2bfe9071f6..d7cfb1e879a7 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_accounts_operations import StorageAccountsOperations -from .usage_operations import UsageOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._usage_operations import UsageOperations __all__ = [ 'StorageAccountsOperations', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..c3df3fb6a9b6 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py @@ -0,0 +1,696 @@ +# 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 StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Client Api Version. Constant value: "2016-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-01-01" + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: + :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2016_01_01.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) + + # 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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2016_01_01.models.StorageAccountCreateParameters + :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 StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2016_01_01.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2016_01_01.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2016_01_01.models.StorageAccountUpdateParameters + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2016_01_01.models.StorageAccountPaged[~azure.mgmt.storage.v2016_01_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2016_01_01.models.StorageAccountPaged[~azure.mgmt.storage.v2016_01_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2016_01_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: + :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2016_01_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_usage_operations.py new file mode 100644 index 000000000000..14025f30153d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_usage_operations.py @@ -0,0 +1,107 @@ +# 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 UsageOperations(object): + """UsageOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Client Api Version. Constant value: "2016-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-01-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources under the + 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 Usage + :rtype: + ~azure.mgmt.storage.v2016_01_01.models.UsagePaged[~azure.mgmt.storage.v2016_01_01.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/storage_accounts_operations.py deleted file mode 100644 index 941708372035..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/storage_accounts_operations.py +++ /dev/null @@ -1,695 +0,0 @@ -# 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 StorageAccountsOperations(object): - """StorageAccountsOperations 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: Client Api Version. Constant value: "2016-01-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2016-01-01" - - self.config = config - - def check_name_availability( - self, name, custom_headers=None, raw=False, **operation_config): - """Checks that the storage account name is valid and is not already in - use. - - :param name: - :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2016_01_01.models.CheckNameAvailabilityResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) - - # 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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('CheckNameAvailabilityResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} - - - def _create_initial( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountCreateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Asynchronously creates a new storage account with the specified - parameters. If an account is already created and a subsequent create - request is issued with different properties, the account properties - will be updated. If an account is already created and a subsequent - create or update request is issued with the exact same set of - properties, the request will succeed. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the created account. - :type parameters: - ~azure.mgmt.storage.v2016_01_01.models.StorageAccountCreateParameters - :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 StorageAccount or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2016_01_01.models.StorageAccount] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2016_01_01.models.StorageAccount]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes a storage account in Microsoft Azure. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def get_properties( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Returns the properties for the specified storage account including but - not limited to name, SKU name, location, and account status. The - ListKeys operation should be used to retrieve storage keys. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def update( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """The update operation can be used to update the SKU, encryption, access - tier, or tags for a storage account. It can also be used to map the - account to a custom domain. Only one custom domain is supported per - storage account; the replacement/change of custom domain is not - supported. In order to replace an old custom domain, the old value must - be cleared/unregistered before a new value can be set. The update of - multiple properties is supported. This call does not change the storage - keys for the account. If you want to change the storage account keys, - use the regenerate keys operation. The location and name of the storage - account cannot be changed after creation. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the updated account. - :type parameters: - ~azure.mgmt.storage.v2016_01_01.models.StorageAccountUpdateParameters - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2016_01_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the subscription. Note - that storage keys are not returned; use the ListKeys operation for - this. - - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2016_01_01.models.StorageAccountPaged[~azure.mgmt.storage.v2016_01_01.models.StorageAccount] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the given resource - group. Note that storage keys are not returned; use the ListKeys - operation for this. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2016_01_01.models.StorageAccountPaged[~azure.mgmt.storage.v2016_01_01.models.StorageAccount] - :raises: :class:`CloudError` - """ - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(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.Storage/storageAccounts'} - - def list_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2016_01_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} - - def regenerate_key( - self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerates one of the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param key_name: - :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2016_01_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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_key1, 'StorageAccountRegenerateKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/usage_operations.py deleted file mode 100644 index 6a8c6b2ad368..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/usage_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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 UsageOperations(object): - """UsageOperations 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: Client Api Version. Constant value: "2016-01-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2016-01-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets the current usage count and the limit for the resources under the - 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 Usage - :rtype: - ~azure.mgmt.storage.v2016_01_01.models.UsagePaged[~azure.mgmt.storage.v2016_01_01.models.Usage] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.UsagePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/storage_management_client.py deleted file mode 100644 index cd8690faf72d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/storage_management_client.py +++ /dev/null @@ -1,90 +0,0 @@ -# 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.storage_accounts_operations import StorageAccountsOperations -from .operations.usage_operations import UsageOperations -from . import models - - -class StorageManagementClientConfiguration(AzureConfiguration): - """Configuration for StorageManagementClient - 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: Gets subscription credentials which uniquely - identify the Microsoft Azure subscription. The subscription ID forms part - of the URI for every service call. - :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(StorageManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class StorageManagementClient(SDKClient): - """The Storage Management Client. - - :ivar config: Configuration for client. - :vartype config: StorageManagementClientConfiguration - - :ivar storage_accounts: StorageAccounts operations - :vartype storage_accounts: azure.mgmt.storage.v2016_01_01.operations.StorageAccountsOperations - :ivar usage: Usage operations - :vartype usage: azure.mgmt.storage.v2016_01_01.operations.UsageOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Gets subscription credentials which uniquely - identify the Microsoft Azure subscription. The subscription ID forms part - of the URI for every service call. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - super(StorageManagementClient, 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 = '2016-01-01' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.storage_accounts = StorageAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.usage = UsageOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/__init__.py index 0854715e0c10..da2c3f969e67 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient -from .version import VERSION +from ._configuration import StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] -__all__ = ['StorageManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_configuration.py new file mode 100644 index 000000000000..aa38f01bcbf5 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_configuration.py @@ -0,0 +1,50 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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: Gets subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :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(StorageManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_storage_management_client.py new file mode 100644 index 000000000000..b161a8935701 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_storage_management_client.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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import StorageManagementClientConfiguration +from .operations import StorageAccountsOperations +from .operations import UsageOperations +from . import models + + +class StorageManagementClient(SDKClient): + """The Azure Storage Management API. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2016_12_01.operations.StorageAccountsOperations + :ivar usage: Usage operations + :vartype usage: azure.mgmt.storage.v2016_12_01.operations.UsageOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, 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 = '2016-12-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/__init__.py index 17649f574f30..b77d09ec8b71 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/__init__.py @@ -10,52 +10,52 @@ # -------------------------------------------------------------------------- try: - from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters - from .check_name_availability_result_py3 import CheckNameAvailabilityResult - from .sku_py3 import Sku - from .custom_domain_py3 import CustomDomain - from .encryption_service_py3 import EncryptionService - from .encryption_services_py3 import EncryptionServices - from .encryption_py3 import Encryption - from .storage_account_create_parameters_py3 import StorageAccountCreateParameters - from .endpoints_py3 import Endpoints - from .storage_account_py3 import StorageAccount - from .storage_account_key_py3 import StorageAccountKey - from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters - from .usage_name_py3 import UsageName - from .usage_py3 import Usage - from .resource_py3 import Resource - from .account_sas_parameters_py3 import AccountSasParameters - from .list_account_sas_response_py3 import ListAccountSasResponse - from .service_sas_parameters_py3 import ServiceSasParameters - from .list_service_sas_response_py3 import ListServiceSasResponse + from ._models_py3 import AccountSasParameters + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CustomDomain + from ._models_py3 import Encryption + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import ListAccountSasResponse + from ._models_py3 import ListServiceSasResponse + from ._models_py3 import Resource + from ._models_py3 import ServiceSasParameters + from ._models_py3 import Sku + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import Usage + from ._models_py3 import UsageName except (SyntaxError, ImportError): - from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters - from .check_name_availability_result import CheckNameAvailabilityResult - from .sku import Sku - from .custom_domain import CustomDomain - from .encryption_service import EncryptionService - from .encryption_services import EncryptionServices - from .encryption import Encryption - from .storage_account_create_parameters import StorageAccountCreateParameters - from .endpoints import Endpoints - from .storage_account import StorageAccount - from .storage_account_key import StorageAccountKey - from .storage_account_list_keys_result import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters import StorageAccountUpdateParameters - from .usage_name import UsageName - from .usage import Usage - from .resource import Resource - from .account_sas_parameters import AccountSasParameters - from .list_account_sas_response import ListAccountSasResponse - from .service_sas_parameters import ServiceSasParameters - from .list_service_sas_response import ListServiceSasResponse -from .storage_account_paged import StorageAccountPaged -from .usage_paged import UsagePaged -from .storage_management_client_enums import ( + from ._models import AccountSasParameters + from ._models import CheckNameAvailabilityResult + from ._models import CustomDomain + from ._models import Encryption + from ._models import EncryptionService + from ._models import EncryptionServices + from ._models import Endpoints + from ._models import ListAccountSasResponse + from ._models import ListServiceSasResponse + from ._models import Resource + from ._models import ServiceSasParameters + from ._models import Sku + from ._models import StorageAccount + from ._models import StorageAccountCheckNameAvailabilityParameters + from ._models import StorageAccountCreateParameters + from ._models import StorageAccountKey + from ._models import StorageAccountListKeysResult + from ._models import StorageAccountRegenerateKeyParameters + from ._models import StorageAccountUpdateParameters + from ._models import Usage + from ._models import UsageName +from ._paged_models import StorageAccountPaged +from ._paged_models import UsagePaged +from ._storage_management_client_enums import ( Reason, SkuName, SkuTier, @@ -69,27 +69,27 @@ ) __all__ = [ - 'StorageAccountCheckNameAvailabilityParameters', + 'AccountSasParameters', 'CheckNameAvailabilityResult', - 'Sku', 'CustomDomain', + 'Encryption', 'EncryptionService', 'EncryptionServices', - 'Encryption', - 'StorageAccountCreateParameters', 'Endpoints', + 'ListAccountSasResponse', + 'ListServiceSasResponse', + 'Resource', + 'ServiceSasParameters', + 'Sku', 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', 'StorageAccountKey', 'StorageAccountListKeysResult', 'StorageAccountRegenerateKeyParameters', 'StorageAccountUpdateParameters', - 'UsageName', 'Usage', - 'Resource', - 'AccountSasParameters', - 'ListAccountSasResponse', - 'ServiceSasParameters', - 'ListServiceSasResponse', + 'UsageName', 'StorageAccountPaged', 'UsagePaged', 'Reason', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models.py new file mode 100644 index 000000000000..a03e8eb527f7 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models.py @@ -0,0 +1,970 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2016_12_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class Encryption(Model): + """The encryption settings on the storage account. + + 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 services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2016_12_01.models.EncryptionServices + :ivar key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage. Default value: + "Microsoft.Storage" . + :vartype key_source: str + """ + + _validation = { + 'key_source': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + } + + key_source = "Microsoft.Storage" + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, 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'}, + '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) + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2016_12_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2016_12_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2016_12_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2016_12_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2016_12_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2016_12_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2016_12_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2016_12_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2016_12_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2016_12_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'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'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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. + :type name: str + :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" + . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_12_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_12_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2016_12_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2016_12_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_12_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_12_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2016_12_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2016_12_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models_py3.py new file mode 100644 index 000000000000..a0f019f9e665 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models_py3.py @@ -0,0 +1,970 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2016_12_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class Encryption(Model): + """The encryption settings on the storage account. + + 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 services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2016_12_01.models.EncryptionServices + :ivar key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage. Default value: + "Microsoft.Storage" . + :vartype key_source: str + """ + + _validation = { + 'key_source': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + } + + key_source = "Microsoft.Storage" + + def __init__(self, *, services=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2016_12_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2016_12_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2016_12_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2016_12_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2016_12_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2016_12_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2016_12_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2016_12_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2016_12_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2016_12_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'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'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, location: str=None, tags=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = None + self.kind = None + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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. + :type name: str + :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" + . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_12_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_12_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2016_12_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2016_12_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2016_12_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2016_12_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku=None, tags=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2016_12_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2016_12_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_paged_models.py new file mode 100644 index 000000000000..6161abf70808 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_paged_models.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.paging import Paged + + +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_storage_management_client_enums.py similarity index 100% rename from sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_management_client_enums.py rename to sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_storage_management_client_enums.py diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters.py deleted file mode 100644 index 2d017cd9b398..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AccountSasParameters, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.resource_types = kwargs.get('resource_types', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters_py3.py deleted file mode 100644 index c8475408c008..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/account_sas_parameters_py3.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: - super(AccountSasParameters, self).__init__(**kwargs) - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result.py deleted file mode 100644 index af912f7c3b07..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2016_12_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result_py3.py deleted file mode 100644 index 144a9164dd8b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/check_name_availability_result_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2016_12_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain.py deleted file mode 100644 index d5cc10da36cb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(CustomDomain, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain_py3.py deleted file mode 100644 index 25dce0b57aee..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/custom_domain_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: - super(CustomDomain, self).__init__(**kwargs) - self.name = name - self.use_sub_domain_name = use_sub_domain_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption.py deleted file mode 100644 index dbc7f6963178..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - 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 services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2016_12_01.models.EncryptionServices - :ivar key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage. Default value: - "Microsoft.Storage" . - :vartype key_source: str - """ - - _validation = { - 'key_source': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - } - - key_source = "Microsoft.Storage" - - def __init__(self, **kwargs): - super(Encryption, self).__init__(**kwargs) - self.services = kwargs.get('services', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_py3.py deleted file mode 100644 index 8ebcceb015b8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - 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 services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2016_12_01.models.EncryptionServices - :ivar key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage. Default value: - "Microsoft.Storage" . - :vartype key_source: str - """ - - _validation = { - 'key_source': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - } - - key_source = "Microsoft.Storage" - - def __init__(self, *, services=None, **kwargs) -> None: - super(Encryption, self).__init__(**kwargs) - self.services = services diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service.py deleted file mode 100644 index 3a020c468f64..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(EncryptionService, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service_py3.py deleted file mode 100644 index 0566050c6155..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_service_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, enabled: bool=None, **kwargs) -> None: - super(EncryptionService, self).__init__(**kwargs) - self.enabled = enabled - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services.py deleted file mode 100644 index 47fdda835f1e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, **kwargs): - super(EncryptionServices, self).__init__(**kwargs) - self.blob = kwargs.get('blob', None) - self.file = kwargs.get('file', None) - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services_py3.py deleted file mode 100644 index 9bb0c2c5928a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/encryption_services_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2016_12_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, *, blob=None, file=None, **kwargs) -> None: - super(EncryptionServices, self).__init__(**kwargs) - self.blob = blob - self.file = file - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints.py deleted file mode 100644 index ec345fceac47..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, or - table object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints_py3.py deleted file mode 100644 index a186e9c8d6a9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/endpoints_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, or - table object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response.py deleted file mode 100644 index a56e959a34bd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response_py3.py deleted file mode 100644 index b8b9a314d9f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_account_sas_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response.py deleted file mode 100644 index d4ab160ae364..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response_py3.py deleted file mode 100644 index 7c20617658df..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/list_service_sas_response_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource.py deleted file mode 100644 index 125d6e4790b9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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): - """Describes a storage resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, 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'}, - '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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource_py3.py deleted file mode 100644 index 7c1ccbf3aae1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/resource_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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): - """Describes a storage resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, 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'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, location: str=None, 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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters.py deleted file mode 100644 index 72a181876506..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: Required. The signed services accessible with the service - SAS. Possible values include: Blob (b), Container (c), File (f), Share - (s). Possible values include: 'b', 'c', 'f', 's' - :type resource: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = kwargs.get('canonicalized_resource', None) - self.resource = kwargs.get('resource', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.identifier = kwargs.get('identifier', None) - self.partition_key_start = kwargs.get('partition_key_start', None) - self.partition_key_end = kwargs.get('partition_key_end', None) - self.row_key_start = kwargs.get('row_key_start', None) - self.row_key_end = kwargs.get('row_key_end', None) - self.key_to_sign = kwargs.get('key_to_sign', None) - self.cache_control = kwargs.get('cache_control', None) - self.content_disposition = kwargs.get('content_disposition', None) - self.content_encoding = kwargs.get('content_encoding', None) - self.content_language = kwargs.get('content_language', None) - self.content_type = kwargs.get('content_type', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters_py3.py deleted file mode 100644 index f5ca561df495..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/service_sas_parameters_py3.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: Required. The signed services accessible with the service - SAS. Possible values include: Blob (b), Container (c), File (f), Share - (s). Possible values include: 'b', 'c', 'f', 's' - :type resource: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or ~azure.mgmt.storage.v2016_12_01.models.enum - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2016_12_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku.py deleted file mode 100644 index 82fc001bf07b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - :type name: str or ~azure.mgmt.storage.v2016_12_01.models.SkuName - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2016_12_01.models.SkuTier - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - } - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku_py3.py deleted file mode 100644 index 62eb64d55d00..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/sku_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - :type name: str or ~azure.mgmt.storage.v2016_12_01.models.SkuName - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2016_12_01.models.SkuTier - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - } - - def __init__(self, *, name, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account.py deleted file mode 100644 index 95621cc3b8de..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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 StorageAccount(Resource): - """The storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, str] - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2016_12_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2016_12_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2016_12_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2016_12_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2016_12_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2016_12_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2016_12_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2016_12_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'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'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccount, self).__init__(**kwargs) - self.sku = None - self.kind = None - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters.py deleted file mode 100644 index 79824d833227..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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. - :type name: str - :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" - . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, **kwargs): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters_py3.py deleted file mode 100644 index e2a62fc27bb9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_check_name_availability_parameters_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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. - :type name: str - :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts" - . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, *, name: str, **kwargs) -> None: - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters.py deleted file mode 100644 index 24bcdd36975d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters.py +++ /dev/null @@ -1,82 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the sku name. - :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2016_12_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2016_12_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters_py3.py deleted file mode 100644 index c6132db9c30c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_create_parameters_py3.py +++ /dev/null @@ -1,82 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the sku name. - :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2016_12_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2016_12_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - } - - def __init__(self, *, sku, kind, location: str, tags=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key.py deleted file mode 100644 index 8d9349326908..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2016_12_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs): - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key_py3.py deleted file mode 100644 index cb0ab68d14e9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_key_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2016_12_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result.py deleted file mode 100644 index cbe3092f67cd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2016_12_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs): - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result_py3.py deleted file mode 100644 index e87482fcd087..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_list_keys_result_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2016_12_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_paged.py deleted file mode 100644 index 0d90734c1857..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 StorageAccountPaged(Paged): - """ - A paging container for iterating over a list of :class:`StorageAccount ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[StorageAccount]'} - } - - def __init__(self, *args, **kwargs): - - super(StorageAccountPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_py3.py deleted file mode 100644 index 0836331c5fa4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_py3.py +++ /dev/null @@ -1,155 +0,0 @@ -# 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_py3 import Resource - - -class StorageAccount(Resource): - """The storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, str] - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2016_12_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2016_12_01.models.Kind - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2016_12_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2016_12_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2016_12_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2016_12_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2016_12_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2016_12_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2016_12_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'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'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - } - - def __init__(self, *, location: str=None, tags=None, enable_https_traffic_only: bool=False, **kwargs) -> None: - super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) - self.sku = None - self.kind = None - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_https_traffic_only = enable_https_traffic_only diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters.py deleted file mode 100644 index 2c7a28c67fcb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters_py3.py deleted file mode 100644 index 7db8cb2a22c8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_regenerate_key_parameters_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = key_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py deleted file mode 100644 index f48e0ae87161..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku - names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2016_12_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2016_12_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters_py3.py deleted file mode 100644 index 9642815c7436..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/storage_account_update_parameters_py3.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku - names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2016_12_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2016_12_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2016_12_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2016_12_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - } - - def __init__(self, *, sku=None, tags=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = sku - self.tags = tags - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage.py deleted file mode 100644 index 6aad2888dbca..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2016_12_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2016_12_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs): - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name.py deleted file mode 100644 index e4082bf52384..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name_py3.py deleted file mode 100644 index f519bb5072b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_name_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_paged.py deleted file mode 100644 index d33073c2be0d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 UsagePaged(Paged): - """ - A paging container for iterating over a list of :class:`Usage ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Usage]'} - } - - def __init__(self, *args, **kwargs): - - super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_py3.py deleted file mode 100644 index 26928cf23d85..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/usage_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2016_12_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2016_12_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs) -> None: - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/__init__.py index 6c2bfe9071f6..d7cfb1e879a7 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_accounts_operations import StorageAccountsOperations -from .usage_operations import UsageOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._usage_operations import UsageOperations __all__ = [ 'StorageAccountsOperations', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..8ff72ccc0348 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_storage_accounts_operations.py @@ -0,0 +1,840 @@ +# 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 StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Client Api Version. Constant value: "2016-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-12-01" + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: + :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2016_12_01.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) + + # 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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2016_12_01.models.StorageAccountCreateParameters + :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 StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2016_12_01.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2016_12_01.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2016_12_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2016_12_01.models.StorageAccountUpdateParameters + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2016_12_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2016_12_01.models.StorageAccountPaged[~azure.mgmt.storage.v2016_12_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2016_12_01.models.StorageAccountPaged[~azure.mgmt.storage.v2016_12_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + '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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2016_12_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: + :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2016_12_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} + + def list_account_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials + for the storage account. + :type parameters: + ~azure.mgmt.storage.v2016_12_01.models.AccountSasParameters + :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: ListAccountSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2016_12_01.models.ListAccountSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_account_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'AccountSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListAccountSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} + + def list_service_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS + credentials. + :type parameters: + ~azure.mgmt.storage.v2016_12_01.models.ServiceSasParameters + :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: ListServiceSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2016_12_01.models.ListServiceSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_service_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'ServiceSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListServiceSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_usage_operations.py new file mode 100644 index 000000000000..dcfcc516c115 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_usage_operations.py @@ -0,0 +1,107 @@ +# 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 UsageOperations(object): + """UsageOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Client Api Version. Constant value: "2016-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-12-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources under the + 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 Usage + :rtype: + ~azure.mgmt.storage.v2016_12_01.models.UsagePaged[~azure.mgmt.storage.v2016_12_01.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/storage_accounts_operations.py deleted file mode 100644 index 18b97db3d41d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/storage_accounts_operations.py +++ /dev/null @@ -1,841 +0,0 @@ -# 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 StorageAccountsOperations(object): - """StorageAccountsOperations 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: Client Api Version. Constant value: "2016-12-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2016-12-01" - - self.config = config - - def check_name_availability( - self, name, custom_headers=None, raw=False, **operation_config): - """Checks that the storage account name is valid and is not already in - use. - - :param name: - :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2016_12_01.models.CheckNameAvailabilityResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) - - # 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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('CheckNameAvailabilityResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} - - - def _create_initial( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountCreateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Asynchronously creates a new storage account with the specified - parameters. If an account is already created and a subsequent create - request is issued with different properties, the account properties - will be updated. If an account is already created and a subsequent - create or update request is issued with the exact same set of - properties, the request will succeed. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the created account. - :type parameters: - ~azure.mgmt.storage.v2016_12_01.models.StorageAccountCreateParameters - :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 StorageAccount or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2016_12_01.models.StorageAccount] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2016_12_01.models.StorageAccount]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes a storage account in Microsoft Azure. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def get_properties( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Returns the properties for the specified storage account including but - not limited to name, SKU name, location, and account status. The - ListKeys operation should be used to retrieve storage keys. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2016_12_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def update( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """The update operation can be used to update the SKU, encryption, access - tier, or tags for a storage account. It can also be used to map the - account to a custom domain. Only one custom domain is supported per - storage account; the replacement/change of custom domain is not - supported. In order to replace an old custom domain, the old value must - be cleared/unregistered before a new value can be set. The update of - multiple properties is supported. This call does not change the storage - keys for the account. If you want to change the storage account keys, - use the regenerate keys operation. The location and name of the storage - account cannot be changed after creation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the updated account. - :type parameters: - ~azure.mgmt.storage.v2016_12_01.models.StorageAccountUpdateParameters - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2016_12_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the subscription. Note - that storage keys are not returned; use the ListKeys operation for - this. - - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2016_12_01.models.StorageAccountPaged[~azure.mgmt.storage.v2016_12_01.models.StorageAccount] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the given resource - group. Note that storage keys are not returned; use the ListKeys - operation for this. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2016_12_01.models.StorageAccountPaged[~azure.mgmt.storage.v2016_12_01.models.StorageAccount] - :raises: :class:`CloudError` - """ - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(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.Storage/storageAccounts'} - - def list_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2016_12_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} - - def regenerate_key( - self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerates one of the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param key_name: - :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2016_12_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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_key1, 'StorageAccountRegenerateKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} - - def list_account_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List SAS credentials of a storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list SAS credentials - for the storage account. - :type parameters: - ~azure.mgmt.storage.v2016_12_01.models.AccountSasParameters - :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: ListAccountSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2016_12_01.models.ListAccountSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_account_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'AccountSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListAccountSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} - - def list_service_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List service SAS credentials of a specific resource. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list service SAS - credentials. - :type parameters: - ~azure.mgmt.storage.v2016_12_01.models.ServiceSasParameters - :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: ListServiceSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2016_12_01.models.ListServiceSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_service_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'ServiceSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListServiceSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/usage_operations.py deleted file mode 100644 index 0fe016a11e92..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/usage_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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 UsageOperations(object): - """UsageOperations 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: Client Api Version. Constant value: "2016-12-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2016-12-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets the current usage count and the limit for the resources under the - 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 Usage - :rtype: - ~azure.mgmt.storage.v2016_12_01.models.UsagePaged[~azure.mgmt.storage.v2016_12_01.models.Usage] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.UsagePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/storage_management_client.py deleted file mode 100644 index 0f668eb0225e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/storage_management_client.py +++ /dev/null @@ -1,90 +0,0 @@ -# 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.storage_accounts_operations import StorageAccountsOperations -from .operations.usage_operations import UsageOperations -from . import models - - -class StorageManagementClientConfiguration(AzureConfiguration): - """Configuration for StorageManagementClient - 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: Gets subscription credentials which uniquely - identify the Microsoft Azure subscription. The subscription ID forms part - of the URI for every service call. - :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(StorageManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class StorageManagementClient(SDKClient): - """The Azure Storage Management API. - - :ivar config: Configuration for client. - :vartype config: StorageManagementClientConfiguration - - :ivar storage_accounts: StorageAccounts operations - :vartype storage_accounts: azure.mgmt.storage.v2016_12_01.operations.StorageAccountsOperations - :ivar usage: Usage operations - :vartype usage: azure.mgmt.storage.v2016_12_01.operations.UsageOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Gets subscription credentials which uniquely - identify the Microsoft Azure subscription. The subscription ID forms part - of the URI for every service call. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - super(StorageManagementClient, 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 = '2016-12-01' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.storage_accounts = StorageAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.usage = UsageOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/__init__.py index 0854715e0c10..da2c3f969e67 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient -from .version import VERSION +from ._configuration import StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] -__all__ = ['StorageManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_configuration.py new file mode 100644 index 000000000000..aa38f01bcbf5 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_configuration.py @@ -0,0 +1,50 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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: Gets subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :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(StorageManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_storage_management_client.py new file mode 100644 index 000000000000..a8568e93ee13 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_storage_management_client.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 msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import UsageOperations +from . import models + + +class StorageManagementClient(SDKClient): + """The Azure Storage Management API. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2017_06_01.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2017_06_01.operations.SkusOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2017_06_01.operations.StorageAccountsOperations + :ivar usage: Usage operations + :vartype usage: azure.mgmt.storage.v2017_06_01.operations.UsageOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, 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-06-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py index d3d602c0775b..c850657e3bad 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/__init__.py @@ -10,78 +10,78 @@ # -------------------------------------------------------------------------- try: - from .operation_display_py3 import OperationDisplay - from .dimension_py3 import Dimension - from .metric_specification_py3 import MetricSpecification - from .service_specification_py3 import ServiceSpecification - from .operation_py3 import Operation - from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters - from .sku_capability_py3 import SKUCapability - from .restriction_py3 import Restriction - from .sku_py3 import Sku - from .check_name_availability_result_py3 import CheckNameAvailabilityResult - from .custom_domain_py3 import CustomDomain - from .encryption_service_py3 import EncryptionService - from .encryption_services_py3 import EncryptionServices - from .key_vault_properties_py3 import KeyVaultProperties - from .encryption_py3 import Encryption - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - from .identity_py3 import Identity - from .storage_account_create_parameters_py3 import StorageAccountCreateParameters - from .endpoints_py3 import Endpoints - from .storage_account_py3 import StorageAccount - from .storage_account_key_py3 import StorageAccountKey - from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters - from .usage_name_py3 import UsageName - from .usage_py3 import Usage - from .resource_py3 import Resource - from .account_sas_parameters_py3 import AccountSasParameters - from .list_account_sas_response_py3 import ListAccountSasResponse - from .service_sas_parameters_py3 import ServiceSasParameters - from .list_service_sas_response_py3 import ListServiceSasResponse + from ._models_py3 import AccountSasParameters + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CustomDomain + from ._models_py3 import Dimension + from ._models_py3 import Encryption + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import Identity + from ._models_py3 import IPRule + from ._models_py3 import KeyVaultProperties + from ._models_py3 import ListAccountSasResponse + from ._models_py3 import ListServiceSasResponse + from ._models_py3 import MetricSpecification + from ._models_py3 import NetworkRuleSet + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import Resource + from ._models_py3 import Restriction + from ._models_py3 import ServiceSasParameters + from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SKUCapability + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import VirtualNetworkRule except (SyntaxError, ImportError): - from .operation_display import OperationDisplay - from .dimension import Dimension - from .metric_specification import MetricSpecification - from .service_specification import ServiceSpecification - from .operation import Operation - from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters - from .sku_capability import SKUCapability - from .restriction import Restriction - from .sku import Sku - from .check_name_availability_result import CheckNameAvailabilityResult - from .custom_domain import CustomDomain - from .encryption_service import EncryptionService - from .encryption_services import EncryptionServices - from .key_vault_properties import KeyVaultProperties - from .encryption import Encryption - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - from .identity import Identity - from .storage_account_create_parameters import StorageAccountCreateParameters - from .endpoints import Endpoints - from .storage_account import StorageAccount - from .storage_account_key import StorageAccountKey - from .storage_account_list_keys_result import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters import StorageAccountUpdateParameters - from .usage_name import UsageName - from .usage import Usage - from .resource import Resource - from .account_sas_parameters import AccountSasParameters - from .list_account_sas_response import ListAccountSasResponse - from .service_sas_parameters import ServiceSasParameters - from .list_service_sas_response import ListServiceSasResponse -from .operation_paged import OperationPaged -from .sku_paged import SkuPaged -from .storage_account_paged import StorageAccountPaged -from .usage_paged import UsagePaged -from .storage_management_client_enums import ( + from ._models import AccountSasParameters + from ._models import CheckNameAvailabilityResult + from ._models import CustomDomain + from ._models import Dimension + from ._models import Encryption + from ._models import EncryptionService + from ._models import EncryptionServices + from ._models import Endpoints + from ._models import Identity + from ._models import IPRule + from ._models import KeyVaultProperties + from ._models import ListAccountSasResponse + from ._models import ListServiceSasResponse + from ._models import MetricSpecification + from ._models import NetworkRuleSet + from ._models import Operation + from ._models import OperationDisplay + from ._models import Resource + from ._models import Restriction + from ._models import ServiceSasParameters + from ._models import ServiceSpecification + from ._models import Sku + from ._models import SKUCapability + from ._models import StorageAccount + from ._models import StorageAccountCheckNameAvailabilityParameters + from ._models import StorageAccountCreateParameters + from ._models import StorageAccountKey + from ._models import StorageAccountListKeysResult + from ._models import StorageAccountRegenerateKeyParameters + from ._models import StorageAccountUpdateParameters + from ._models import Usage + from ._models import UsageName + from ._models import VirtualNetworkRule +from ._paged_models import OperationPaged +from ._paged_models import SkuPaged +from ._paged_models import StorageAccountPaged +from ._paged_models import UsagePaged +from ._storage_management_client_enums import ( ReasonCode, SkuName, SkuTier, @@ -105,39 +105,39 @@ ) __all__ = [ - 'OperationDisplay', - 'Dimension', - 'MetricSpecification', - 'ServiceSpecification', - 'Operation', - 'StorageAccountCheckNameAvailabilityParameters', - 'SKUCapability', - 'Restriction', - 'Sku', + 'AccountSasParameters', 'CheckNameAvailabilityResult', 'CustomDomain', + 'Dimension', + 'Encryption', 'EncryptionService', 'EncryptionServices', - 'KeyVaultProperties', - 'Encryption', - 'VirtualNetworkRule', + 'Endpoints', + 'Identity', 'IPRule', + 'KeyVaultProperties', + 'ListAccountSasResponse', + 'ListServiceSasResponse', + 'MetricSpecification', 'NetworkRuleSet', - 'Identity', - 'StorageAccountCreateParameters', - 'Endpoints', + 'Operation', + 'OperationDisplay', + 'Resource', + 'Restriction', + 'ServiceSasParameters', + 'ServiceSpecification', + 'Sku', + 'SKUCapability', 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', 'StorageAccountKey', 'StorageAccountListKeysResult', 'StorageAccountRegenerateKeyParameters', 'StorageAccountUpdateParameters', - 'UsageName', 'Usage', - 'Resource', - 'AccountSasParameters', - 'ListAccountSasResponse', - 'ServiceSasParameters', - 'ListServiceSasResponse', + 'UsageName', + 'VirtualNetworkRule', 'OperationPaged', 'SkuPaged', 'StorageAccountPaged', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models.py new file mode 100644 index 000000000000..c46f11dde81d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models.py @@ -0,0 +1,1416 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2017_06_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2017_06_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2017_06_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2017_06_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2017_06_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2017_06_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_06_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2017_06_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2017_06_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2017_06_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2017_06_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2017_06_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2017_06_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2017_06_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, 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'}, + '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) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2017_06_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2017_06_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2017_06_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2017_06_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2017_06_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2017_06_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2017_06_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2017_06_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2017_06_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2017_06_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2017_06_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2017_06_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2017_06_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2017_06_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2017_06_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'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'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_06_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_06_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2017_06_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2017_06_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_06_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_06_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = kwargs.get('network_rule_set', None) + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2017_06_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2017_06_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_06_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2017_06_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models_py3.py new file mode 100644 index 000000000000..c586536d912a --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models_py3.py @@ -0,0 +1,1416 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2017_06_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2017_06_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2017_06_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2017_06_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2017_06_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2017_06_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_06_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2017_06_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2017_06_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2017_06_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2017_06_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2017_06_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2017_06_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2017_06_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2017_06_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2017_06_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2017_06_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2017_06_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2017_06_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2017_06_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2017_06_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2017_06_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2017_06_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2017_06_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2017_06_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2017_06_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2017_06_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2017_06_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2017_06_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'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'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str=None, tags=None, identity=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_06_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_06_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2017_06_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2017_06_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_06_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_06_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2017_06_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2017_06_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_06_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2017_06_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_paged_models.py new file mode 100644 index 000000000000..73fd0d79f915 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_paged_models.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 msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class SkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`Sku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Sku]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuPaged, self).__init__(*args, **kwargs) +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_storage_management_client_enums.py similarity index 100% rename from sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_management_client_enums.py rename to sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_storage_management_client_enums.py diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters.py deleted file mode 100644 index 754adb2c7441..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2017_06_01.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2017_06_01.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2017_06_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AccountSasParameters, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.resource_types = kwargs.get('resource_types', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters_py3.py deleted file mode 100644 index 3fc320834ec4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/account_sas_parameters_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2017_06_01.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2017_06_01.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2017_06_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: - super(AccountSasParameters, self).__init__(**kwargs) - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result.py deleted file mode 100644 index 22058e79e7ee..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2017_06_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result_py3.py deleted file mode 100644 index 5b5ce7c34f2a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/check_name_availability_result_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2017_06_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain.py deleted file mode 100644 index d5cc10da36cb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(CustomDomain, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain_py3.py deleted file mode 100644 index 25dce0b57aee..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/custom_domain_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: - super(CustomDomain, self).__init__(**kwargs) - self.name = name - self.use_sub_domain_name = use_sub_domain_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py deleted file mode 100644 index 2398aa46e8f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Dimension, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension_py3.py deleted file mode 100644 index af5b0aac3d23..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/dimension_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: - super(Dimension, self).__init__(**kwargs) - self.name = name - self.display_name = display_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption.py deleted file mode 100644 index 63e35db813c6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2017_06_01.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or ~azure.mgmt.storage.v2017_06_01.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2017_06_01.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, **kwargs): - super(Encryption, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.key_source = kwargs.get('key_source', "Microsoft.Storage") - self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_py3.py deleted file mode 100644 index 20c4c4c51120..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2017_06_01.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or ~azure.mgmt.storage.v2017_06_01.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2017_06_01.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: - super(Encryption, self).__init__(**kwargs) - self.services = services - self.key_source = key_source - self.key_vault_properties = key_vault_properties diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service.py deleted file mode 100644 index 3a020c468f64..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(EncryptionService, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service_py3.py deleted file mode 100644 index 0566050c6155..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_service_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, enabled: bool=None, **kwargs) -> None: - super(EncryptionService, self).__init__(**kwargs) - self.enabled = enabled - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services.py deleted file mode 100644 index 4eaebd087b08..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, **kwargs): - super(EncryptionServices, self).__init__(**kwargs) - self.blob = kwargs.get('blob', None) - self.file = kwargs.get('file', None) - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services_py3.py deleted file mode 100644 index eb0e237af96a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/encryption_services_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2017_06_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, *, blob=None, file=None, **kwargs) -> None: - super(EncryptionServices, self).__init__(**kwargs) - self.blob = blob - self.file = file - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints.py deleted file mode 100644 index ec345fceac47..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, or - table object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints_py3.py deleted file mode 100644 index a186e9c8d6a9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/endpoints_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, or - table object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity.py deleted file mode 100644 index f526b986fc70..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity_py3.py deleted file mode 100644 index 22d25fdd85b7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/identity_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs) -> None: - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule.py deleted file mode 100644 index 6dbbc87301f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2017_06_01.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.action = kwargs.get('action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule_py3.py deleted file mode 100644 index 3224cab4d7c1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/ip_rule_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2017_06_01.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = ip_address_or_range - self.action = action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties.py deleted file mode 100644 index 44eaf379f6f2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - self.key_version = kwargs.get('key_version', None) - self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties_py3.py deleted file mode 100644 index 9e6350eec898..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/key_vault_properties_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = key_name - self.key_version = key_version - self.key_vault_uri = key_vault_uri diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response.py deleted file mode 100644 index a56e959a34bd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response_py3.py deleted file mode 100644 index b8b9a314d9f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_account_sas_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response.py deleted file mode 100644 index d4ab160ae364..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response_py3.py deleted file mode 100644 index 7c20617658df..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/list_service_sas_response_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py deleted file mode 100644 index b186b5d354e5..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: list[~azure.mgmt.storage.v2017_06_01.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MetricSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.dimensions = kwargs.get('dimensions', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) - self.category = kwargs.get('category', None) - self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification_py3.py deleted file mode 100644 index 0e8d1989c9f5..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/metric_specification_py3.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: list[~azure.mgmt.storage.v2017_06_01.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: - super(MetricSpecification, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.dimensions = dimensions - self.aggregation_type = aggregation_type - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py deleted file mode 100644 index 1f8226c1ccf1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2017_06_01.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2017_06_01.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: list[~azure.mgmt.storage.v2017_06_01.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2017_06_01.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = kwargs.get('bypass', "AzureServices") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) - self.default_action = kwargs.get('default_action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set_py3.py deleted file mode 100644 index 8380cbe38c6f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/network_rule_set_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2017_06_01.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2017_06_01.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: list[~azure.mgmt.storage.v2017_06_01.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2017_06_01.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = bypass - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules - self.default_action = default_action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation.py deleted file mode 100644 index 4dc334ae71b8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~azure.mgmt.storage.v2017_06_01.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2017_06_01.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display.py deleted file mode 100644 index 12d72186c4f2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display_py3.py deleted file mode 100644 index 632a6393c99f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_display_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_paged.py deleted file mode 100644 index 537e89a9d19a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_py3.py deleted file mode 100644 index e78c4fa89bcd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/operation_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~azure.mgmt.storage.v2017_06_01.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2017_06_01.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource.py deleted file mode 100644 index 125d6e4790b9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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): - """Describes a storage resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, 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'}, - '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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource_py3.py deleted file mode 100644 index 7c1ccbf3aae1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/resource_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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): - """Describes a storage resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, 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'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, location: str=None, 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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py deleted file mode 100644 index d747e73cdbcc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2017_06_01.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = kwargs.get('reason_code', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction_py3.py deleted file mode 100644 index 591a87f8331e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/restriction_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2017_06_01.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, *, reason_code=None, **kwargs) -> None: - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = reason_code diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters.py deleted file mode 100644 index 243cab9c3625..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters.py +++ /dev/null @@ -1,121 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: Required. The signed services accessible with the service - SAS. Possible values include: Blob (b), Container (c), File (f), Share - (s). Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2017_06_01.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2017_06_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = kwargs.get('canonicalized_resource', None) - self.resource = kwargs.get('resource', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.identifier = kwargs.get('identifier', None) - self.partition_key_start = kwargs.get('partition_key_start', None) - self.partition_key_end = kwargs.get('partition_key_end', None) - self.row_key_start = kwargs.get('row_key_start', None) - self.row_key_end = kwargs.get('row_key_end', None) - self.key_to_sign = kwargs.get('key_to_sign', None) - self.cache_control = kwargs.get('cache_control', None) - self.content_disposition = kwargs.get('content_disposition', None) - self.content_encoding = kwargs.get('content_encoding', None) - self.content_language = kwargs.get('content_language', None) - self.content_type = kwargs.get('content_type', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters_py3.py deleted file mode 100644 index 89cae4dea28c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_sas_parameters_py3.py +++ /dev/null @@ -1,121 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: Required. The signed services accessible with the service - SAS. Possible values include: Blob (b), Container (c), File (f), Share - (s). Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2017_06_01.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2017_06_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2017_06_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification.py deleted file mode 100644 index 56a5310b2b54..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2017_06_01.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, **kwargs): - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification_py3.py deleted file mode 100644 index 3887c105db26..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/service_specification_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2017_06_01.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py deleted file mode 100644 index 36a138ff7a3e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - :type name: str or ~azure.mgmt.storage.v2017_06_01.models.SkuName - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2017_06_01.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified sku, - including file encryption, network acls, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2017_06_01.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2017_06_01.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = kwargs.get('restrictions', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py deleted file mode 100644 index b8fa68ce7778..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified sku, including file encryption, - network acls, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified sku, including file encryption, network acls, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability_py3.py deleted file mode 100644 index f349a08eda21..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_capability_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified sku, including file encryption, - network acls, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified sku, including file encryption, network acls, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_paged.py deleted file mode 100644 index 31c13d35c415..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 SkuPaged(Paged): - """ - A paging container for iterating over a list of :class:`Sku ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Sku]'} - } - - def __init__(self, *args, **kwargs): - - super(SkuPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_py3.py deleted file mode 100644 index 8bb382d64810..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/sku_py3.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - :type name: str or ~azure.mgmt.storage.v2017_06_01.models.SkuName - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2017_06_01.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified sku, - including file encryption, network acls, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2017_06_01.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2017_06_01.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, *, name, restrictions=None, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = restrictions diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py deleted file mode 100644 index b0efd1ae89e6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account.py +++ /dev/null @@ -1,165 +0,0 @@ -# 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 StorageAccount(Resource): - """The storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, str] - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2017_06_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2017_06_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2017_06_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2017_06_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2017_06_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2017_06_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2017_06_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2017_06_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'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'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, **kwargs): - super(StorageAccount, self).__init__(**kwargs) - self.sku = None - self.kind = None - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) - self.network_rule_set = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters.py deleted file mode 100644 index dbe41bb2c6b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, **kwargs): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters_py3.py deleted file mode 100644 index 8d2b031e2284..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_check_name_availability_parameters_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, *, name: str, **kwargs) -> None: - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py deleted file mode 100644 index 0ec87bb649c5..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the sku name. - :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2017_06_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2017_06_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters_py3.py deleted file mode 100644 index 77ecca9ce28e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_create_parameters_py3.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the sku name. - :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2017_06_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2017_06_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - } - - def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.network_rule_set = network_rule_set - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key.py deleted file mode 100644 index 55028b0d3fef..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2017_06_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs): - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key_py3.py deleted file mode 100644 index ba59047babc0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_key_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2017_06_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result.py deleted file mode 100644 index 67ac8d362f13..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2017_06_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs): - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result_py3.py deleted file mode 100644 index 8bc6439d5974..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_list_keys_result_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2017_06_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_paged.py deleted file mode 100644 index 1a2ffd14bee0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 StorageAccountPaged(Paged): - """ - A paging container for iterating over a list of :class:`StorageAccount ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[StorageAccount]'} - } - - def __init__(self, *args, **kwargs): - - super(StorageAccountPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_py3.py deleted file mode 100644 index d4fa00f277c9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_py3.py +++ /dev/null @@ -1,165 +0,0 @@ -# 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_py3 import Resource - - -class StorageAccount(Resource): - """The storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, str] - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2017_06_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2017_06_01.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2017_06_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2017_06_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2017_06_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2017_06_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2017_06_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2017_06_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2017_06_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'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'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, location: str=None, tags=None, identity=None, enable_https_traffic_only: bool=False, **kwargs) -> None: - super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) - self.sku = None - self.kind = None - self.identity = identity - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters.py deleted file mode 100644 index 6dba2135fdc7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters_py3.py deleted file mode 100644 index 6e06a071eba3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_regenerate_key_parameters_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = key_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py deleted file mode 100644 index 6bfa979c2622..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters.py +++ /dev/null @@ -1,72 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku - names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2017_06_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2017_06_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, **kwargs): - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) - self.network_rule_set = kwargs.get('network_rule_set', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters_py3.py deleted file mode 100644 index 9b331731d561..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/storage_account_update_parameters_py3.py +++ /dev/null @@ -1,72 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku - names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2017_06_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2017_06_01.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2017_06_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2017_06_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2017_06_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2017_06_01.models.NetworkRuleSet - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, **kwargs) -> None: - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = sku - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = network_rule_set diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage.py deleted file mode 100644 index c9bf28ceb25a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2017_06_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2017_06_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs): - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name.py deleted file mode 100644 index e4082bf52384..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name_py3.py deleted file mode 100644 index f519bb5072b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_name_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_paged.py deleted file mode 100644 index d14d89697d7b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 UsagePaged(Paged): - """ - A paging container for iterating over a list of :class:`Usage ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Usage]'} - } - - def __init__(self, *args, **kwargs): - - super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_py3.py deleted file mode 100644 index d96ce4fe8177..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/usage_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2017_06_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2017_06_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs) -> None: - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py deleted file mode 100644 index 0724a4bae9ae..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2017_06_01.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2017_06_01.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) - self.action = kwargs.get('action', "Allow") - self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule_py3.py deleted file mode 100644 index b0bf9e282280..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2017_06_01.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2017_06_01.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = virtual_network_resource_id - self.action = action - self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/__init__.py index 3334aa2f42e5..680a808d8d46 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/__init__.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .operations import Operations -from .skus_operations import SkusOperations -from .storage_accounts_operations import StorageAccountsOperations -from .usage_operations import UsageOperations +from ._operations import Operations +from ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._usage_operations import UsageOperations __all__ = [ 'Operations', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_operations.py new file mode 100644 index 000000000000..4242d52b36b3 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_operations.py @@ -0,0 +1,102 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Client Api Version. Constant value: "2017-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-06-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Storage 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 Operation + :rtype: + ~azure.mgmt.storage.v2017_06_01.models.OperationPaged[~azure.mgmt.storage.v2017_06_01.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_skus_operations.py new file mode 100644 index 000000000000..5e001dc98406 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_skus_operations.py @@ -0,0 +1,107 @@ +# 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 SkusOperations(object): + """SkusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Client Api Version. Constant value: "2017-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-06-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the available SKUs supported by Microsoft.Storage for given + 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 Sku + :rtype: + ~azure.mgmt.storage.v2017_06_01.models.SkuPaged[~azure.mgmt.storage.v2017_06_01.models.Sku] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..4043c8d206d9 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_storage_accounts_operations.py @@ -0,0 +1,841 @@ +# 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 StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Client Api Version. Constant value: "2017-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-06-01" + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: The storage account name. + :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2017_06_01.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) + + # 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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2017_06_01.models.StorageAccountCreateParameters + :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 StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2017_06_01.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2017_06_01.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2017_06_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2017_06_01.models.StorageAccountUpdateParameters + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2017_06_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2017_06_01.models.StorageAccountPaged[~azure.mgmt.storage.v2017_06_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2017_06_01.models.StorageAccountPaged[~azure.mgmt.storage.v2017_06_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + '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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2017_06_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: The name of storage keys that want to be regenerated, + possible values are key1, key2. + :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2017_06_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} + + def list_account_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials + for the storage account. + :type parameters: + ~azure.mgmt.storage.v2017_06_01.models.AccountSasParameters + :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: ListAccountSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2017_06_01.models.ListAccountSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_account_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'AccountSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListAccountSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} + + def list_service_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS + credentials. + :type parameters: + ~azure.mgmt.storage.v2017_06_01.models.ServiceSasParameters + :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: ListServiceSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2017_06_01.models.ListServiceSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_service_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'ServiceSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListServiceSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_usage_operations.py new file mode 100644 index 000000000000..41efa0edf12f --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_usage_operations.py @@ -0,0 +1,107 @@ +# 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 UsageOperations(object): + """UsageOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: Client Api Version. Constant value: "2017-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-06-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources under the + 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 Usage + :rtype: + ~azure.mgmt.storage.v2017_06_01.models.UsagePaged[~azure.mgmt.storage.v2017_06_01.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/operations.py deleted file mode 100644 index 844fbfc04cab..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/operations.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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: Client Api Version. Constant value: "2017-06-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-06-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available Storage 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 Operation - :rtype: - ~azure.mgmt.storage.v2017_06_01.models.OperationPaged[~azure.mgmt.storage.v2017_06_01.models.Operation] - :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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.OperationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py deleted file mode 100644 index f83eb52da8bf..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/skus_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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 SkusOperations(object): - """SkusOperations 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: Client Api Version. Constant value: "2017-06-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-06-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists the available SKUs supported by Microsoft.Storage for given - 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 Sku - :rtype: - ~azure.mgmt.storage.v2017_06_01.models.SkuPaged[~azure.mgmt.storage.v2017_06_01.models.Sku] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.SkuPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/storage_accounts_operations.py deleted file mode 100644 index 00b0dd5ef0cf..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/storage_accounts_operations.py +++ /dev/null @@ -1,842 +0,0 @@ -# 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 StorageAccountsOperations(object): - """StorageAccountsOperations 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: Client Api Version. Constant value: "2017-06-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-06-01" - - self.config = config - - def check_name_availability( - self, name, custom_headers=None, raw=False, **operation_config): - """Checks that the storage account name is valid and is not already in - use. - - :param name: The storage account name. - :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2017_06_01.models.CheckNameAvailabilityResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) - - # 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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('CheckNameAvailabilityResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} - - - def _create_initial( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountCreateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Asynchronously creates a new storage account with the specified - parameters. If an account is already created and a subsequent create - request is issued with different properties, the account properties - will be updated. If an account is already created and a subsequent - create or update request is issued with the exact same set of - properties, the request will succeed. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the created account. - :type parameters: - ~azure.mgmt.storage.v2017_06_01.models.StorageAccountCreateParameters - :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 StorageAccount or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2017_06_01.models.StorageAccount] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2017_06_01.models.StorageAccount]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes a storage account in Microsoft Azure. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def get_properties( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Returns the properties for the specified storage account including but - not limited to name, SKU name, location, and account status. The - ListKeys operation should be used to retrieve storage keys. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2017_06_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def update( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """The update operation can be used to update the SKU, encryption, access - tier, or tags for a storage account. It can also be used to map the - account to a custom domain. Only one custom domain is supported per - storage account; the replacement/change of custom domain is not - supported. In order to replace an old custom domain, the old value must - be cleared/unregistered before a new value can be set. The update of - multiple properties is supported. This call does not change the storage - keys for the account. If you want to change the storage account keys, - use the regenerate keys operation. The location and name of the storage - account cannot be changed after creation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the updated account. - :type parameters: - ~azure.mgmt.storage.v2017_06_01.models.StorageAccountUpdateParameters - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2017_06_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the subscription. Note - that storage keys are not returned; use the ListKeys operation for - this. - - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2017_06_01.models.StorageAccountPaged[~azure.mgmt.storage.v2017_06_01.models.StorageAccount] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the given resource - group. Note that storage keys are not returned; use the ListKeys - operation for this. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2017_06_01.models.StorageAccountPaged[~azure.mgmt.storage.v2017_06_01.models.StorageAccount] - :raises: :class:`CloudError` - """ - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(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.Storage/storageAccounts'} - - def list_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2017_06_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} - - def regenerate_key( - self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerates one of the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param key_name: The name of storage keys that want to be regenerated, - possible values are key1, key2. - :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2017_06_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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_key1, 'StorageAccountRegenerateKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} - - def list_account_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List SAS credentials of a storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list SAS credentials - for the storage account. - :type parameters: - ~azure.mgmt.storage.v2017_06_01.models.AccountSasParameters - :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: ListAccountSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2017_06_01.models.ListAccountSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_account_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'AccountSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListAccountSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} - - def list_service_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List service SAS credentials of a specific resource. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list service SAS - credentials. - :type parameters: - ~azure.mgmt.storage.v2017_06_01.models.ServiceSasParameters - :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: ListServiceSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2017_06_01.models.ListServiceSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_service_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'ServiceSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListServiceSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/usage_operations.py deleted file mode 100644 index 7c27e3421f4c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/usage_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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 UsageOperations(object): - """UsageOperations 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: Client Api Version. Constant value: "2017-06-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-06-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets the current usage count and the limit for the resources under the - 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 Usage - :rtype: - ~azure.mgmt.storage.v2017_06_01.models.UsagePaged[~azure.mgmt.storage.v2017_06_01.models.Usage] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.UsagePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py deleted file mode 100644 index db90f97ed22f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/storage_management_client.py +++ /dev/null @@ -1,100 +0,0 @@ -# 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.operations import Operations -from .operations.skus_operations import SkusOperations -from .operations.storage_accounts_operations import StorageAccountsOperations -from .operations.usage_operations import UsageOperations -from . import models - - -class StorageManagementClientConfiguration(AzureConfiguration): - """Configuration for StorageManagementClient - 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: Gets subscription credentials which uniquely - identify the Microsoft Azure subscription. The subscription ID forms part - of the URI for every service call. - :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(StorageManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class StorageManagementClient(SDKClient): - """The Azure Storage Management API. - - :ivar config: Configuration for client. - :vartype config: StorageManagementClientConfiguration - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.storage.v2017_06_01.operations.Operations - :ivar skus: Skus operations - :vartype skus: azure.mgmt.storage.v2017_06_01.operations.SkusOperations - :ivar storage_accounts: StorageAccounts operations - :vartype storage_accounts: azure.mgmt.storage.v2017_06_01.operations.StorageAccountsOperations - :ivar usage: Usage operations - :vartype usage: azure.mgmt.storage.v2017_06_01.operations.UsageOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Gets subscription credentials which uniquely - identify the Microsoft Azure subscription. The subscription ID forms part - of the URI for every service call. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - super(StorageManagementClient, 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-06-01' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.skus = SkusOperations( - self._client, self.config, self._serialize, self._deserialize) - self.storage_accounts = StorageAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.usage = UsageOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/__init__.py index 0854715e0c10..da2c3f969e67 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient -from .version import VERSION +from ._configuration import StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] -__all__ = ['StorageManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_configuration.py new file mode 100644 index 000000000000..aa38f01bcbf5 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_configuration.py @@ -0,0 +1,50 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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: Gets subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :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(StorageManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_storage_management_client.py new file mode 100644 index 000000000000..7919410121d1 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_storage_management_client.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 msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import UsageOperations +from . import models + + +class StorageManagementClient(SDKClient): + """The Azure Storage Management API. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2017_10_01.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2017_10_01.operations.SkusOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2017_10_01.operations.StorageAccountsOperations + :ivar usage: Usage operations + :vartype usage: azure.mgmt.storage.v2017_10_01.operations.UsageOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, 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' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/__init__.py index d3d602c0775b..c850657e3bad 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/__init__.py @@ -10,78 +10,78 @@ # -------------------------------------------------------------------------- try: - from .operation_display_py3 import OperationDisplay - from .dimension_py3 import Dimension - from .metric_specification_py3 import MetricSpecification - from .service_specification_py3 import ServiceSpecification - from .operation_py3 import Operation - from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters - from .sku_capability_py3 import SKUCapability - from .restriction_py3 import Restriction - from .sku_py3 import Sku - from .check_name_availability_result_py3 import CheckNameAvailabilityResult - from .custom_domain_py3 import CustomDomain - from .encryption_service_py3 import EncryptionService - from .encryption_services_py3 import EncryptionServices - from .key_vault_properties_py3 import KeyVaultProperties - from .encryption_py3 import Encryption - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - from .identity_py3 import Identity - from .storage_account_create_parameters_py3 import StorageAccountCreateParameters - from .endpoints_py3 import Endpoints - from .storage_account_py3 import StorageAccount - from .storage_account_key_py3 import StorageAccountKey - from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters - from .usage_name_py3 import UsageName - from .usage_py3 import Usage - from .resource_py3 import Resource - from .account_sas_parameters_py3 import AccountSasParameters - from .list_account_sas_response_py3 import ListAccountSasResponse - from .service_sas_parameters_py3 import ServiceSasParameters - from .list_service_sas_response_py3 import ListServiceSasResponse + from ._models_py3 import AccountSasParameters + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CustomDomain + from ._models_py3 import Dimension + from ._models_py3 import Encryption + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import Identity + from ._models_py3 import IPRule + from ._models_py3 import KeyVaultProperties + from ._models_py3 import ListAccountSasResponse + from ._models_py3 import ListServiceSasResponse + from ._models_py3 import MetricSpecification + from ._models_py3 import NetworkRuleSet + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import Resource + from ._models_py3 import Restriction + from ._models_py3 import ServiceSasParameters + from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SKUCapability + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import VirtualNetworkRule except (SyntaxError, ImportError): - from .operation_display import OperationDisplay - from .dimension import Dimension - from .metric_specification import MetricSpecification - from .service_specification import ServiceSpecification - from .operation import Operation - from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters - from .sku_capability import SKUCapability - from .restriction import Restriction - from .sku import Sku - from .check_name_availability_result import CheckNameAvailabilityResult - from .custom_domain import CustomDomain - from .encryption_service import EncryptionService - from .encryption_services import EncryptionServices - from .key_vault_properties import KeyVaultProperties - from .encryption import Encryption - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - from .identity import Identity - from .storage_account_create_parameters import StorageAccountCreateParameters - from .endpoints import Endpoints - from .storage_account import StorageAccount - from .storage_account_key import StorageAccountKey - from .storage_account_list_keys_result import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters import StorageAccountUpdateParameters - from .usage_name import UsageName - from .usage import Usage - from .resource import Resource - from .account_sas_parameters import AccountSasParameters - from .list_account_sas_response import ListAccountSasResponse - from .service_sas_parameters import ServiceSasParameters - from .list_service_sas_response import ListServiceSasResponse -from .operation_paged import OperationPaged -from .sku_paged import SkuPaged -from .storage_account_paged import StorageAccountPaged -from .usage_paged import UsagePaged -from .storage_management_client_enums import ( + from ._models import AccountSasParameters + from ._models import CheckNameAvailabilityResult + from ._models import CustomDomain + from ._models import Dimension + from ._models import Encryption + from ._models import EncryptionService + from ._models import EncryptionServices + from ._models import Endpoints + from ._models import Identity + from ._models import IPRule + from ._models import KeyVaultProperties + from ._models import ListAccountSasResponse + from ._models import ListServiceSasResponse + from ._models import MetricSpecification + from ._models import NetworkRuleSet + from ._models import Operation + from ._models import OperationDisplay + from ._models import Resource + from ._models import Restriction + from ._models import ServiceSasParameters + from ._models import ServiceSpecification + from ._models import Sku + from ._models import SKUCapability + from ._models import StorageAccount + from ._models import StorageAccountCheckNameAvailabilityParameters + from ._models import StorageAccountCreateParameters + from ._models import StorageAccountKey + from ._models import StorageAccountListKeysResult + from ._models import StorageAccountRegenerateKeyParameters + from ._models import StorageAccountUpdateParameters + from ._models import Usage + from ._models import UsageName + from ._models import VirtualNetworkRule +from ._paged_models import OperationPaged +from ._paged_models import SkuPaged +from ._paged_models import StorageAccountPaged +from ._paged_models import UsagePaged +from ._storage_management_client_enums import ( ReasonCode, SkuName, SkuTier, @@ -105,39 +105,39 @@ ) __all__ = [ - 'OperationDisplay', - 'Dimension', - 'MetricSpecification', - 'ServiceSpecification', - 'Operation', - 'StorageAccountCheckNameAvailabilityParameters', - 'SKUCapability', - 'Restriction', - 'Sku', + 'AccountSasParameters', 'CheckNameAvailabilityResult', 'CustomDomain', + 'Dimension', + 'Encryption', 'EncryptionService', 'EncryptionServices', - 'KeyVaultProperties', - 'Encryption', - 'VirtualNetworkRule', + 'Endpoints', + 'Identity', 'IPRule', + 'KeyVaultProperties', + 'ListAccountSasResponse', + 'ListServiceSasResponse', + 'MetricSpecification', 'NetworkRuleSet', - 'Identity', - 'StorageAccountCreateParameters', - 'Endpoints', + 'Operation', + 'OperationDisplay', + 'Resource', + 'Restriction', + 'ServiceSasParameters', + 'ServiceSpecification', + 'Sku', + 'SKUCapability', 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', 'StorageAccountKey', 'StorageAccountListKeysResult', 'StorageAccountRegenerateKeyParameters', 'StorageAccountUpdateParameters', - 'UsageName', 'Usage', - 'Resource', - 'AccountSasParameters', - 'ListAccountSasResponse', - 'ServiceSasParameters', - 'ListServiceSasResponse', + 'UsageName', + 'VirtualNetworkRule', 'OperationPaged', 'SkuPaged', 'StorageAccountPaged', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models.py new file mode 100644 index 000000000000..f81f5dc8b8cc --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models.py @@ -0,0 +1,1422 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2017_10_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2017_10_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_10_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2017_10_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2017_10_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2017_10_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2017_10_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_10_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2017_10_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2017_10_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2017_10_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2017_10_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2017_10_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2017_10_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2017_10_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, 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'}, + '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) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2017_10_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2017_10_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_10_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2017_10_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2017_10_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2017_10_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2017_10_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2017_10_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2017_10_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2017_10_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2017_10_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2017_10_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2017_10_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2017_10_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2017_10_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2017_10_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'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'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_10_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_10_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2017_10_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2017_10_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_10_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_10_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.kind = kwargs.get('kind', None) + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2017_10_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2017_10_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_10_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2017_10_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models_py3.py new file mode 100644 index 000000000000..18cdbb353024 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models_py3.py @@ -0,0 +1,1422 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2017_10_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2017_10_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_10_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2017_10_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2017_10_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2017_10_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2017_10_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, or + table object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_10_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2017_10_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2017_10_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2017_10_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2017_10_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2017_10_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2017_10_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2017_10_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + + +class Resource(Model): + """Describes a storage resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2017_10_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: Required. The signed services accessible with the service + SAS. Possible values include: Blob (b), Container (c), File (f), Share + (s). Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2017_10_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2017_10_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2017_10_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2017_10_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2017_10_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2017_10_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2017_10_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class StorageAccount(Resource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Tags assigned to a resource; can be used for viewing and + grouping a resource (across resource groups). + :type tags: dict[str, str] + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2017_10_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2017_10_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2017_10_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2017_10_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2017_10_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2017_10_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2017_10_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2017_10_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'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'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, location: str=None, tags=None, identity=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_10_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_10_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2017_10_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2017_10_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2017_10_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2017_10_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, kind=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.kind = kind + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2017_10_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2017_10_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2017_10_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2017_10_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_paged_models.py new file mode 100644 index 000000000000..abd19b2aa9b9 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_paged_models.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 msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class SkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`Sku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Sku]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuPaged, self).__init__(*args, **kwargs) +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_storage_management_client_enums.py similarity index 100% rename from sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_management_client_enums.py rename to sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_storage_management_client_enums.py diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters.py deleted file mode 100644 index 3fff0b8de573..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2017_10_01.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2017_10_01.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2017_10_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AccountSasParameters, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.resource_types = kwargs.get('resource_types', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters_py3.py deleted file mode 100644 index 5bae2b318f48..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/account_sas_parameters_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2017_10_01.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2017_10_01.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2017_10_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: - super(AccountSasParameters, self).__init__(**kwargs) - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result.py deleted file mode 100644 index f2bfb36e391c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2017_10_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result_py3.py deleted file mode 100644 index e2a8b2937c91..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/check_name_availability_result_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2017_10_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain.py deleted file mode 100644 index d5cc10da36cb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(CustomDomain, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain_py3.py deleted file mode 100644 index 25dce0b57aee..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/custom_domain_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: - super(CustomDomain, self).__init__(**kwargs) - self.name = name - self.use_sub_domain_name = use_sub_domain_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension.py deleted file mode 100644 index 2398aa46e8f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Dimension, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension_py3.py deleted file mode 100644 index af5b0aac3d23..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/dimension_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: - super(Dimension, self).__init__(**kwargs) - self.name = name - self.display_name = display_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption.py deleted file mode 100644 index 34ad6bac386d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2017_10_01.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or ~azure.mgmt.storage.v2017_10_01.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2017_10_01.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, **kwargs): - super(Encryption, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.key_source = kwargs.get('key_source', "Microsoft.Storage") - self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_py3.py deleted file mode 100644 index d819a127105d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2017_10_01.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or ~azure.mgmt.storage.v2017_10_01.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2017_10_01.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: - super(Encryption, self).__init__(**kwargs) - self.services = services - self.key_source = key_source - self.key_vault_properties = key_vault_properties diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service.py deleted file mode 100644 index 3a020c468f64..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(EncryptionService, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service_py3.py deleted file mode 100644 index 0566050c6155..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_service_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, enabled: bool=None, **kwargs) -> None: - super(EncryptionService, self).__init__(**kwargs) - self.enabled = enabled - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services.py deleted file mode 100644 index 0b47a300149f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, **kwargs): - super(EncryptionServices, self).__init__(**kwargs) - self.blob = kwargs.get('blob', None) - self.file = kwargs.get('file', None) - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services_py3.py deleted file mode 100644 index f9efae41c782..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/encryption_services_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2017_10_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, *, blob=None, file=None, **kwargs) -> None: - super(EncryptionServices, self).__init__(**kwargs) - self.blob = blob - self.file = file - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints.py deleted file mode 100644 index ec345fceac47..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, or - table object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints_py3.py deleted file mode 100644 index a186e9c8d6a9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/endpoints_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, or - table object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity.py deleted file mode 100644 index f526b986fc70..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity_py3.py deleted file mode 100644 index 22d25fdd85b7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/identity_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs) -> None: - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py deleted file mode 100644 index fba0ad0623d3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2017_10_01.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.action = kwargs.get('action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule_py3.py deleted file mode 100644 index bd3688ccc8dd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/ip_rule_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2017_10_01.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = ip_address_or_range - self.action = action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties.py deleted file mode 100644 index 44eaf379f6f2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - self.key_version = kwargs.get('key_version', None) - self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties_py3.py deleted file mode 100644 index 9e6350eec898..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/key_vault_properties_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = key_name - self.key_version = key_version - self.key_vault_uri = key_vault_uri diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response.py deleted file mode 100644 index a56e959a34bd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response_py3.py deleted file mode 100644 index b8b9a314d9f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_account_sas_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response.py deleted file mode 100644 index d4ab160ae364..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response_py3.py deleted file mode 100644 index 7c20617658df..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/list_service_sas_response_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification.py deleted file mode 100644 index ccc70beb4672..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: list[~azure.mgmt.storage.v2017_10_01.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MetricSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.dimensions = kwargs.get('dimensions', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) - self.category = kwargs.get('category', None) - self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification_py3.py deleted file mode 100644 index c6bffaa6d061..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/metric_specification_py3.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: list[~azure.mgmt.storage.v2017_10_01.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: - super(MetricSpecification, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.dimensions = dimensions - self.aggregation_type = aggregation_type - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set.py deleted file mode 100644 index 0ccf88552835..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2017_10_01.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2017_10_01.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: list[~azure.mgmt.storage.v2017_10_01.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2017_10_01.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = kwargs.get('bypass', "AzureServices") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) - self.default_action = kwargs.get('default_action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set_py3.py deleted file mode 100644 index ac8fb83a6a69..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/network_rule_set_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2017_10_01.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2017_10_01.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: list[~azure.mgmt.storage.v2017_10_01.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2017_10_01.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = bypass - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules - self.default_action = default_action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation.py deleted file mode 100644 index 20ccef7197b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~azure.mgmt.storage.v2017_10_01.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2017_10_01.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display.py deleted file mode 100644 index 12d72186c4f2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display_py3.py deleted file mode 100644 index 632a6393c99f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_display_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_paged.py deleted file mode 100644 index 749373a7c233..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_py3.py deleted file mode 100644 index f7c827b4d135..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/operation_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~azure.mgmt.storage.v2017_10_01.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2017_10_01.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource.py deleted file mode 100644 index 125d6e4790b9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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): - """Describes a storage resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, 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'}, - '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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource_py3.py deleted file mode 100644 index 7c1ccbf3aae1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/resource_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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): - """Describes a storage resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, 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'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, location: str=None, 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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction.py deleted file mode 100644 index 049bdfb180dc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2017_10_01.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = kwargs.get('reason_code', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction_py3.py deleted file mode 100644 index b16d1f57e121..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/restriction_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2017_10_01.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, *, reason_code=None, **kwargs) -> None: - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = reason_code diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters.py deleted file mode 100644 index c66475b22cf2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters.py +++ /dev/null @@ -1,121 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: Required. The signed services accessible with the service - SAS. Possible values include: Blob (b), Container (c), File (f), Share - (s). Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2017_10_01.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2017_10_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = kwargs.get('canonicalized_resource', None) - self.resource = kwargs.get('resource', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.identifier = kwargs.get('identifier', None) - self.partition_key_start = kwargs.get('partition_key_start', None) - self.partition_key_end = kwargs.get('partition_key_end', None) - self.row_key_start = kwargs.get('row_key_start', None) - self.row_key_end = kwargs.get('row_key_end', None) - self.key_to_sign = kwargs.get('key_to_sign', None) - self.cache_control = kwargs.get('cache_control', None) - self.content_disposition = kwargs.get('content_disposition', None) - self.content_encoding = kwargs.get('content_encoding', None) - self.content_language = kwargs.get('content_language', None) - self.content_type = kwargs.get('content_type', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters_py3.py deleted file mode 100644 index 1847513768e7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_sas_parameters_py3.py +++ /dev/null @@ -1,121 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: Required. The signed services accessible with the service - SAS. Possible values include: Blob (b), Container (c), File (f), Share - (s). Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2017_10_01.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2017_10_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2017_10_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, *, canonicalized_resource: str, resource, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification.py deleted file mode 100644 index 19ffc2606edf..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2017_10_01.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, **kwargs): - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification_py3.py deleted file mode 100644 index e8f5e5d967ba..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/service_specification_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2017_10_01.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku.py deleted file mode 100644 index e6332d42e439..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - :type name: str or ~azure.mgmt.storage.v2017_10_01.models.SkuName - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2017_10_01.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'StorageV2', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified sku, - including file encryption, network acls, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2017_10_01.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2017_10_01.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = kwargs.get('restrictions', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability.py deleted file mode 100644 index b8fa68ce7778..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified sku, including file encryption, - network acls, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified sku, including file encryption, network acls, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability_py3.py deleted file mode 100644 index f349a08eda21..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_capability_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified sku, including file encryption, - network acls, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified sku, including file encryption, network acls, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_paged.py deleted file mode 100644 index 5e08f3c29b33..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 SkuPaged(Paged): - """ - A paging container for iterating over a list of :class:`Sku ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Sku]'} - } - - def __init__(self, *args, **kwargs): - - super(SkuPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_py3.py deleted file mode 100644 index 266d2791b110..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/sku_py3.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - :type name: str or ~azure.mgmt.storage.v2017_10_01.models.SkuName - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2017_10_01.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'StorageV2', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified sku, - including file encryption, network acls, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2017_10_01.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2017_10_01.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, *, name, restrictions=None, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = restrictions diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account.py deleted file mode 100644 index 59b7dc7c00d4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account.py +++ /dev/null @@ -1,165 +0,0 @@ -# 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 StorageAccount(Resource): - """The storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, str] - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2017_10_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'StorageV2', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2017_10_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2017_10_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2017_10_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2017_10_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2017_10_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2017_10_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2017_10_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'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'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, **kwargs): - super(StorageAccount, self).__init__(**kwargs) - self.sku = None - self.kind = None - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) - self.network_rule_set = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters.py deleted file mode 100644 index dbe41bb2c6b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, **kwargs): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters_py3.py deleted file mode 100644 index 8d2b031e2284..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_check_name_availability_parameters_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, *, name: str, **kwargs) -> None: - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters.py deleted file mode 100644 index 37cc4242b6a8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the sku name. - :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'StorageV2', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2017_10_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2017_10_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters_py3.py deleted file mode 100644 index 4e8178225042..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_create_parameters_py3.py +++ /dev/null @@ -1,91 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the sku name. - :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'StorageV2', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2017_10_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2017_10_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - } - - def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, **kwargs) -> None: - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.network_rule_set = network_rule_set - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key.py deleted file mode 100644 index 36c5ff08c17d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2017_10_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs): - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key_py3.py deleted file mode 100644 index 3213397ba2c1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_key_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2017_10_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result.py deleted file mode 100644 index 671855ba2ecb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2017_10_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs): - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result_py3.py deleted file mode 100644 index 663db15e442a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_list_keys_result_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2017_10_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_paged.py deleted file mode 100644 index ea4bb1a65fa3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 StorageAccountPaged(Paged): - """ - A paging container for iterating over a list of :class:`StorageAccount ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[StorageAccount]'} - } - - def __init__(self, *args, **kwargs): - - super(StorageAccountPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_py3.py deleted file mode 100644 index 418a34c39255..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_py3.py +++ /dev/null @@ -1,165 +0,0 @@ -# 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_py3 import Resource - - -class StorageAccount(Resource): - """The storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id - :vartype id: str - :ivar name: Resource name - :vartype name: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Tags assigned to a resource; can be used for viewing and - grouping a resource (across resource groups). - :type tags: dict[str, str] - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2017_10_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'StorageV2', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2017_10_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2017_10_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2017_10_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2017_10_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2017_10_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2017_10_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2017_10_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'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'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - } - - def __init__(self, *, location: str=None, tags=None, identity=None, enable_https_traffic_only: bool=False, **kwargs) -> None: - super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs) - self.sku = None - self.kind = None - self.identity = identity - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters.py deleted file mode 100644 index 6dba2135fdc7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters_py3.py deleted file mode 100644 index 6e06a071eba3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_regenerate_key_parameters_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = key_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters.py deleted file mode 100644 index 7e4d7d66f97c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku - names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2017_10_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2017_10_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet - :param kind: Optional. Indicates the type of storage account. Currently - only StorageV2 value supported by server. Possible values include: - 'Storage', 'StorageV2', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - } - - def __init__(self, **kwargs): - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.kind = kwargs.get('kind', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters_py3.py deleted file mode 100644 index 757adf362e5b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/storage_account_update_parameters_py3.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku - names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2017_10_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2017_10_01.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2017_10_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2017_10_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2017_10_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2017_10_01.models.NetworkRuleSet - :param kind: Optional. Indicates the type of storage account. Currently - only StorageV2 value supported by server. Possible values include: - 'Storage', 'StorageV2', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2017_10_01.models.Kind - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - } - - def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, kind=None, **kwargs) -> None: - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = sku - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = network_rule_set - self.kind = kind diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage.py deleted file mode 100644 index 103482b94b0f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2017_10_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2017_10_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs): - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name.py deleted file mode 100644 index e4082bf52384..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name_py3.py deleted file mode 100644 index f519bb5072b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_name_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_paged.py deleted file mode 100644 index 7781ac14270e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 UsagePaged(Paged): - """ - A paging container for iterating over a list of :class:`Usage ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Usage]'} - } - - def __init__(self, *args, **kwargs): - - super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_py3.py deleted file mode 100644 index 8f40f289293a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/usage_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2017_10_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2017_10_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs) -> None: - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule.py deleted file mode 100644 index 23706c107a6f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2017_10_01.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2017_10_01.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) - self.action = kwargs.get('action', "Allow") - self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule_py3.py deleted file mode 100644 index 064d3c3e6730..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2017_10_01.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2017_10_01.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = virtual_network_resource_id - self.action = action - self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/__init__.py index 3334aa2f42e5..680a808d8d46 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/__init__.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .operations import Operations -from .skus_operations import SkusOperations -from .storage_accounts_operations import StorageAccountsOperations -from .usage_operations import UsageOperations +from ._operations import Operations +from ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._usage_operations import UsageOperations __all__ = [ 'Operations', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_operations.py new file mode 100644 index 000000000000..57fe047ebe7c --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_operations.py @@ -0,0 +1,102 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: 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 Storage 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 Operation + :rtype: + ~azure.mgmt.storage.v2017_10_01.models.OperationPaged[~azure.mgmt.storage.v2017_10_01.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_skus_operations.py new file mode 100644 index 000000000000..41d446584ad1 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_skus_operations.py @@ -0,0 +1,107 @@ +# 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 SkusOperations(object): + """SkusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: 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 the available SKUs supported by Microsoft.Storage for given + 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 Sku + :rtype: + ~azure.mgmt.storage.v2017_10_01.models.SkuPaged[~azure.mgmt.storage.v2017_10_01.models.Sku] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..94b469b7289a --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py @@ -0,0 +1,841 @@ +# 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 StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: 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 check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: The storage account name. + :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2017_10_01.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) + + # 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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCreateParameters + :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 StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2017_10_01.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2017_10_01.models.StorageAccountUpdateParameters + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2017_10_01.models.StorageAccountPaged[~azure.mgmt.storage.v2017_10_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2017_10_01.models.StorageAccountPaged[~azure.mgmt.storage.v2017_10_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + '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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: The name of storage keys that want to be regenerated, + possible values are key1, key2. + :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} + + def list_account_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials + for the storage account. + :type parameters: + ~azure.mgmt.storage.v2017_10_01.models.AccountSasParameters + :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: ListAccountSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListAccountSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_account_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'AccountSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListAccountSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} + + def list_service_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS + credentials. + :type parameters: + ~azure.mgmt.storage.v2017_10_01.models.ServiceSasParameters + :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: ListServiceSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListServiceSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_service_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + '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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'ServiceSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListServiceSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_usage_operations.py new file mode 100644 index 000000000000..1a23c3323f18 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_usage_operations.py @@ -0,0 +1,107 @@ +# 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 UsageOperations(object): + """UsageOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: 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): + """Gets the current usage count and the limit for the resources under the + 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 Usage + :rtype: + ~azure.mgmt.storage.v2017_10_01.models.UsagePaged[~azure.mgmt.storage.v2017_10_01.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/operations.py deleted file mode 100644 index fe098e3575ce..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/operations.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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: 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 Storage 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 Operation - :rtype: - ~azure.mgmt.storage.v2017_10_01.models.OperationPaged[~azure.mgmt.storage.v2017_10_01.models.Operation] - :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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.OperationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/skus_operations.py deleted file mode 100644 index b24932805644..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/skus_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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 SkusOperations(object): - """SkusOperations 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: 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 the available SKUs supported by Microsoft.Storage for given - 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 Sku - :rtype: - ~azure.mgmt.storage.v2017_10_01.models.SkuPaged[~azure.mgmt.storage.v2017_10_01.models.Sku] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.SkuPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/storage_accounts_operations.py deleted file mode 100644 index 4fd409a4ef09..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/storage_accounts_operations.py +++ /dev/null @@ -1,842 +0,0 @@ -# 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 StorageAccountsOperations(object): - """StorageAccountsOperations 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: 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 check_name_availability( - self, name, custom_headers=None, raw=False, **operation_config): - """Checks that the storage account name is valid and is not already in - use. - - :param name: The storage account name. - :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2017_10_01.models.CheckNameAvailabilityResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) - - # 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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('CheckNameAvailabilityResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} - - - def _create_initial( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountCreateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Asynchronously creates a new storage account with the specified - parameters. If an account is already created and a subsequent create - request is issued with different properties, the account properties - will be updated. If an account is already created and a subsequent - create or update request is issued with the exact same set of - properties, the request will succeed. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the created account. - :type parameters: - ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCreateParameters - :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 StorageAccount or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2017_10_01.models.StorageAccount] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2017_10_01.models.StorageAccount]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes a storage account in Microsoft Azure. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def get_properties( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Returns the properties for the specified storage account including but - not limited to name, SKU name, location, and account status. The - ListKeys operation should be used to retrieve storage keys. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def update( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """The update operation can be used to update the SKU, encryption, access - tier, or tags for a storage account. It can also be used to map the - account to a custom domain. Only one custom domain is supported per - storage account; the replacement/change of custom domain is not - supported. In order to replace an old custom domain, the old value must - be cleared/unregistered before a new value can be set. The update of - multiple properties is supported. This call does not change the storage - keys for the account. If you want to change the storage account keys, - use the regenerate keys operation. The location and name of the storage - account cannot be changed after creation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the updated account. - :type parameters: - ~azure.mgmt.storage.v2017_10_01.models.StorageAccountUpdateParameters - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2017_10_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the subscription. Note - that storage keys are not returned; use the ListKeys operation for - this. - - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2017_10_01.models.StorageAccountPaged[~azure.mgmt.storage.v2017_10_01.models.StorageAccount] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the given resource - group. Note that storage keys are not returned; use the ListKeys - operation for this. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2017_10_01.models.StorageAccountPaged[~azure.mgmt.storage.v2017_10_01.models.StorageAccount] - :raises: :class:`CloudError` - """ - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(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.Storage/storageAccounts'} - - def list_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} - - def regenerate_key( - self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerates one of the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param key_name: The name of storage keys that want to be regenerated, - possible values are key1, key2. - :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2017_10_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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_key1, 'StorageAccountRegenerateKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} - - def list_account_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List SAS credentials of a storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list SAS credentials - for the storage account. - :type parameters: - ~azure.mgmt.storage.v2017_10_01.models.AccountSasParameters - :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: ListAccountSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListAccountSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_account_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'AccountSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListAccountSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} - - def list_service_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List service SAS credentials of a specific resource. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list service SAS - credentials. - :type parameters: - ~azure.mgmt.storage.v2017_10_01.models.ServiceSasParameters - :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: ListServiceSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2017_10_01.models.ListServiceSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_service_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - '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("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'ServiceSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListServiceSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py deleted file mode 100644 index f743de91631d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/usage_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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 UsageOperations(object): - """UsageOperations 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: 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): - """Gets the current usage count and the limit for the resources under the - 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 Usage - :rtype: - ~azure.mgmt.storage.v2017_10_01.models.UsagePaged[~azure.mgmt.storage.v2017_10_01.models.Usage] - :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') - } - 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['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.UsagePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/storage_management_client.py deleted file mode 100644 index cc2712bd90b7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/storage_management_client.py +++ /dev/null @@ -1,100 +0,0 @@ -# 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.operations import Operations -from .operations.skus_operations import SkusOperations -from .operations.storage_accounts_operations import StorageAccountsOperations -from .operations.usage_operations import UsageOperations -from . import models - - -class StorageManagementClientConfiguration(AzureConfiguration): - """Configuration for StorageManagementClient - 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: Gets subscription credentials which uniquely - identify the Microsoft Azure subscription. The subscription ID forms part - of the URI for every service call. - :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(StorageManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class StorageManagementClient(SDKClient): - """The Azure Storage Management API. - - :ivar config: Configuration for client. - :vartype config: StorageManagementClientConfiguration - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.storage.v2017_10_01.operations.Operations - :ivar skus: Skus operations - :vartype skus: azure.mgmt.storage.v2017_10_01.operations.SkusOperations - :ivar storage_accounts: StorageAccounts operations - :vartype storage_accounts: azure.mgmt.storage.v2017_10_01.operations.StorageAccountsOperations - :ivar usage: Usage operations - :vartype usage: azure.mgmt.storage.v2017_10_01.operations.UsageOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: Gets subscription credentials which uniquely - identify the Microsoft Azure subscription. The subscription ID forms part - of the URI for every service call. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - super(StorageManagementClient, 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' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.skus = SkusOperations( - self._client, self.config, self._serialize, self._deserialize) - self.storage_accounts = StorageAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.usage = UsageOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/__init__.py index 0854715e0c10..da2c3f969e67 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient -from .version import VERSION +from ._configuration import StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] -__all__ = ['StorageManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_configuration.py new file mode 100644 index 000000000000..57fa5132dc82 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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 ID of the target subscription. + :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(StorageManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_storage_management_client.py new file mode 100644 index 000000000000..f0604b20db0e --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_storage_management_client.py @@ -0,0 +1,69 @@ +# 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 ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import UsageOperations +from .operations import BlobContainersOperations +from . import models + + +class StorageManagementClient(SDKClient): + """The Azure Storage Management API. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2018_02_01.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2018_02_01.operations.SkusOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2018_02_01.operations.StorageAccountsOperations + :ivar usage: Usage operations + :vartype usage: azure.mgmt.storage.v2018_02_01.operations.UsageOperations + :ivar blob_containers: BlobContainers operations + :vartype blob_containers: azure.mgmt.storage.v2018_02_01.operations.BlobContainersOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-02-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usage = UsageOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py index 310130e5455a..3eccafdcedb4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/__init__.py @@ -10,106 +10,106 @@ # -------------------------------------------------------------------------- try: - from .operation_display_py3 import OperationDisplay - from .dimension_py3 import Dimension - from .metric_specification_py3 import MetricSpecification - from .service_specification_py3 import ServiceSpecification - from .operation_py3 import Operation - from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters - from .sku_capability_py3 import SKUCapability - from .restriction_py3 import Restriction - from .sku_py3 import Sku - from .check_name_availability_result_py3 import CheckNameAvailabilityResult - from .custom_domain_py3 import CustomDomain - from .encryption_service_py3 import EncryptionService - from .encryption_services_py3 import EncryptionServices - from .key_vault_properties_py3 import KeyVaultProperties - from .encryption_py3 import Encryption - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - from .identity_py3 import Identity - from .storage_account_create_parameters_py3 import StorageAccountCreateParameters - from .endpoints_py3 import Endpoints - from .storage_account_py3 import StorageAccount - from .storage_account_key_py3 import StorageAccountKey - from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters - from .usage_name_py3 import UsageName - from .usage_py3 import Usage - from .account_sas_parameters_py3 import AccountSasParameters - from .list_account_sas_response_py3 import ListAccountSasResponse - from .service_sas_parameters_py3 import ServiceSasParameters - from .list_service_sas_response_py3 import ListServiceSasResponse - from .proxy_resource_py3 import ProxyResource - from .azure_entity_resource_py3 import AzureEntityResource - from .resource_py3 import Resource - from .tracked_resource_py3 import TrackedResource - from .update_history_property_py3 import UpdateHistoryProperty - from .immutability_policy_properties_py3 import ImmutabilityPolicyProperties - from .tag_property_py3 import TagProperty - from .legal_hold_properties_py3 import LegalHoldProperties - from .blob_container_py3 import BlobContainer - from .immutability_policy_py3 import ImmutabilityPolicy - from .legal_hold_py3 import LegalHold - from .list_container_item_py3 import ListContainerItem - from .list_container_items_py3 import ListContainerItems - from .lease_container_request_py3 import LeaseContainerRequest - from .lease_container_response_py3 import LeaseContainerResponse + from ._models_py3 import AccountSasParameters + from ._models_py3 import AzureEntityResource + from ._models_py3 import BlobContainer + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CustomDomain + from ._models_py3 import Dimension + from ._models_py3 import Encryption + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import Identity + from ._models_py3 import ImmutabilityPolicy + from ._models_py3 import ImmutabilityPolicyProperties + from ._models_py3 import IPRule + from ._models_py3 import KeyVaultProperties + from ._models_py3 import LeaseContainerRequest + from ._models_py3 import LeaseContainerResponse + from ._models_py3 import LegalHold + from ._models_py3 import LegalHoldProperties + from ._models_py3 import ListAccountSasResponse + from ._models_py3 import ListContainerItem + from ._models_py3 import ListContainerItems + from ._models_py3 import ListServiceSasResponse + from ._models_py3 import MetricSpecification + from ._models_py3 import NetworkRuleSet + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import Restriction + from ._models_py3 import ServiceSasParameters + from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SKUCapability + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import TagProperty + from ._models_py3 import TrackedResource + from ._models_py3 import UpdateHistoryProperty + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import VirtualNetworkRule except (SyntaxError, ImportError): - from .operation_display import OperationDisplay - from .dimension import Dimension - from .metric_specification import MetricSpecification - from .service_specification import ServiceSpecification - from .operation import Operation - from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters - from .sku_capability import SKUCapability - from .restriction import Restriction - from .sku import Sku - from .check_name_availability_result import CheckNameAvailabilityResult - from .custom_domain import CustomDomain - from .encryption_service import EncryptionService - from .encryption_services import EncryptionServices - from .key_vault_properties import KeyVaultProperties - from .encryption import Encryption - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - from .identity import Identity - from .storage_account_create_parameters import StorageAccountCreateParameters - from .endpoints import Endpoints - from .storage_account import StorageAccount - from .storage_account_key import StorageAccountKey - from .storage_account_list_keys_result import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters import StorageAccountUpdateParameters - from .usage_name import UsageName - from .usage import Usage - from .account_sas_parameters import AccountSasParameters - from .list_account_sas_response import ListAccountSasResponse - from .service_sas_parameters import ServiceSasParameters - from .list_service_sas_response import ListServiceSasResponse - from .proxy_resource import ProxyResource - from .azure_entity_resource import AzureEntityResource - from .resource import Resource - from .tracked_resource import TrackedResource - from .update_history_property import UpdateHistoryProperty - from .immutability_policy_properties import ImmutabilityPolicyProperties - from .tag_property import TagProperty - from .legal_hold_properties import LegalHoldProperties - from .blob_container import BlobContainer - from .immutability_policy import ImmutabilityPolicy - from .legal_hold import LegalHold - from .list_container_item import ListContainerItem - from .list_container_items import ListContainerItems - from .lease_container_request import LeaseContainerRequest - from .lease_container_response import LeaseContainerResponse -from .operation_paged import OperationPaged -from .sku_paged import SkuPaged -from .storage_account_paged import StorageAccountPaged -from .usage_paged import UsagePaged -from .storage_management_client_enums import ( + from ._models import AccountSasParameters + from ._models import AzureEntityResource + from ._models import BlobContainer + from ._models import CheckNameAvailabilityResult + from ._models import CustomDomain + from ._models import Dimension + from ._models import Encryption + from ._models import EncryptionService + from ._models import EncryptionServices + from ._models import Endpoints + from ._models import Identity + from ._models import ImmutabilityPolicy + from ._models import ImmutabilityPolicyProperties + from ._models import IPRule + from ._models import KeyVaultProperties + from ._models import LeaseContainerRequest + from ._models import LeaseContainerResponse + from ._models import LegalHold + from ._models import LegalHoldProperties + from ._models import ListAccountSasResponse + from ._models import ListContainerItem + from ._models import ListContainerItems + from ._models import ListServiceSasResponse + from ._models import MetricSpecification + from ._models import NetworkRuleSet + from ._models import Operation + from ._models import OperationDisplay + from ._models import ProxyResource + from ._models import Resource + from ._models import Restriction + from ._models import ServiceSasParameters + from ._models import ServiceSpecification + from ._models import Sku + from ._models import SKUCapability + from ._models import StorageAccount + from ._models import StorageAccountCheckNameAvailabilityParameters + from ._models import StorageAccountCreateParameters + from ._models import StorageAccountKey + from ._models import StorageAccountListKeysResult + from ._models import StorageAccountRegenerateKeyParameters + from ._models import StorageAccountUpdateParameters + from ._models import TagProperty + from ._models import TrackedResource + from ._models import UpdateHistoryProperty + from ._models import Usage + from ._models import UsageName + from ._models import VirtualNetworkRule +from ._paged_models import OperationPaged +from ._paged_models import SkuPaged +from ._paged_models import StorageAccountPaged +from ._paged_models import UsagePaged +from ._storage_management_client_enums import ( ReasonCode, SkuName, SkuTier, @@ -139,53 +139,53 @@ ) __all__ = [ - 'OperationDisplay', - 'Dimension', - 'MetricSpecification', - 'ServiceSpecification', - 'Operation', - 'StorageAccountCheckNameAvailabilityParameters', - 'SKUCapability', - 'Restriction', - 'Sku', + 'AccountSasParameters', + 'AzureEntityResource', + 'BlobContainer', 'CheckNameAvailabilityResult', 'CustomDomain', + 'Dimension', + 'Encryption', 'EncryptionService', 'EncryptionServices', - 'KeyVaultProperties', - 'Encryption', - 'VirtualNetworkRule', + 'Endpoints', + 'Identity', + 'ImmutabilityPolicy', + 'ImmutabilityPolicyProperties', 'IPRule', + 'KeyVaultProperties', + 'LeaseContainerRequest', + 'LeaseContainerResponse', + 'LegalHold', + 'LegalHoldProperties', + 'ListAccountSasResponse', + 'ListContainerItem', + 'ListContainerItems', + 'ListServiceSasResponse', + 'MetricSpecification', 'NetworkRuleSet', - 'Identity', - 'StorageAccountCreateParameters', - 'Endpoints', + 'Operation', + 'OperationDisplay', + 'ProxyResource', + 'Resource', + 'Restriction', + 'ServiceSasParameters', + 'ServiceSpecification', + 'Sku', + 'SKUCapability', 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', 'StorageAccountKey', 'StorageAccountListKeysResult', 'StorageAccountRegenerateKeyParameters', 'StorageAccountUpdateParameters', - 'UsageName', - 'Usage', - 'AccountSasParameters', - 'ListAccountSasResponse', - 'ServiceSasParameters', - 'ListServiceSasResponse', - 'ProxyResource', - 'AzureEntityResource', - 'Resource', + 'TagProperty', 'TrackedResource', 'UpdateHistoryProperty', - 'ImmutabilityPolicyProperties', - 'TagProperty', - 'LegalHoldProperties', - 'BlobContainer', - 'ImmutabilityPolicy', - 'LegalHold', - 'ListContainerItem', - 'ListContainerItems', - 'LeaseContainerRequest', - 'LeaseContainerResponse', + 'Usage', + 'UsageName', + 'VirtualNetworkRule', 'OperationPaged', 'SkuPaged', 'StorageAccountPaged', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models.py new file mode 100644 index 000000000000..3c33425c44d7 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models.py @@ -0,0 +1,2121 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2018_02_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2018_02_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BlobContainer, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2018_02_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2018_02_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2018_02_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_02_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + 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 immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2018_02_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.etag = None + self.update_history = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = kwargs.get('action', None) + self.lease_id = kwargs.get('lease_id', None) + self.break_period = kwargs.get('break_period', None) + self.lease_duration = kwargs.get('lease_duration', None) + self.proposed_lease_id = kwargs.get('proposed_lease_id', None) + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = kwargs.get('lease_id', None) + self.lease_time_seconds = kwargs.get('lease_time_seconds', None) + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + 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 has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2018_02_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, **kwargs): + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListContainerItems(Model): + """The list of blob containers. + + :param value: The list of blob containers. + :type value: + list[~azure.mgmt.storage.v2018_02_01.models.ListContainerItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + } + + def __init__(self, **kwargs): + super(ListContainerItems, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2018_02_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2018_02_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_02_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2018_02_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2018_02_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2018_02_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2018_02_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of 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(OperationDisplay, 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) + + +class ProxyResource(Resource): + """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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2018_02_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. + Possible values include: Blob (b), Container (c), File (f), Share (s). + Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2018_02_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2018_02_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2018_02_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2018_02_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2018_02_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2018_02_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class StorageAccount(TrackedResource): + """The storage account. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2018_02_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2018_02_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2018_02_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2018_02_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2018_02_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. Default value: False . + :type is_hns_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = None + self.is_hns_enabled = kwargs.get('is_hns_enabled', False) + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. Default value: False . + :type is_hns_enabled: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.is_hns_enabled = kwargs.get('is_hns_enabled', False) + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2018_02_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.kind = kwargs.get('kind', None) + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2018_02_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2018_02_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2018_02_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models_py3.py new file mode 100644 index 000000000000..37e0e73bcf40 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models_py3.py @@ -0,0 +1,2121 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2018_02_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2018_02_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(BlobContainer, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2018_02_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2018_02_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2018_02_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_02_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + 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 immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2018_02_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.etag = None + self.update_history = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, *, action, lease_id: str=None, break_period: int=None, lease_duration: int=None, proposed_lease_id: str=None, **kwargs) -> None: + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = action + self.lease_id = lease_id + self.break_period = break_period + self.lease_duration = lease_duration + self.proposed_lease_id = proposed_lease_id + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, *, lease_id: str=None, lease_time_seconds: str=None, **kwargs) -> None: + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = lease_id + self.lease_time_seconds = lease_time_seconds + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + 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 has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, *, tags, **kwargs) -> None: + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2018_02_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListContainerItems(Model): + """The list of blob containers. + + :param value: The list of blob containers. + :type value: + list[~azure.mgmt.storage.v2018_02_01.models.ListContainerItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ListContainerItems, self).__init__(**kwargs) + self.value = value + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2018_02_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2018_02_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_02_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2018_02_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2018_02_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2018_02_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2018_02_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of 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(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ProxyResource(Resource): + """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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2018_02_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. + Possible values include: Blob (b), Container (c), File (f), Share (s). + Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2018_02_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource=None, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2018_02_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2018_02_01.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2018_02_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2018_02_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2018_02_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class StorageAccount(TrackedResource): + """The storage account. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2018_02_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2018_02_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2018_02_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2018_02_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2018_02_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. Default value: False . + :type is_hns_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, enable_https_traffic_only: bool=False, is_hns_enabled: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None + self.is_hns_enabled = is_hns_enabled + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. Default value: False . + :type is_hns_enabled: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, is_hns_enabled: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + self.is_hns_enabled = is_hns_enabled + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2018_02_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2018_02_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_02_01.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, kind=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.kind = kind + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2018_02_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2018_02_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2018_02_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_paged_models.py new file mode 100644 index 000000000000..ac2063d37a0f --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_paged_models.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 msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class SkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`Sku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Sku]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuPaged, self).__init__(*args, **kwargs) +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_storage_management_client_enums.py similarity index 100% rename from sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_management_client_enums.py rename to sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_storage_management_client_enums.py diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters.py deleted file mode 100644 index 7acf3ff04e92..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2018_02_01.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2018_02_01.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_02_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AccountSasParameters, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.resource_types = kwargs.get('resource_types', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters_py3.py deleted file mode 100644 index 3d0bb4cd3adc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/account_sas_parameters_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2018_02_01.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2018_02_01.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_02_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: - super(AccountSasParameters, self).__init__(**kwargs) - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource.py deleted file mode 100644 index 3bffaab8d35b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource_py3.py deleted file mode 100644 index d3f80d87498a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/azure_entity_resource_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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_py3 import Resource - - -class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container.py deleted file mode 100644 index 96909e68f452..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class BlobContainer(AzureEntityResource): - """Properties of the blob container, including Id, resource name, resource - type, Etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_02_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_02_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(BlobContainer, self).__init__(**kwargs) - self.public_access = kwargs.get('public_access', None) - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = kwargs.get('metadata', None) - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container_py3.py deleted file mode 100644 index 2866795ab512..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/blob_container_py3.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class BlobContainer(AzureEntityResource): - """Properties of the blob container, including Id, resource name, resource - type, Etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_02_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_02_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: - super(BlobContainer, self).__init__(**kwargs) - self.public_access = public_access - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = metadata - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result.py deleted file mode 100644 index d4fdcfdf8589..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2018_02_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result_py3.py deleted file mode 100644 index 41a2fada1f87..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/check_name_availability_result_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2018_02_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain.py deleted file mode 100644 index d5cc10da36cb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(CustomDomain, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain_py3.py deleted file mode 100644 index 25dce0b57aee..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/custom_domain_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: - super(CustomDomain, self).__init__(**kwargs) - self.name = name - self.use_sub_domain_name = use_sub_domain_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension.py deleted file mode 100644 index 2398aa46e8f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Dimension, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension_py3.py deleted file mode 100644 index af5b0aac3d23..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/dimension_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: - super(Dimension, self).__init__(**kwargs) - self.name = name - self.display_name = display_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption.py deleted file mode 100644 index c9fcc801ead9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2018_02_01.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or ~azure.mgmt.storage.v2018_02_01.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2018_02_01.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, **kwargs): - super(Encryption, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.key_source = kwargs.get('key_source', "Microsoft.Storage") - self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_py3.py deleted file mode 100644 index d4f941b70bff..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2018_02_01.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or ~azure.mgmt.storage.v2018_02_01.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2018_02_01.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: - super(Encryption, self).__init__(**kwargs) - self.services = services - self.key_source = key_source - self.key_vault_properties = key_vault_properties diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service.py deleted file mode 100644 index 3a020c468f64..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(EncryptionService, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service_py3.py deleted file mode 100644 index 0566050c6155..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_service_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, enabled: bool=None, **kwargs) -> None: - super(EncryptionService, self).__init__(**kwargs) - self.enabled = enabled - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services.py deleted file mode 100644 index e47d51e5e2ef..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, **kwargs): - super(EncryptionServices, self).__init__(**kwargs) - self.blob = kwargs.get('blob', None) - self.file = kwargs.get('file', None) - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services_py3.py deleted file mode 100644 index 02f2f95c73ee..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/encryption_services_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2018_02_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, *, blob=None, file=None, **kwargs) -> None: - super(EncryptionServices, self).__init__(**kwargs) - self.blob = blob - self.file = file - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints.py deleted file mode 100644 index 66b1c3459a5e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, - table, web or dfs object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - :ivar web: Gets the web endpoint. - :vartype web: str - :ivar dfs: Gets the dfs endpoint. - :vartype dfs: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - 'web': {'readonly': True}, - 'dfs': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - 'web': {'key': 'web', 'type': 'str'}, - 'dfs': {'key': 'dfs', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None - self.web = None - self.dfs = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints_py3.py deleted file mode 100644 index ced561acd85b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/endpoints_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, - table, web or dfs object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - :ivar web: Gets the web endpoint. - :vartype web: str - :ivar dfs: Gets the dfs endpoint. - :vartype dfs: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - 'web': {'readonly': True}, - 'dfs': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - 'web': {'key': 'web', 'type': 'str'}, - 'dfs': {'key': 'dfs', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None - self.web = None - self.dfs = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity.py deleted file mode 100644 index f526b986fc70..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity_py3.py deleted file mode 100644 index 22d25fdd85b7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/identity_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs) -> None: - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy.py deleted file mode 100644 index 2b8eb01dea0f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class ImmutabilityPolicy(AzureEntityResource): - """The ImmutabilityPolicy property of a blob container, including Id, resource - name, resource type, Etag. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImmutabilityPolicy, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) - self.state = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties.py deleted file mode 100644 index 60d6e13f0c05..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 ImmutabilityPolicyProperties(Model): - """The properties of an ImmutabilityPolicy of a blob container. - - 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 immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState - :ivar etag: ImmutabilityPolicy Etag. - :vartype etag: str - :ivar update_history: The ImmutabilityPolicy update history of the blob - container. - :vartype update_history: - list[~azure.mgmt.storage.v2018_02_01.models.UpdateHistoryProperty] - """ - - _validation = { - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - 'etag': {'readonly': True}, - 'update_history': {'readonly': True}, - } - - _attribute_map = { - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, - } - - def __init__(self, **kwargs): - super(ImmutabilityPolicyProperties, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) - self.state = None - self.etag = None - self.update_history = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties_py3.py deleted file mode 100644 index 3f0434d3c7c7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_properties_py3.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 ImmutabilityPolicyProperties(Model): - """The properties of an ImmutabilityPolicy of a blob container. - - 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 immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState - :ivar etag: ImmutabilityPolicy Etag. - :vartype etag: str - :ivar update_history: The ImmutabilityPolicy update history of the blob - container. - :vartype update_history: - list[~azure.mgmt.storage.v2018_02_01.models.UpdateHistoryProperty] - """ - - _validation = { - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - 'etag': {'readonly': True}, - 'update_history': {'readonly': True}, - } - - _attribute_map = { - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, - } - - def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: - super(ImmutabilityPolicyProperties, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days - self.state = None - self.etag = None - self.update_history = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_py3.py deleted file mode 100644 index 443d619aebb4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/immutability_policy_py3.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class ImmutabilityPolicy(AzureEntityResource): - """The ImmutabilityPolicy property of a blob container, including Id, resource - name, resource type, Etag. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: - super(ImmutabilityPolicy, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days - self.state = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule.py deleted file mode 100644 index cd2416118e59..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.action = kwargs.get('action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule_py3.py deleted file mode 100644 index 34516b5233c0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/ip_rule_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = ip_address_or_range - self.action = action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties.py deleted file mode 100644 index 44eaf379f6f2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - self.key_version = kwargs.get('key_version', None) - self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties_py3.py deleted file mode 100644 index 9e6350eec898..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/key_vault_properties_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = key_name - self.key_version = key_version - self.key_vault_uri = key_vault_uri diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/lease_container_request.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/lease_container_request.py deleted file mode 100644 index 77fb6929b8fa..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/lease_container_request.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 LeaseContainerRequest(Model): - """Lease Container request schema. - - All required parameters must be populated in order to send to Azure. - - :param action: Required. Specifies the lease action. Can be one of the - available actions. Possible values include: 'Acquire', 'Renew', 'Change', - 'Release', 'Break' - :type action: str or ~azure.mgmt.storage.v2018_02_01.models.enum - :param lease_id: Identifies the lease. Can be specified in any valid GUID - string format. - :type lease_id: str - :param break_period: Optional. For a break action, proposed duration the - lease should continue before it is broken, in seconds, between 0 and 60. - :type break_period: int - :param lease_duration: Required for acquire. Specifies the duration of the - lease, in seconds, or negative one (-1) for a lease that never expires. - :type lease_duration: int - :param proposed_lease_id: Optional for acquire, required for change. - Proposed lease ID, in a GUID string format. - :type proposed_lease_id: str - """ - - _validation = { - 'action': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'break_period': {'key': 'breakPeriod', 'type': 'int'}, - 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, - 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LeaseContainerRequest, self).__init__(**kwargs) - self.action = kwargs.get('action', None) - self.lease_id = kwargs.get('lease_id', None) - self.break_period = kwargs.get('break_period', None) - self.lease_duration = kwargs.get('lease_duration', None) - self.proposed_lease_id = kwargs.get('proposed_lease_id', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/lease_container_request_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/lease_container_request_py3.py deleted file mode 100644 index 2708ec47e7c1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/lease_container_request_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 LeaseContainerRequest(Model): - """Lease Container request schema. - - All required parameters must be populated in order to send to Azure. - - :param action: Required. Specifies the lease action. Can be one of the - available actions. Possible values include: 'Acquire', 'Renew', 'Change', - 'Release', 'Break' - :type action: str or ~azure.mgmt.storage.v2018_02_01.models.enum - :param lease_id: Identifies the lease. Can be specified in any valid GUID - string format. - :type lease_id: str - :param break_period: Optional. For a break action, proposed duration the - lease should continue before it is broken, in seconds, between 0 and 60. - :type break_period: int - :param lease_duration: Required for acquire. Specifies the duration of the - lease, in seconds, or negative one (-1) for a lease that never expires. - :type lease_duration: int - :param proposed_lease_id: Optional for acquire, required for change. - Proposed lease ID, in a GUID string format. - :type proposed_lease_id: str - """ - - _validation = { - 'action': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'break_period': {'key': 'breakPeriod', 'type': 'int'}, - 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, - 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, - } - - def __init__(self, *, action, lease_id: str=None, break_period: int=None, lease_duration: int=None, proposed_lease_id: str=None, **kwargs) -> None: - super(LeaseContainerRequest, self).__init__(**kwargs) - self.action = action - self.lease_id = lease_id - self.break_period = break_period - self.lease_duration = lease_duration - self.proposed_lease_id = proposed_lease_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/lease_container_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/lease_container_response.py deleted file mode 100644 index 666f0e899f1e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/lease_container_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 LeaseContainerResponse(Model): - """Lease Container response schema. - - :param lease_id: Returned unique lease ID that must be included with any - request to delete the container, or to renew, change, or release the - lease. - :type lease_id: str - :param lease_time_seconds: Approximate time remaining in the lease period, - in seconds. - :type lease_time_seconds: str - """ - - _attribute_map = { - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LeaseContainerResponse, self).__init__(**kwargs) - self.lease_id = kwargs.get('lease_id', None) - self.lease_time_seconds = kwargs.get('lease_time_seconds', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/lease_container_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/lease_container_response_py3.py deleted file mode 100644 index fa87d930571d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/lease_container_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 LeaseContainerResponse(Model): - """Lease Container response schema. - - :param lease_id: Returned unique lease ID that must be included with any - request to delete the container, or to renew, change, or release the - lease. - :type lease_id: str - :param lease_time_seconds: Approximate time remaining in the lease period, - in seconds. - :type lease_time_seconds: str - """ - - _attribute_map = { - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, - } - - def __init__(self, *, lease_id: str=None, lease_time_seconds: str=None, **kwargs) -> None: - super(LeaseContainerResponse, self).__init__(**kwargs) - self.lease_id = lease_id - self.lease_time_seconds = lease_time_seconds diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold.py deleted file mode 100644 index 4eb93df1d9fe..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 LegalHold(Model): - """The LegalHold property of a blob container. - - 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 has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: Required. Each tag should be 3 to 23 alphanumeric characters - and is normalized to lower case at SRP. - :type tags: list[str] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - 'tags': {'required': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(LegalHold, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = kwargs.get('tags', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties.py deleted file mode 100644 index 1c018f0b0940..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 LegalHoldProperties(Model): - """The LegalHold property of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: The list of LegalHold tags of a blob container. - :type tags: list[~azure.mgmt.storage.v2018_02_01.models.TagProperty] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[TagProperty]'}, - } - - def __init__(self, **kwargs): - super(LegalHoldProperties, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = kwargs.get('tags', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties_py3.py deleted file mode 100644 index 5dd782fdd092..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_properties_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 LegalHoldProperties(Model): - """The LegalHold property of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: The list of LegalHold tags of a blob container. - :type tags: list[~azure.mgmt.storage.v2018_02_01.models.TagProperty] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[TagProperty]'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(LegalHoldProperties, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = tags diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_py3.py deleted file mode 100644 index a4bc196cb604..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/legal_hold_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 LegalHold(Model): - """The LegalHold property of a blob container. - - 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 has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: Required. Each tag should be 3 to 23 alphanumeric characters - and is normalized to lower case at SRP. - :type tags: list[str] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - 'tags': {'required': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - } - - def __init__(self, *, tags, **kwargs) -> None: - super(LegalHold, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = tags diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response.py deleted file mode 100644 index a56e959a34bd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response_py3.py deleted file mode 100644 index b8b9a314d9f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_account_sas_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item.py deleted file mode 100644 index f6a50512740f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item.py +++ /dev/null @@ -1,118 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class ListContainerItem(AzureEntityResource): - """The blob container properties be listed out. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_02_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_02_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(ListContainerItem, self).__init__(**kwargs) - self.public_access = kwargs.get('public_access', None) - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = kwargs.get('metadata', None) - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item_py3.py deleted file mode 100644 index 2acbd2044e88..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_item_py3.py +++ /dev/null @@ -1,118 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class ListContainerItem(AzureEntityResource): - """The blob container properties be listed out. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_02_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_02_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_02_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_02_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_02_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: - super(ListContainerItem, self).__init__(**kwargs) - self.public_access = public_access - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = metadata - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items.py deleted file mode 100644 index 84fd5aa03307..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ListContainerItems(Model): - """The list of blob containers. - - :param value: The list of blob containers. - :type value: - list[~azure.mgmt.storage.v2018_02_01.models.ListContainerItem] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ListContainerItem]'}, - } - - def __init__(self, **kwargs): - super(ListContainerItems, self).__init__(**kwargs) - self.value = kwargs.get('value', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items_py3.py deleted file mode 100644 index a9ad58faf3d8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_container_items_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ListContainerItems(Model): - """The list of blob containers. - - :param value: The list of blob containers. - :type value: - list[~azure.mgmt.storage.v2018_02_01.models.ListContainerItem] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ListContainerItem]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(ListContainerItems, self).__init__(**kwargs) - self.value = value diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response.py deleted file mode 100644 index d4ab160ae364..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response_py3.py deleted file mode 100644 index 7c20617658df..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/list_service_sas_response_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification.py deleted file mode 100644 index 79d318a41660..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: list[~azure.mgmt.storage.v2018_02_01.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MetricSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.dimensions = kwargs.get('dimensions', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) - self.category = kwargs.get('category', None) - self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification_py3.py deleted file mode 100644 index b0d40efc543a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/metric_specification_py3.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: list[~azure.mgmt.storage.v2018_02_01.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: - super(MetricSpecification, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.dimensions = dimensions - self.aggregation_type = aggregation_type - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set.py deleted file mode 100644 index c9a546c136e2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2018_02_01.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2018_02_01.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: list[~azure.mgmt.storage.v2018_02_01.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2018_02_01.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = kwargs.get('bypass', "AzureServices") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) - self.default_action = kwargs.get('default_action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set_py3.py deleted file mode 100644 index 58b08a0e1419..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/network_rule_set_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2018_02_01.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2018_02_01.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: list[~azure.mgmt.storage.v2018_02_01.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2018_02_01.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = bypass - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules - self.default_action = default_action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation.py deleted file mode 100644 index 37982657dc4d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~azure.mgmt.storage.v2018_02_01.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2018_02_01.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display.py deleted file mode 100644 index 029cfa2a8304..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of 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(OperationDisplay, 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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display_py3.py deleted file mode 100644 index 318ba2236d3e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_display_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of 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(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_paged.py deleted file mode 100644 index 826e80757e1f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_py3.py deleted file mode 100644 index 8e12d0d37abc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/operation_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~azure.mgmt.storage.v2018_02_01.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2018_02_01.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource.py deleted file mode 100644 index 0de8fb6bd420..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 ProxyResource(Resource): - """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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource_py3.py deleted file mode 100644 index 2e8391f912d6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/proxy_resource_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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_py3 import Resource - - -class ProxyResource(Resource): - """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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource.py deleted file mode 100644 index 9333a2ac49ef..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource_py3.py deleted file mode 100644 index 370e6c506581..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/resource_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction.py deleted file mode 100644 index cf31a04598b9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2018_02_01.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = kwargs.get('reason_code', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction_py3.py deleted file mode 100644 index e88e4e13b885..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/restriction_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2018_02_01.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, *, reason_code=None, **kwargs) -> None: - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = reason_code diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters.py deleted file mode 100644 index 2cf950d00a67..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters.py +++ /dev/null @@ -1,120 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2018_02_01.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_02_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = kwargs.get('canonicalized_resource', None) - self.resource = kwargs.get('resource', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.identifier = kwargs.get('identifier', None) - self.partition_key_start = kwargs.get('partition_key_start', None) - self.partition_key_end = kwargs.get('partition_key_end', None) - self.row_key_start = kwargs.get('row_key_start', None) - self.row_key_end = kwargs.get('row_key_end', None) - self.key_to_sign = kwargs.get('key_to_sign', None) - self.cache_control = kwargs.get('cache_control', None) - self.content_disposition = kwargs.get('content_disposition', None) - self.content_encoding = kwargs.get('content_encoding', None) - self.content_language = kwargs.get('content_language', None) - self.content_type = kwargs.get('content_type', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters_py3.py deleted file mode 100644 index 335dc52607d2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_sas_parameters_py3.py +++ /dev/null @@ -1,120 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2018_02_01.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_02_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_02_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, *, canonicalized_resource: str, resource=None, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification.py deleted file mode 100644 index a2cdf93ecdeb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2018_02_01.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, **kwargs): - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification_py3.py deleted file mode 100644 index aadc0db02787..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/service_specification_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2018_02_01.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku.py deleted file mode 100644 index 51535cde8139..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - :type name: str or ~azure.mgmt.storage.v2018_02_01.models.SkuName - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2018_02_01.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'StorageV2', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified sku, - including file encryption, network acls, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2018_02_01.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2018_02_01.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = kwargs.get('restrictions', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability.py deleted file mode 100644 index b8fa68ce7778..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified sku, including file encryption, - network acls, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified sku, including file encryption, network acls, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability_py3.py deleted file mode 100644 index f349a08eda21..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_capability_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified sku, including file encryption, - network acls, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified sku, including file encryption, network acls, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_paged.py deleted file mode 100644 index 17028976705a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 SkuPaged(Paged): - """ - A paging container for iterating over a list of :class:`Sku ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Sku]'} - } - - def __init__(self, *args, **kwargs): - - super(SkuPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_py3.py deleted file mode 100644 index de133a47a6ff..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/sku_py3.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - :type name: str or ~azure.mgmt.storage.v2018_02_01.models.SkuName - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2018_02_01.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'StorageV2', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified sku, - including file encryption, network acls, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2018_02_01.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2018_02_01.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, *, name, restrictions=None, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = restrictions diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account.py deleted file mode 100644 index bf4ff50b74af..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account.py +++ /dev/null @@ -1,174 +0,0 @@ -# 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 .tracked_resource import TrackedResource - - -class StorageAccount(TrackedResource): - """The storage account. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2018_02_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'StorageV2', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2018_02_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2018_02_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2018_02_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2018_02_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2018_02_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2018_02_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2018_02_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. Default value: False . - :type is_hns_enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccount, self).__init__(**kwargs) - self.sku = None - self.kind = None - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) - self.network_rule_set = None - self.is_hns_enabled = kwargs.get('is_hns_enabled', False) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters.py deleted file mode 100644 index dbe41bb2c6b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, **kwargs): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters_py3.py deleted file mode 100644 index 8d2b031e2284..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_check_name_availability_parameters_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, *, name: str, **kwargs) -> None: - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters.py deleted file mode 100644 index 782aa7d115b0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters.py +++ /dev/null @@ -1,96 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the sku name. - :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'StorageV2', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_02_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. Default value: False . - :type is_hns_enabled: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) - self.is_hns_enabled = kwargs.get('is_hns_enabled', False) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters_py3.py deleted file mode 100644 index 3b2f54b9e604..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_create_parameters_py3.py +++ /dev/null @@ -1,96 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the sku name. - :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'StorageV2', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_02_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. Default value: False . - :type is_hns_enabled: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, is_hns_enabled: bool=False, **kwargs) -> None: - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.network_rule_set = network_rule_set - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only - self.is_hns_enabled = is_hns_enabled diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key.py deleted file mode 100644 index 991103a56300..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2018_02_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs): - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key_py3.py deleted file mode 100644 index 3dfbadc6938c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_key_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2018_02_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result.py deleted file mode 100644 index 7c9a1133e1f0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2018_02_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs): - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result_py3.py deleted file mode 100644 index 725a2e529a81..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_list_keys_result_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2018_02_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_paged.py deleted file mode 100644 index 7097a3ea95e1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 StorageAccountPaged(Paged): - """ - A paging container for iterating over a list of :class:`StorageAccount ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[StorageAccount]'} - } - - def __init__(self, *args, **kwargs): - - super(StorageAccountPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_py3.py deleted file mode 100644 index 66cced1e445a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_py3.py +++ /dev/null @@ -1,174 +0,0 @@ -# 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 .tracked_resource_py3 import TrackedResource - - -class StorageAccount(TrackedResource): - """The storage account. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2018_02_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'StorageV2', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2018_02_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2018_02_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2018_02_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2018_02_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2018_02_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2018_02_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2018_02_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. Default value: False . - :type is_hns_enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, *, location: str, tags=None, identity=None, enable_https_traffic_only: bool=False, is_hns_enabled: bool=False, **kwargs) -> None: - super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) - self.sku = None - self.kind = None - self.identity = identity - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = None - self.is_hns_enabled = is_hns_enabled diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters.py deleted file mode 100644 index 6dba2135fdc7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters_py3.py deleted file mode 100644 index 6e06a071eba3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_regenerate_key_parameters_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = key_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters.py deleted file mode 100644 index 1bbf8c2f58a1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku - names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_02_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet - :param kind: Optional. Indicates the type of storage account. Currently - only StorageV2 value supported by server. Possible values include: - 'Storage', 'StorageV2', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - } - - def __init__(self, **kwargs): - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.kind = kwargs.get('kind', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters_py3.py deleted file mode 100644 index b361d85fc5f9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/storage_account_update_parameters_py3.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku - names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2018_02_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_02_01.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2018_02_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2018_02_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_02_01.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_02_01.models.NetworkRuleSet - :param kind: Optional. Indicates the type of storage account. Currently - only StorageV2 value supported by server. Possible values include: - 'Storage', 'StorageV2', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_02_01.models.Kind - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - } - - def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, kind=None, **kwargs) -> None: - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = sku - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = network_rule_set - self.kind = kind diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property.py deleted file mode 100644 index 3b879061fd2b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 TagProperty(Model): - """A tag of the LegalHold of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tag: The tag value. - :vartype tag: str - :ivar timestamp: Returns the date and time the tag was added. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who added the - tag. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who added the tag. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who added the tag. - :vartype upn: str - """ - - _validation = { - 'tag': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'tag': {'key': 'tag', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TagProperty, self).__init__(**kwargs) - self.tag = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property_py3.py deleted file mode 100644 index 22aaf6cb82ba..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tag_property_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 TagProperty(Model): - """A tag of the LegalHold of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tag: The tag value. - :vartype tag: str - :ivar timestamp: Returns the date and time the tag was added. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who added the - tag. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who added the tag. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who added the tag. - :vartype upn: str - """ - - _validation = { - 'tag': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'tag': {'key': 'tag', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(TagProperty, self).__init__(**kwargs) - self.tag = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource.py deleted file mode 100644 index 27ab94c7a8dd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 TrackedResource(Resource): - """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs.get('location', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource_py3.py deleted file mode 100644 index b28cc1859448..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/tracked_resource_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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_py3 import Resource - - -class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property.py deleted file mode 100644 index e45713204822..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 UpdateHistoryProperty(Model): - """An update history of the ImmutabilityPolicy of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar update: The ImmutabilityPolicy update type of a blob container, - possible values include: put, lock and extend. Possible values include: - 'put', 'lock', 'extend' - :vartype update: str or - ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyUpdateType - :ivar immutability_period_since_creation_in_days: The immutability period - for the blobs in the container since the policy creation, in days. - :vartype immutability_period_since_creation_in_days: int - :ivar timestamp: Returns the date and time the ImmutabilityPolicy was - updated. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who updated the - ImmutabilityPolicy. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who updated the ImmutabilityPolicy. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who updated the - ImmutabilityPolicy. - :vartype upn: str - """ - - _validation = { - 'update': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'update': {'key': 'update', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UpdateHistoryProperty, self).__init__(**kwargs) - self.update = None - self.immutability_period_since_creation_in_days = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property_py3.py deleted file mode 100644 index b5b4964e9fde..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/update_history_property_py3.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 UpdateHistoryProperty(Model): - """An update history of the ImmutabilityPolicy of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar update: The ImmutabilityPolicy update type of a blob container, - possible values include: put, lock and extend. Possible values include: - 'put', 'lock', 'extend' - :vartype update: str or - ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicyUpdateType - :ivar immutability_period_since_creation_in_days: The immutability period - for the blobs in the container since the policy creation, in days. - :vartype immutability_period_since_creation_in_days: int - :ivar timestamp: Returns the date and time the ImmutabilityPolicy was - updated. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who updated the - ImmutabilityPolicy. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who updated the ImmutabilityPolicy. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who updated the - ImmutabilityPolicy. - :vartype upn: str - """ - - _validation = { - 'update': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'update': {'key': 'update', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UpdateHistoryProperty, self).__init__(**kwargs) - self.update = None - self.immutability_period_since_creation_in_days = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage.py deleted file mode 100644 index 2668cb716b16..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2018_02_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2018_02_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs): - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name.py deleted file mode 100644 index e4082bf52384..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name_py3.py deleted file mode 100644 index f519bb5072b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_name_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_paged.py deleted file mode 100644 index b681564312e9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 UsagePaged(Paged): - """ - A paging container for iterating over a list of :class:`Usage ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Usage]'} - } - - def __init__(self, *args, **kwargs): - - super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_py3.py deleted file mode 100644 index eb7bbdc2f151..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/usage_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2018_02_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2018_02_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs) -> None: - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule.py deleted file mode 100644 index f8c08b6000e0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2018_02_01.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) - self.action = kwargs.get('action', "Allow") - self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule_py3.py deleted file mode 100644 index 43673a374a5b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_02_01.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2018_02_01.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = virtual_network_resource_id - self.action = action - self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/__init__.py index b9b73b2babc4..ce6423c7697b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/__init__.py @@ -9,11 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .operations import Operations -from .skus_operations import SkusOperations -from .storage_accounts_operations import StorageAccountsOperations -from .usage_operations import UsageOperations -from .blob_containers_operations import BlobContainersOperations +from ._operations import Operations +from ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._usage_operations import UsageOperations +from ._blob_containers_operations import BlobContainersOperations __all__ = [ 'Operations', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_blob_containers_operations.py new file mode 100644 index 000000000000..1e66e0057155 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_blob_containers_operations.py @@ -0,0 +1,1118 @@ +# 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 BlobContainersOperations(object): + """BlobContainersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-02-01". + :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + self.immutability_policy_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists all containers and does not support a prefix like data plane. + Also SRP today does not return continuation token. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: ListContainerItems or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListContainerItems or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('ListContainerItems', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} + + def create( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Creates a new container under the specified account as described by + request body. The container resource includes metadata and properties + for that container. It does not include a list of the blobs contained + by the container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def update( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Updates container properties as specified in request body. Properties + not mentioned in the request will be unchanged. Update fails if the + specified container doesn't already exist. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_02_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def get( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Gets properties of a specified container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_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: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def delete( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Deletes specified container under its account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def set_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Sets legal hold tags. Setting the same tag results in an idempotent + operation. SetLegalHold follows an append pattern and does not clear + out the existing tags that are not specified in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.set_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} + + def clear_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Clears legal hold tags. Clearing the same or non-existent tag results + in an idempotent operation. ClearLegalHold clears out only the + specified tags in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.clear_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} + + def create_or_update_immutability_policy( + self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an unlocked immutability policy. ETag in If-Match is + honored if given but not required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.create_or_update_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def get_immutability_policy( + self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): + """Gets the existing immutability policy along with the corresponding ETag + in response headers and body. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def delete_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Aborts an unlocked immutability policy. The response of delete has + immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is + required for this operation. Deleting a locked immutability policy is + not allowed, only way is to delete the container after deleting all + blobs inside the container. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def lock_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Sets the ImmutabilityPolicy to Locked state. The only action allowed on + a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is + required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lock_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} + + def extend_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): + """Extends the immutabilityPeriodSinceCreationInDays of a locked + immutabilityPolicy. The only action allowed on a Locked policy will be + this action. ETag in If-Match is required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.extend_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} + + def lease( + self, resource_group_name, account_name, container_name, parameters=None, custom_headers=None, raw=False, **operation_config): + """The Lease Container operation establishes and manages a lock on a + container for delete operations. The lock duration can be 15 to 60 + seconds, or can be infinite. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param parameters: Lease Container request body. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.LeaseContainerRequest + :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: LeaseContainerResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.LeaseContainerResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lease.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseContainerRequest') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LeaseContainerResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_operations.py new file mode 100644 index 000000000000..527953dd70b4 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_operations.py @@ -0,0 +1,102 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Storage 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 Operation + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.OperationPaged[~azure.mgmt.storage.v2018_02_01.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_skus_operations.py new file mode 100644 index 000000000000..7ba480c97eac --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_skus_operations.py @@ -0,0 +1,107 @@ +# 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 SkusOperations(object): + """SkusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the available SKUs supported by Microsoft.Storage for given + 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 Sku + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.SkuPaged[~azure.mgmt.storage.v2018_02_01.models.Sku] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..85fab580af75 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_storage_accounts_operations.py @@ -0,0 +1,841 @@ +# 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 StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: The storage account name. + :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) + + # 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', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountCreateParameters + :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 StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2018_02_01.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2018_02_01.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountUpdateParameters + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_02_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_02_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: The name of storage keys that want to be regenerated, + possible values are key1, key2. + :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} + + def list_account_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials + for the storage account. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.AccountSasParameters + :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: ListAccountSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListAccountSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_account_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'AccountSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListAccountSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} + + def list_service_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS + credentials. + :type parameters: + ~azure.mgmt.storage.v2018_02_01.models.ServiceSasParameters + :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: ListServiceSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListServiceSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_service_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'ServiceSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListServiceSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_usage_operations.py new file mode 100644 index 000000000000..e71c9302e295 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_usage_operations.py @@ -0,0 +1,177 @@ +# 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 UsageOperations(object): + """UsageOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources under the + 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 Usage + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.UsagePaged[~azure.mgmt.storage.v2018_02_01.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} + + def list_by_location( + self, location, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources of the + location under the subscription. + + :param location: The location of the Azure Storage resource. + :type location: 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 Usage + :rtype: + ~azure.mgmt.storage.v2018_02_01.models.UsagePaged[~azure.mgmt.storage.v2018_02_01.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, '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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/blob_containers_operations.py deleted file mode 100644 index de7148005453..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/blob_containers_operations.py +++ /dev/null @@ -1,1128 +0,0 @@ -# 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 BlobContainersOperations(object): - """BlobContainersOperations 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 API version to use for this operation. Constant value: "2018-02-01". - :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-02-01" - self.immutability_policy_name = "default" - - self.config = config - - def list( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists all containers and does not support a prefix like data plane. - Also SRP today does not return continuation token. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: ListContainerItems or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListContainerItems or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('ListContainerItems', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} - - def create( - self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): - """Creates a new container under the specified account as described by - request body. The container resource includes metadata and properties - for that container. It does not include a list of the blobs contained - by the container. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_02_01.models.PublicAccess - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: 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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) - - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(blob_container, 'BlobContainer') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def update( - self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): - """Updates container properties as specified in request body. Properties - not mentioned in the request will be unchanged. Update fails if the - specified container doesn't already exist. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_02_01.models.PublicAccess - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: 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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(blob_container, 'BlobContainer') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def get( - self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): - """Gets properties of a specified container. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_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: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.BlobContainer or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def delete( - self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): - """Deletes specified container under its account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def set_legal_hold( - self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): - """Sets legal hold tags. Setting the same tag results in an idempotent - operation. SetLegalHold follows an append pattern and does not clear - out the existing tags that are not specified in the request. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param tags: Each tag should be 3 to 23 alphanumeric characters and is - normalized to lower case at SRP. - :type tags: list[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: LegalHold or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.LegalHold or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - legal_hold = models.LegalHold(tags=tags) - - # Construct URL - url = self.set_legal_hold.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(legal_hold, 'LegalHold') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LegalHold', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} - - def clear_legal_hold( - self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): - """Clears legal hold tags. Clearing the same or non-existent tag results - in an idempotent operation. ClearLegalHold clears out only the - specified tags in the request. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param tags: Each tag should be 3 to 23 alphanumeric characters and is - normalized to lower case at SRP. - :type tags: list[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: LegalHold or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.LegalHold or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - legal_hold = models.LegalHold(tags=tags) - - # Construct URL - url = self.clear_legal_hold.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(legal_hold, 'LegalHold') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LegalHold', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} - - def create_or_update_immutability_policy( - self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates an unlocked immutability policy. ETag in If-Match is - honored if given but not required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param immutability_period_since_creation_in_days: The immutability - period for the blobs in the container since the policy creation, in - days. - :type immutability_period_since_creation_in_days: int - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = None - if immutability_period_since_creation_in_days is not None: - parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) - - # Construct URL - url = self.create_or_update_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') - else: - body_content = None - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def get_immutability_policy( - self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): - """Gets the existing immutability policy along with the corresponding ETag - in response headers and body. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def delete_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): - """Aborts an unlocked immutability policy. The response of delete has - immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is - required for this operation. Deleting a locked immutability policy is - not allowed, only way is to delete the container after deleting all - blobs inside the container. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def lock_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): - """Sets the ImmutabilityPolicy to Locked state. The only action allowed on - a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is - required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.lock_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} - - def extend_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): - """Extends the immutabilityPeriodSinceCreationInDays of a locked - immutabilityPolicy. The only action allowed on a Locked policy will be - this action. ETag in If-Match is required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: str - :param immutability_period_since_creation_in_days: The immutability - period for the blobs in the container since the policy creation, in - days. - :type immutability_period_since_creation_in_days: int - :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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = None - if immutability_period_since_creation_in_days is not None: - parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) - - # Construct URL - url = self.extend_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} - - def lease( - self, resource_group_name, account_name, container_name, parameters=None, custom_headers=None, raw=False, **operation_config): - """The Lease Container operation establishes and manages a lock on a - container for delete operations. The lock duration can be 15 to 60 - seconds, or can be infinite. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param parameters: Lease Container request body. - :type parameters: - ~azure.mgmt.storage.v2018_02_01.models.LeaseContainerRequest - :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: LeaseContainerResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.LeaseContainerResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.lease.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'LeaseContainerRequest') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LeaseContainerResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/operations.py deleted file mode 100644 index b18726355861..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/operations.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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 API version to use for this operation. Constant value: "2018-02-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-02-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available Storage 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 Operation - :rtype: - ~azure.mgmt.storage.v2018_02_01.models.OperationPaged[~azure.mgmt.storage.v2018_02_01.models.Operation] - :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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.OperationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/skus_operations.py deleted file mode 100644 index e3804a38ffc4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/skus_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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 SkusOperations(object): - """SkusOperations 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 API version to use for this operation. Constant value: "2018-02-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-02-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists the available SKUs supported by Microsoft.Storage for given - 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 Sku - :rtype: - ~azure.mgmt.storage.v2018_02_01.models.SkuPaged[~azure.mgmt.storage.v2018_02_01.models.Sku] - :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', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.SkuPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/storage_accounts_operations.py deleted file mode 100644 index f827548b136f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/storage_accounts_operations.py +++ /dev/null @@ -1,842 +0,0 @@ -# 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 StorageAccountsOperations(object): - """StorageAccountsOperations 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 API version to use for this operation. Constant value: "2018-02-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-02-01" - - self.config = config - - def check_name_availability( - self, name, custom_headers=None, raw=False, **operation_config): - """Checks that the storage account name is valid and is not already in - use. - - :param name: The storage account name. - :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_02_01.models.CheckNameAvailabilityResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) - - # 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', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('CheckNameAvailabilityResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} - - - def _create_initial( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountCreateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Asynchronously creates a new storage account with the specified - parameters. If an account is already created and a subsequent create - request is issued with different properties, the account properties - will be updated. If an account is already created and a subsequent - create or update request is issued with the exact same set of - properties, the request will succeed. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the created account. - :type parameters: - ~azure.mgmt.storage.v2018_02_01.models.StorageAccountCreateParameters - :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 StorageAccount or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2018_02_01.models.StorageAccount] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2018_02_01.models.StorageAccount]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes a storage account in Microsoft Azure. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def get_properties( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Returns the properties for the specified storage account including but - not limited to name, SKU name, location, and account status. The - ListKeys operation should be used to retrieve storage keys. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def update( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """The update operation can be used to update the SKU, encryption, access - tier, or tags for a storage account. It can also be used to map the - account to a custom domain. Only one custom domain is supported per - storage account; the replacement/change of custom domain is not - supported. In order to replace an old custom domain, the old value must - be cleared/unregistered before a new value can be set. The update of - multiple properties is supported. This call does not change the storage - keys for the account. If you want to change the storage account keys, - use the regenerate keys operation. The location and name of the storage - account cannot be changed after creation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the updated account. - :type parameters: - ~azure.mgmt.storage.v2018_02_01.models.StorageAccountUpdateParameters - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the subscription. Note - that storage keys are not returned; use the ListKeys operation for - this. - - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2018_02_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_02_01.models.StorageAccount] - :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', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the given resource - group. Note that storage keys are not returned; use the ListKeys - operation for this. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2018_02_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_02_01.models.StorageAccount] - :raises: :class:`CloudError` - """ - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(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.Storage/storageAccounts'} - - def list_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_02_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} - - def regenerate_key( - self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerates one of the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param key_name: The name of storage keys that want to be regenerated, - possible values are key1, key2. - :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_02_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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_key1, 'StorageAccountRegenerateKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} - - def list_account_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List SAS credentials of a storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list SAS credentials - for the storage account. - :type parameters: - ~azure.mgmt.storage.v2018_02_01.models.AccountSasParameters - :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: ListAccountSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListAccountSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_account_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'AccountSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListAccountSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} - - def list_service_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List service SAS credentials of a specific resource. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list service SAS - credentials. - :type parameters: - ~azure.mgmt.storage.v2018_02_01.models.ServiceSasParameters - :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: ListServiceSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_02_01.models.ListServiceSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_service_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'ServiceSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListServiceSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/usage_operations.py deleted file mode 100644 index 08245d5e1201..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/usage_operations.py +++ /dev/null @@ -1,171 +0,0 @@ -# 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 UsageOperations(object): - """UsageOperations 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 API version to use for this operation. Constant value: "2018-02-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-02-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets the current usage count and the limit for the resources under the - 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 Usage - :rtype: - ~azure.mgmt.storage.v2018_02_01.models.UsagePaged[~azure.mgmt.storage.v2018_02_01.models.Usage] - :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', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.UsagePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} - - def list_by_location( - self, location, custom_headers=None, raw=False, **operation_config): - """Gets the current usage count and the limit for the resources of the - location under the subscription. - - :param location: The location of the Azure Storage resource. - :type location: 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 Usage - :rtype: - ~azure.mgmt.storage.v2018_02_01.models.UsagePaged[~azure.mgmt.storage.v2018_02_01.models.Usage] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_location.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, '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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.UsagePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/storage_management_client.py deleted file mode 100644 index a70542395629..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/storage_management_client.py +++ /dev/null @@ -1,101 +0,0 @@ -# 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.operations import Operations -from .operations.skus_operations import SkusOperations -from .operations.storage_accounts_operations import StorageAccountsOperations -from .operations.usage_operations import UsageOperations -from .operations.blob_containers_operations import BlobContainersOperations -from . import models - - -class StorageManagementClientConfiguration(AzureConfiguration): - """Configuration for StorageManagementClient - 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 ID of the target subscription. - :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(StorageManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class StorageManagementClient(SDKClient): - """The Azure Storage Management API. - - :ivar config: Configuration for client. - :vartype config: StorageManagementClientConfiguration - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.storage.v2018_02_01.operations.Operations - :ivar skus: Skus operations - :vartype skus: azure.mgmt.storage.v2018_02_01.operations.SkusOperations - :ivar storage_accounts: StorageAccounts operations - :vartype storage_accounts: azure.mgmt.storage.v2018_02_01.operations.StorageAccountsOperations - :ivar usage: Usage operations - :vartype usage: azure.mgmt.storage.v2018_02_01.operations.UsageOperations - :ivar blob_containers: BlobContainers operations - :vartype blob_containers: azure.mgmt.storage.v2018_02_01.operations.BlobContainersOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - super(StorageManagementClient, self).__init__(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-02-01' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.skus = SkusOperations( - self._client, self.config, self._serialize, self._deserialize) - self.storage_accounts = StorageAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.usage = UsageOperations( - self._client, self.config, self._serialize, self._deserialize) - self.blob_containers = BlobContainersOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/__init__.py index 0854715e0c10..da2c3f969e67 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient -from .version import VERSION +from ._configuration import StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] -__all__ = ['StorageManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_configuration.py new file mode 100644 index 000000000000..57fa5132dc82 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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 ID of the target subscription. + :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(StorageManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_storage_management_client.py new file mode 100644 index 000000000000..77c65e0adfa5 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_storage_management_client.py @@ -0,0 +1,69 @@ +# 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 ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import UsagesOperations +from .operations import BlobContainersOperations +from . import models + + +class StorageManagementClient(SDKClient): + """The Azure Storage Management API. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2018_03_01_preview.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2018_03_01_preview.operations.SkusOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2018_03_01_preview.operations.StorageAccountsOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.storage.v2018_03_01_preview.operations.UsagesOperations + :ivar blob_containers: BlobContainers operations + :vartype blob_containers: azure.mgmt.storage.v2018_03_01_preview.operations.BlobContainersOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-03-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/__init__.py index d94f1af1a327..55d8bb150906 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/__init__.py @@ -10,110 +10,110 @@ # -------------------------------------------------------------------------- try: - from .operation_display_py3 import OperationDisplay - from .dimension_py3 import Dimension - from .metric_specification_py3 import MetricSpecification - from .service_specification_py3 import ServiceSpecification - from .operation_py3 import Operation - from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters - from .sku_capability_py3 import SKUCapability - from .restriction_py3 import Restriction - from .sku_py3 import Sku - from .check_name_availability_result_py3 import CheckNameAvailabilityResult - from .custom_domain_py3 import CustomDomain - from .encryption_service_py3 import EncryptionService - from .encryption_services_py3 import EncryptionServices - from .key_vault_properties_py3 import KeyVaultProperties - from .encryption_py3 import Encryption - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - from .identity_py3 import Identity - from .storage_account_create_parameters_py3 import StorageAccountCreateParameters - from .endpoints_py3 import Endpoints - from .storage_account_py3 import StorageAccount - from .storage_account_key_py3 import StorageAccountKey - from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters - from .usage_name_py3 import UsageName - from .usage_py3 import Usage - from .account_sas_parameters_py3 import AccountSasParameters - from .list_account_sas_response_py3 import ListAccountSasResponse - from .service_sas_parameters_py3 import ServiceSasParameters - from .list_service_sas_response_py3 import ListServiceSasResponse - from .storage_account_management_policies_py3 import StorageAccountManagementPolicies - from .management_policies_rules_set_parameter_py3 import ManagementPoliciesRulesSetParameter - from .proxy_resource_py3 import ProxyResource - from .tracked_resource_py3 import TrackedResource - from .azure_entity_resource_py3 import AzureEntityResource - from .resource_py3 import Resource - from .update_history_property_py3 import UpdateHistoryProperty - from .immutability_policy_properties_py3 import ImmutabilityPolicyProperties - from .tag_property_py3 import TagProperty - from .legal_hold_properties_py3 import LegalHoldProperties - from .blob_container_py3 import BlobContainer - from .immutability_policy_py3 import ImmutabilityPolicy - from .legal_hold_py3 import LegalHold - from .list_container_item_py3 import ListContainerItem - from .list_container_items_py3 import ListContainerItems - from .lease_container_request_py3 import LeaseContainerRequest - from .lease_container_response_py3 import LeaseContainerResponse + from ._models_py3 import AccountSasParameters + from ._models_py3 import AzureEntityResource + from ._models_py3 import BlobContainer + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CustomDomain + from ._models_py3 import Dimension + from ._models_py3 import Encryption + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import Identity + from ._models_py3 import ImmutabilityPolicy + from ._models_py3 import ImmutabilityPolicyProperties + from ._models_py3 import IPRule + from ._models_py3 import KeyVaultProperties + from ._models_py3 import LeaseContainerRequest + from ._models_py3 import LeaseContainerResponse + from ._models_py3 import LegalHold + from ._models_py3 import LegalHoldProperties + from ._models_py3 import ListAccountSasResponse + from ._models_py3 import ListContainerItem + from ._models_py3 import ListContainerItems + from ._models_py3 import ListServiceSasResponse + from ._models_py3 import ManagementPoliciesRulesSetParameter + from ._models_py3 import MetricSpecification + from ._models_py3 import NetworkRuleSet + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import Restriction + from ._models_py3 import ServiceSasParameters + from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SKUCapability + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountManagementPolicies + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import TagProperty + from ._models_py3 import TrackedResource + from ._models_py3 import UpdateHistoryProperty + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import VirtualNetworkRule except (SyntaxError, ImportError): - from .operation_display import OperationDisplay - from .dimension import Dimension - from .metric_specification import MetricSpecification - from .service_specification import ServiceSpecification - from .operation import Operation - from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters - from .sku_capability import SKUCapability - from .restriction import Restriction - from .sku import Sku - from .check_name_availability_result import CheckNameAvailabilityResult - from .custom_domain import CustomDomain - from .encryption_service import EncryptionService - from .encryption_services import EncryptionServices - from .key_vault_properties import KeyVaultProperties - from .encryption import Encryption - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - from .identity import Identity - from .storage_account_create_parameters import StorageAccountCreateParameters - from .endpoints import Endpoints - from .storage_account import StorageAccount - from .storage_account_key import StorageAccountKey - from .storage_account_list_keys_result import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters import StorageAccountUpdateParameters - from .usage_name import UsageName - from .usage import Usage - from .account_sas_parameters import AccountSasParameters - from .list_account_sas_response import ListAccountSasResponse - from .service_sas_parameters import ServiceSasParameters - from .list_service_sas_response import ListServiceSasResponse - from .storage_account_management_policies import StorageAccountManagementPolicies - from .management_policies_rules_set_parameter import ManagementPoliciesRulesSetParameter - from .proxy_resource import ProxyResource - from .tracked_resource import TrackedResource - from .azure_entity_resource import AzureEntityResource - from .resource import Resource - from .update_history_property import UpdateHistoryProperty - from .immutability_policy_properties import ImmutabilityPolicyProperties - from .tag_property import TagProperty - from .legal_hold_properties import LegalHoldProperties - from .blob_container import BlobContainer - from .immutability_policy import ImmutabilityPolicy - from .legal_hold import LegalHold - from .list_container_item import ListContainerItem - from .list_container_items import ListContainerItems - from .lease_container_request import LeaseContainerRequest - from .lease_container_response import LeaseContainerResponse -from .operation_paged import OperationPaged -from .sku_paged import SkuPaged -from .storage_account_paged import StorageAccountPaged -from .usage_paged import UsagePaged -from .storage_management_client_enums import ( + from ._models import AccountSasParameters + from ._models import AzureEntityResource + from ._models import BlobContainer + from ._models import CheckNameAvailabilityResult + from ._models import CustomDomain + from ._models import Dimension + from ._models import Encryption + from ._models import EncryptionService + from ._models import EncryptionServices + from ._models import Endpoints + from ._models import Identity + from ._models import ImmutabilityPolicy + from ._models import ImmutabilityPolicyProperties + from ._models import IPRule + from ._models import KeyVaultProperties + from ._models import LeaseContainerRequest + from ._models import LeaseContainerResponse + from ._models import LegalHold + from ._models import LegalHoldProperties + from ._models import ListAccountSasResponse + from ._models import ListContainerItem + from ._models import ListContainerItems + from ._models import ListServiceSasResponse + from ._models import ManagementPoliciesRulesSetParameter + from ._models import MetricSpecification + from ._models import NetworkRuleSet + from ._models import Operation + from ._models import OperationDisplay + from ._models import ProxyResource + from ._models import Resource + from ._models import Restriction + from ._models import ServiceSasParameters + from ._models import ServiceSpecification + from ._models import Sku + from ._models import SKUCapability + from ._models import StorageAccount + from ._models import StorageAccountCheckNameAvailabilityParameters + from ._models import StorageAccountCreateParameters + from ._models import StorageAccountKey + from ._models import StorageAccountListKeysResult + from ._models import StorageAccountManagementPolicies + from ._models import StorageAccountRegenerateKeyParameters + from ._models import StorageAccountUpdateParameters + from ._models import TagProperty + from ._models import TrackedResource + from ._models import UpdateHistoryProperty + from ._models import Usage + from ._models import UsageName + from ._models import VirtualNetworkRule +from ._paged_models import OperationPaged +from ._paged_models import SkuPaged +from ._paged_models import StorageAccountPaged +from ._paged_models import UsagePaged +from ._storage_management_client_enums import ( ReasonCode, SkuName, SkuTier, @@ -143,55 +143,55 @@ ) __all__ = [ - 'OperationDisplay', - 'Dimension', - 'MetricSpecification', - 'ServiceSpecification', - 'Operation', - 'StorageAccountCheckNameAvailabilityParameters', - 'SKUCapability', - 'Restriction', - 'Sku', + 'AccountSasParameters', + 'AzureEntityResource', + 'BlobContainer', 'CheckNameAvailabilityResult', 'CustomDomain', + 'Dimension', + 'Encryption', 'EncryptionService', 'EncryptionServices', - 'KeyVaultProperties', - 'Encryption', - 'VirtualNetworkRule', + 'Endpoints', + 'Identity', + 'ImmutabilityPolicy', + 'ImmutabilityPolicyProperties', 'IPRule', + 'KeyVaultProperties', + 'LeaseContainerRequest', + 'LeaseContainerResponse', + 'LegalHold', + 'LegalHoldProperties', + 'ListAccountSasResponse', + 'ListContainerItem', + 'ListContainerItems', + 'ListServiceSasResponse', + 'ManagementPoliciesRulesSetParameter', + 'MetricSpecification', 'NetworkRuleSet', - 'Identity', - 'StorageAccountCreateParameters', - 'Endpoints', + 'Operation', + 'OperationDisplay', + 'ProxyResource', + 'Resource', + 'Restriction', + 'ServiceSasParameters', + 'ServiceSpecification', + 'Sku', + 'SKUCapability', 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', 'StorageAccountKey', 'StorageAccountListKeysResult', + 'StorageAccountManagementPolicies', 'StorageAccountRegenerateKeyParameters', 'StorageAccountUpdateParameters', - 'UsageName', - 'Usage', - 'AccountSasParameters', - 'ListAccountSasResponse', - 'ServiceSasParameters', - 'ListServiceSasResponse', - 'StorageAccountManagementPolicies', - 'ManagementPoliciesRulesSetParameter', - 'ProxyResource', + 'TagProperty', 'TrackedResource', - 'AzureEntityResource', - 'Resource', 'UpdateHistoryProperty', - 'ImmutabilityPolicyProperties', - 'TagProperty', - 'LegalHoldProperties', - 'BlobContainer', - 'ImmutabilityPolicy', - 'LegalHold', - 'ListContainerItem', - 'ListContainerItems', - 'LeaseContainerRequest', - 'LeaseContainerResponse', + 'Usage', + 'UsageName', + 'VirtualNetworkRule', 'OperationPaged', 'SkuPaged', 'StorageAccountPaged', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models.py new file mode 100644 index 000000000000..29219320c099 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models.py @@ -0,0 +1,2204 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BlobContainer, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: + ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_03_01_preview.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: + ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: + ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: + ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: + ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + 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 immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2018_03_01_preview.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.etag = None + self.update_history = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2018_03_01_preview.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = kwargs.get('action', None) + self.lease_id = kwargs.get('lease_id', None) + self.break_period = kwargs.get('break_period', None) + self.lease_duration = kwargs.get('lease_duration', None) + self.proposed_lease_id = kwargs.get('proposed_lease_id', None) + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = kwargs.get('lease_id', None) + self.lease_time_seconds = kwargs.get('lease_time_seconds', None) + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + 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 has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: + list[~azure.mgmt.storage.v2018_03_01_preview.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, **kwargs): + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListContainerItems(Model): + """The list of blob containers. + + :param value: The list of blob containers. + :type value: + list[~azure.mgmt.storage.v2018_03_01_preview.models.ListContainerItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + } + + def __init__(self, **kwargs): + super(ListContainerItems, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ManagementPoliciesRulesSetParameter(Model): + """The Storage Account ManagementPolicies Rules, in JSON format. See more + details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + """ + + _attribute_map = { + 'policy': {'key': 'properties.policy', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ManagementPoliciesRulesSetParameter, self).__init__(**kwargs) + self.policy = kwargs.get('policy', None) + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: + list[~azure.mgmt.storage.v2018_03_01_preview.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_03_01_preview.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: + list[~azure.mgmt.storage.v2018_03_01_preview.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.storage.v2018_03_01_preview.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2018_03_01_preview.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of 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(OperationDisplay, 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) + + +class ProxyResource(Resource): + """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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. + Possible values include: Blob (b), Container (c), File (f), Share (s). + Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2018_03_01_preview.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2018_03_01_preview.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2018_03_01_preview.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2018_03_01_preview.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class StorageAccount(TrackedResource): + """The storage account. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2018_03_01_preview.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_03_01_preview.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2018_03_01_preview.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2018_03_01_preview.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2018_03_01_preview.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: + ~azure.mgmt.storage.v2018_03_01_preview.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_03_01_preview.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. Default value: False . + :type is_hns_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = None + self.is_hns_enabled = kwargs.get('is_hns_enabled', False) + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2018_03_01_preview.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_03_01_preview.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: + ~azure.mgmt.storage.v2018_03_01_preview.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: + ~azure.mgmt.storage.v2018_03_01_preview.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_03_01_preview.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. Default value: False . + :type is_hns_enabled: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.is_hns_enabled = kwargs.get('is_hns_enabled', False) + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountManagementPolicies(Resource): + """The Get Storage Account ManagementPolicies operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + :ivar last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(StorageAccountManagementPolicies, self).__init__(**kwargs) + self.policy = kwargs.get('policy', None) + self.last_modified_time = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_03_01_preview.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_03_01_preview.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: + ~azure.mgmt.storage.v2018_03_01_preview.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: + ~azure.mgmt.storage.v2018_03_01_preview.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_03_01_preview.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.kind = kwargs.get('kind', None) + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2018_03_01_preview.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2018_03_01_preview.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..3888ac0356b6 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models_py3.py @@ -0,0 +1,2204 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(BlobContainer, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: + ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_03_01_preview.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: + ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: + ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: + ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: + ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + 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 immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2018_03_01_preview.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.etag = None + self.update_history = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2018_03_01_preview.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, *, action, lease_id: str=None, break_period: int=None, lease_duration: int=None, proposed_lease_id: str=None, **kwargs) -> None: + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = action + self.lease_id = lease_id + self.break_period = break_period + self.lease_duration = lease_duration + self.proposed_lease_id = proposed_lease_id + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, *, lease_id: str=None, lease_time_seconds: str=None, **kwargs) -> None: + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = lease_id + self.lease_time_seconds = lease_time_seconds + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + 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 has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, *, tags, **kwargs) -> None: + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: + list[~azure.mgmt.storage.v2018_03_01_preview.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListContainerItems(Model): + """The list of blob containers. + + :param value: The list of blob containers. + :type value: + list[~azure.mgmt.storage.v2018_03_01_preview.models.ListContainerItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ListContainerItems, self).__init__(**kwargs) + self.value = value + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ManagementPoliciesRulesSetParameter(Model): + """The Storage Account ManagementPolicies Rules, in JSON format. See more + details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + """ + + _attribute_map = { + 'policy': {'key': 'properties.policy', 'type': 'object'}, + } + + def __init__(self, *, policy=None, **kwargs) -> None: + super(ManagementPoliciesRulesSetParameter, self).__init__(**kwargs) + self.policy = policy + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: + list[~azure.mgmt.storage.v2018_03_01_preview.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_03_01_preview.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: + list[~azure.mgmt.storage.v2018_03_01_preview.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.storage.v2018_03_01_preview.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2018_03_01_preview.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of 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(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ProxyResource(Resource): + """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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. + Possible values include: Blob (b), Container (c), File (f), Share (s). + Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource=None, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2018_03_01_preview.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the sku name. Required for account + creation; optional for update. Note that in older versions, sku name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' + :type name: str or ~azure.mgmt.storage.v2018_03_01_preview.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified sku, + including file encryption, network acls, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2018_03_01_preview.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2018_03_01_preview.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions + + +class SKUCapability(Model): + """The capability information in the specified sku, including file encryption, + network acls, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified sku, including file encryption, network acls, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class StorageAccount(TrackedResource): + """The storage account. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2018_03_01_preview.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_03_01_preview.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2018_03_01_preview.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2018_03_01_preview.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2018_03_01_preview.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: + ~azure.mgmt.storage.v2018_03_01_preview.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_03_01_preview.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. Default value: False . + :type is_hns_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, enable_https_traffic_only: bool=False, is_hns_enabled: bool=False, **kwargs) -> None: + super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None + self.is_hns_enabled = is_hns_enabled + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the sku name. + :type sku: ~azure.mgmt.storage.v2018_03_01_preview.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_03_01_preview.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: + ~azure.mgmt.storage.v2018_03_01_preview.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: + ~azure.mgmt.storage.v2018_03_01_preview.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_03_01_preview.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. Default value: False . + :type is_hns_enabled: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, is_hns_enabled: bool=False, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + self.is_hns_enabled = is_hns_enabled + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountManagementPolicies(Resource): + """The Get Storage Account ManagementPolicies operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + :ivar last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, policy=None, **kwargs) -> None: + super(StorageAccountManagementPolicies, self).__init__(**kwargs) + self.policy = policy + self.last_modified_time = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku + names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_03_01_preview.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_03_01_preview.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: + ~azure.mgmt.storage.v2018_03_01_preview.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: + ~azure.mgmt.storage.v2018_03_01_preview.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.AccessTier + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. Default value: False . + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_03_01_preview.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, kind=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.kind = kind + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2018_03_01_preview.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2018_03_01_preview.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_paged_models.py new file mode 100644 index 000000000000..7eb6b3c81648 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_paged_models.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 msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class SkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`Sku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Sku]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuPaged, self).__init__(*args, **kwargs) +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_storage_management_client_enums.py similarity index 100% rename from sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_management_client_enums.py rename to sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_storage_management_client_enums.py diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/account_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/account_sas_parameters.py deleted file mode 100644 index 8ae3152f1b2d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/account_sas_parameters.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AccountSasParameters, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.resource_types = kwargs.get('resource_types', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/account_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/account_sas_parameters_py3.py deleted file mode 100644 index 305a5c27508a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/account_sas_parameters_py3.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: - super(AccountSasParameters, self).__init__(**kwargs) - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/azure_entity_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/azure_entity_resource.py deleted file mode 100644 index 3bffaab8d35b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/azure_entity_resource.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/azure_entity_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/azure_entity_resource_py3.py deleted file mode 100644 index d3f80d87498a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/azure_entity_resource_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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_py3 import Resource - - -class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/blob_container.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/blob_container.py deleted file mode 100644 index aa1d2acd4c26..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/blob_container.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class BlobContainer(AzureEntityResource): - """Properties of the blob container, including Id, resource name, resource - type, Etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(BlobContainer, self).__init__(**kwargs) - self.public_access = kwargs.get('public_access', None) - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = kwargs.get('metadata', None) - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/blob_container_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/blob_container_py3.py deleted file mode 100644 index 680ad34c6809..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/blob_container_py3.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class BlobContainer(AzureEntityResource): - """Properties of the blob container, including Id, resource name, resource - type, Etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: - super(BlobContainer, self).__init__(**kwargs) - self.public_access = public_access - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = metadata - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/check_name_availability_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/check_name_availability_result.py deleted file mode 100644 index 41c2210d22a8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/check_name_availability_result.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/check_name_availability_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/check_name_availability_result_py3.py deleted file mode 100644 index 9d10045600bb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/check_name_availability_result_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/custom_domain.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/custom_domain.py deleted file mode 100644 index d5cc10da36cb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/custom_domain.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(CustomDomain, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/custom_domain_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/custom_domain_py3.py deleted file mode 100644 index 25dce0b57aee..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/custom_domain_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: - super(CustomDomain, self).__init__(**kwargs) - self.name = name - self.use_sub_domain_name = use_sub_domain_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/dimension.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/dimension.py deleted file mode 100644 index 2398aa46e8f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/dimension.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Dimension, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/dimension_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/dimension_py3.py deleted file mode 100644 index af5b0aac3d23..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/dimension_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: - super(Dimension, self).__init__(**kwargs) - self.name = name - self.display_name = display_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption.py deleted file mode 100644 index 06c2c3f1a3be..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: - ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2018_03_01_preview.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, **kwargs): - super(Encryption, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.key_source = kwargs.get('key_source', "Microsoft.Storage") - self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_py3.py deleted file mode 100644 index 7fe3395b43f8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: - ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2018_03_01_preview.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: - super(Encryption, self).__init__(**kwargs) - self.services = services - self.key_source = key_source - self.key_vault_properties = key_vault_properties diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_service.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_service.py deleted file mode 100644 index 3a020c468f64..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_service.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(EncryptionService, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_service_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_service_py3.py deleted file mode 100644 index 0566050c6155..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_service_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, enabled: bool=None, **kwargs) -> None: - super(EncryptionService, self).__init__(**kwargs) - self.enabled = enabled - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_services.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_services.py deleted file mode 100644 index c7d48b4fb675..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_services.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: - ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: - ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: - ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: - ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, **kwargs): - super(EncryptionServices, self).__init__(**kwargs) - self.blob = kwargs.get('blob', None) - self.file = kwargs.get('file', None) - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_services_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_services_py3.py deleted file mode 100644 index b8fe79876044..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/encryption_services_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: - ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: - ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: - ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: - ~azure.mgmt.storage.v2018_03_01_preview.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, *, blob=None, file=None, **kwargs) -> None: - super(EncryptionServices, self).__init__(**kwargs) - self.blob = blob - self.file = file - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/endpoints.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/endpoints.py deleted file mode 100644 index 66b1c3459a5e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/endpoints.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, - table, web or dfs object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - :ivar web: Gets the web endpoint. - :vartype web: str - :ivar dfs: Gets the dfs endpoint. - :vartype dfs: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - 'web': {'readonly': True}, - 'dfs': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - 'web': {'key': 'web', 'type': 'str'}, - 'dfs': {'key': 'dfs', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None - self.web = None - self.dfs = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/endpoints_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/endpoints_py3.py deleted file mode 100644 index ced561acd85b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/endpoints_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, - table, web or dfs object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - :ivar web: Gets the web endpoint. - :vartype web: str - :ivar dfs: Gets the dfs endpoint. - :vartype dfs: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - 'web': {'readonly': True}, - 'dfs': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - 'web': {'key': 'web', 'type': 'str'}, - 'dfs': {'key': 'dfs', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None - self.web = None - self.dfs = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/identity.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/identity.py deleted file mode 100644 index f526b986fc70..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/identity.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/identity_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/identity_py3.py deleted file mode 100644 index 22d25fdd85b7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/identity_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs) -> None: - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/immutability_policy.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/immutability_policy.py deleted file mode 100644 index 2ec3c69f0f72..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/immutability_policy.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class ImmutabilityPolicy(AzureEntityResource): - """The ImmutabilityPolicy property of a blob container, including Id, resource - name, resource type, Etag. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImmutabilityPolicy, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) - self.state = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/immutability_policy_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/immutability_policy_properties.py deleted file mode 100644 index 80da1f189c17..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/immutability_policy_properties.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 ImmutabilityPolicyProperties(Model): - """The properties of an ImmutabilityPolicy of a blob container. - - 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 immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyState - :ivar etag: ImmutabilityPolicy Etag. - :vartype etag: str - :ivar update_history: The ImmutabilityPolicy update history of the blob - container. - :vartype update_history: - list[~azure.mgmt.storage.v2018_03_01_preview.models.UpdateHistoryProperty] - """ - - _validation = { - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - 'etag': {'readonly': True}, - 'update_history': {'readonly': True}, - } - - _attribute_map = { - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, - } - - def __init__(self, **kwargs): - super(ImmutabilityPolicyProperties, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) - self.state = None - self.etag = None - self.update_history = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/immutability_policy_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/immutability_policy_properties_py3.py deleted file mode 100644 index 586e5c4667f5..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/immutability_policy_properties_py3.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 ImmutabilityPolicyProperties(Model): - """The properties of an ImmutabilityPolicy of a blob container. - - 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 immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyState - :ivar etag: ImmutabilityPolicy Etag. - :vartype etag: str - :ivar update_history: The ImmutabilityPolicy update history of the blob - container. - :vartype update_history: - list[~azure.mgmt.storage.v2018_03_01_preview.models.UpdateHistoryProperty] - """ - - _validation = { - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - 'etag': {'readonly': True}, - 'update_history': {'readonly': True}, - } - - _attribute_map = { - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, - } - - def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: - super(ImmutabilityPolicyProperties, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days - self.state = None - self.etag = None - self.update_history = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/immutability_policy_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/immutability_policy_py3.py deleted file mode 100644 index 6e612b9f60b2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/immutability_policy_py3.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class ImmutabilityPolicy(AzureEntityResource): - """The ImmutabilityPolicy property of a blob container, including Id, resource - name, resource type, Etag. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: - super(ImmutabilityPolicy, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days - self.state = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/ip_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/ip_rule.py deleted file mode 100644 index 02c554774c05..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/ip_rule.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.action = kwargs.get('action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/ip_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/ip_rule_py3.py deleted file mode 100644 index 7a8328a92aa9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/ip_rule_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = ip_address_or_range - self.action = action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/key_vault_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/key_vault_properties.py deleted file mode 100644 index 44eaf379f6f2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/key_vault_properties.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - self.key_version = kwargs.get('key_version', None) - self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/key_vault_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/key_vault_properties_py3.py deleted file mode 100644 index 9e6350eec898..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/key_vault_properties_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = key_name - self.key_version = key_version - self.key_vault_uri = key_vault_uri diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/lease_container_request.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/lease_container_request.py deleted file mode 100644 index a2a5f4b647ba..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/lease_container_request.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 LeaseContainerRequest(Model): - """Lease Container request schema. - - All required parameters must be populated in order to send to Azure. - - :param action: Required. Specifies the lease action. Can be one of the - available actions. Possible values include: 'Acquire', 'Renew', 'Change', - 'Release', 'Break' - :type action: str or ~azure.mgmt.storage.v2018_03_01_preview.models.enum - :param lease_id: Identifies the lease. Can be specified in any valid GUID - string format. - :type lease_id: str - :param break_period: Optional. For a break action, proposed duration the - lease should continue before it is broken, in seconds, between 0 and 60. - :type break_period: int - :param lease_duration: Required for acquire. Specifies the duration of the - lease, in seconds, or negative one (-1) for a lease that never expires. - :type lease_duration: int - :param proposed_lease_id: Optional for acquire, required for change. - Proposed lease ID, in a GUID string format. - :type proposed_lease_id: str - """ - - _validation = { - 'action': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'break_period': {'key': 'breakPeriod', 'type': 'int'}, - 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, - 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LeaseContainerRequest, self).__init__(**kwargs) - self.action = kwargs.get('action', None) - self.lease_id = kwargs.get('lease_id', None) - self.break_period = kwargs.get('break_period', None) - self.lease_duration = kwargs.get('lease_duration', None) - self.proposed_lease_id = kwargs.get('proposed_lease_id', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/lease_container_request_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/lease_container_request_py3.py deleted file mode 100644 index d826237f18c5..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/lease_container_request_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 LeaseContainerRequest(Model): - """Lease Container request schema. - - All required parameters must be populated in order to send to Azure. - - :param action: Required. Specifies the lease action. Can be one of the - available actions. Possible values include: 'Acquire', 'Renew', 'Change', - 'Release', 'Break' - :type action: str or ~azure.mgmt.storage.v2018_03_01_preview.models.enum - :param lease_id: Identifies the lease. Can be specified in any valid GUID - string format. - :type lease_id: str - :param break_period: Optional. For a break action, proposed duration the - lease should continue before it is broken, in seconds, between 0 and 60. - :type break_period: int - :param lease_duration: Required for acquire. Specifies the duration of the - lease, in seconds, or negative one (-1) for a lease that never expires. - :type lease_duration: int - :param proposed_lease_id: Optional for acquire, required for change. - Proposed lease ID, in a GUID string format. - :type proposed_lease_id: str - """ - - _validation = { - 'action': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'break_period': {'key': 'breakPeriod', 'type': 'int'}, - 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, - 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, - } - - def __init__(self, *, action, lease_id: str=None, break_period: int=None, lease_duration: int=None, proposed_lease_id: str=None, **kwargs) -> None: - super(LeaseContainerRequest, self).__init__(**kwargs) - self.action = action - self.lease_id = lease_id - self.break_period = break_period - self.lease_duration = lease_duration - self.proposed_lease_id = proposed_lease_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/lease_container_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/lease_container_response.py deleted file mode 100644 index 666f0e899f1e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/lease_container_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 LeaseContainerResponse(Model): - """Lease Container response schema. - - :param lease_id: Returned unique lease ID that must be included with any - request to delete the container, or to renew, change, or release the - lease. - :type lease_id: str - :param lease_time_seconds: Approximate time remaining in the lease period, - in seconds. - :type lease_time_seconds: str - """ - - _attribute_map = { - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LeaseContainerResponse, self).__init__(**kwargs) - self.lease_id = kwargs.get('lease_id', None) - self.lease_time_seconds = kwargs.get('lease_time_seconds', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/lease_container_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/lease_container_response_py3.py deleted file mode 100644 index fa87d930571d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/lease_container_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 LeaseContainerResponse(Model): - """Lease Container response schema. - - :param lease_id: Returned unique lease ID that must be included with any - request to delete the container, or to renew, change, or release the - lease. - :type lease_id: str - :param lease_time_seconds: Approximate time remaining in the lease period, - in seconds. - :type lease_time_seconds: str - """ - - _attribute_map = { - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, - } - - def __init__(self, *, lease_id: str=None, lease_time_seconds: str=None, **kwargs) -> None: - super(LeaseContainerResponse, self).__init__(**kwargs) - self.lease_id = lease_id - self.lease_time_seconds = lease_time_seconds diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/legal_hold.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/legal_hold.py deleted file mode 100644 index 4eb93df1d9fe..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/legal_hold.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 LegalHold(Model): - """The LegalHold property of a blob container. - - 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 has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: Required. Each tag should be 3 to 23 alphanumeric characters - and is normalized to lower case at SRP. - :type tags: list[str] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - 'tags': {'required': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(LegalHold, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = kwargs.get('tags', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/legal_hold_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/legal_hold_properties.py deleted file mode 100644 index cf219925a93e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/legal_hold_properties.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 LegalHoldProperties(Model): - """The LegalHold property of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: The list of LegalHold tags of a blob container. - :type tags: - list[~azure.mgmt.storage.v2018_03_01_preview.models.TagProperty] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[TagProperty]'}, - } - - def __init__(self, **kwargs): - super(LegalHoldProperties, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = kwargs.get('tags', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/legal_hold_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/legal_hold_properties_py3.py deleted file mode 100644 index 9004b110ecde..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/legal_hold_properties_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 LegalHoldProperties(Model): - """The LegalHold property of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: The list of LegalHold tags of a blob container. - :type tags: - list[~azure.mgmt.storage.v2018_03_01_preview.models.TagProperty] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[TagProperty]'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(LegalHoldProperties, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = tags diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/legal_hold_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/legal_hold_py3.py deleted file mode 100644 index a4bc196cb604..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/legal_hold_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 LegalHold(Model): - """The LegalHold property of a blob container. - - 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 has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: Required. Each tag should be 3 to 23 alphanumeric characters - and is normalized to lower case at SRP. - :type tags: list[str] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - 'tags': {'required': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - } - - def __init__(self, *, tags, **kwargs) -> None: - super(LegalHold, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = tags diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_account_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_account_sas_response.py deleted file mode 100644 index a56e959a34bd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_account_sas_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_account_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_account_sas_response_py3.py deleted file mode 100644 index b8b9a314d9f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_account_sas_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_container_item.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_container_item.py deleted file mode 100644 index d48987c875dc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_container_item.py +++ /dev/null @@ -1,118 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class ListContainerItem(AzureEntityResource): - """The blob container properties be listed out. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(ListContainerItem, self).__init__(**kwargs) - self.public_access = kwargs.get('public_access', None) - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = kwargs.get('metadata', None) - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_container_item_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_container_item_py3.py deleted file mode 100644 index 771dc1011cf2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_container_item_py3.py +++ /dev/null @@ -1,118 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class ListContainerItem(AzureEntityResource): - """The blob container properties be listed out. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: - super(ListContainerItem, self).__init__(**kwargs) - self.public_access = public_access - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = metadata - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_container_items.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_container_items.py deleted file mode 100644 index 34cf699feaf6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_container_items.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ListContainerItems(Model): - """The list of blob containers. - - :param value: The list of blob containers. - :type value: - list[~azure.mgmt.storage.v2018_03_01_preview.models.ListContainerItem] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ListContainerItem]'}, - } - - def __init__(self, **kwargs): - super(ListContainerItems, self).__init__(**kwargs) - self.value = kwargs.get('value', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_container_items_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_container_items_py3.py deleted file mode 100644 index 99bb2bcb0e5f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_container_items_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ListContainerItems(Model): - """The list of blob containers. - - :param value: The list of blob containers. - :type value: - list[~azure.mgmt.storage.v2018_03_01_preview.models.ListContainerItem] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ListContainerItem]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(ListContainerItems, self).__init__(**kwargs) - self.value = value diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_service_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_service_sas_response.py deleted file mode 100644 index d4ab160ae364..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_service_sas_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_service_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_service_sas_response_py3.py deleted file mode 100644 index 7c20617658df..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/list_service_sas_response_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/management_policies_rules_set_parameter.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/management_policies_rules_set_parameter.py deleted file mode 100644 index c814a5b9391f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/management_policies_rules_set_parameter.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 ManagementPoliciesRulesSetParameter(Model): - """The Storage Account ManagementPolicies Rules, in JSON format. See more - details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - - :param policy: The Storage Account ManagementPolicies Rules, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: object - """ - - _attribute_map = { - 'policy': {'key': 'properties.policy', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(ManagementPoliciesRulesSetParameter, self).__init__(**kwargs) - self.policy = kwargs.get('policy', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/management_policies_rules_set_parameter_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/management_policies_rules_set_parameter_py3.py deleted file mode 100644 index 7fb665877844..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/management_policies_rules_set_parameter_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 ManagementPoliciesRulesSetParameter(Model): - """The Storage Account ManagementPolicies Rules, in JSON format. See more - details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - - :param policy: The Storage Account ManagementPolicies Rules, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: object - """ - - _attribute_map = { - 'policy': {'key': 'properties.policy', 'type': 'object'}, - } - - def __init__(self, *, policy=None, **kwargs) -> None: - super(ManagementPoliciesRulesSetParameter, self).__init__(**kwargs) - self.policy = policy diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/metric_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/metric_specification.py deleted file mode 100644 index 34c2fe591d18..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/metric_specification.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: - list[~azure.mgmt.storage.v2018_03_01_preview.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MetricSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.dimensions = kwargs.get('dimensions', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) - self.category = kwargs.get('category', None) - self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/metric_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/metric_specification_py3.py deleted file mode 100644 index 33704d9da324..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/metric_specification_py3.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: - list[~azure.mgmt.storage.v2018_03_01_preview.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: - super(MetricSpecification, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.dimensions = dimensions - self.aggregation_type = aggregation_type - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/network_rule_set.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/network_rule_set.py deleted file mode 100644 index 803725178c81..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/network_rule_set.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2018_03_01_preview.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: - list[~azure.mgmt.storage.v2018_03_01_preview.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = kwargs.get('bypass', "AzureServices") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) - self.default_action = kwargs.get('default_action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/network_rule_set_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/network_rule_set_py3.py deleted file mode 100644 index 9c455a986759..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/network_rule_set_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2018_03_01_preview.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: - list[~azure.mgmt.storage.v2018_03_01_preview.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = bypass - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules - self.default_action = default_action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation.py deleted file mode 100644 index 414b1e14671c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: - ~azure.mgmt.storage.v2018_03_01_preview.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2018_03_01_preview.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation_display.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation_display.py deleted file mode 100644 index 029cfa2a8304..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation_display.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of 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(OperationDisplay, 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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation_display_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation_display_py3.py deleted file mode 100644 index 318ba2236d3e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation_display_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of 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(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation_paged.py deleted file mode 100644 index 78bb839cc067..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation_py3.py deleted file mode 100644 index e916d274b9ab..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/operation_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: - ~azure.mgmt.storage.v2018_03_01_preview.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2018_03_01_preview.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/proxy_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/proxy_resource.py deleted file mode 100644 index 0de8fb6bd420..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/proxy_resource.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 ProxyResource(Resource): - """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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/proxy_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/proxy_resource_py3.py deleted file mode 100644 index 2e8391f912d6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/proxy_resource_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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_py3 import Resource - - -class ProxyResource(Resource): - """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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/resource.py deleted file mode 100644 index 9333a2ac49ef..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/resource.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/resource_py3.py deleted file mode 100644 index 370e6c506581..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/resource_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/restriction.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/restriction.py deleted file mode 100644 index b2030048d2d5..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/restriction.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = kwargs.get('reason_code', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/restriction_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/restriction_py3.py deleted file mode 100644 index 9ae6333a5304..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/restriction_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, *, reason_code=None, **kwargs) -> None: - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = reason_code diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/service_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/service_sas_parameters.py deleted file mode 100644 index 407cf31249b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/service_sas_parameters.py +++ /dev/null @@ -1,120 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = kwargs.get('canonicalized_resource', None) - self.resource = kwargs.get('resource', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.identifier = kwargs.get('identifier', None) - self.partition_key_start = kwargs.get('partition_key_start', None) - self.partition_key_end = kwargs.get('partition_key_end', None) - self.row_key_start = kwargs.get('row_key_start', None) - self.row_key_end = kwargs.get('row_key_end', None) - self.key_to_sign = kwargs.get('key_to_sign', None) - self.cache_control = kwargs.get('cache_control', None) - self.content_disposition = kwargs.get('content_disposition', None) - self.content_encoding = kwargs.get('content_encoding', None) - self.content_language = kwargs.get('content_language', None) - self.content_type = kwargs.get('content_type', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/service_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/service_sas_parameters_py3.py deleted file mode 100644 index ea46cb78e494..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/service_sas_parameters_py3.py +++ /dev/null @@ -1,120 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, *, canonicalized_resource: str, resource=None, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/service_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/service_specification.py deleted file mode 100644 index f0221d7d9f0d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/service_specification.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2018_03_01_preview.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, **kwargs): - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/service_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/service_specification_py3.py deleted file mode 100644 index a0447d578365..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/service_specification_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2018_03_01_preview.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku.py deleted file mode 100644 index 4acb2cabee52..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku.py +++ /dev/null @@ -1,79 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - :type name: str or ~azure.mgmt.storage.v2018_03_01_preview.models.SkuName - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'StorageV2', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified sku, - including file encryption, network acls, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2018_03_01_preview.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2018_03_01_preview.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = kwargs.get('restrictions', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku_capability.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku_capability.py deleted file mode 100644 index b8fa68ce7778..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku_capability.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified sku, including file encryption, - network acls, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified sku, including file encryption, network acls, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku_capability_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku_capability_py3.py deleted file mode 100644 index f349a08eda21..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku_capability_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified sku, including file encryption, - network acls, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified sku, including file encryption, network acls, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku_paged.py deleted file mode 100644 index f15c72443a27..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 SkuPaged(Paged): - """ - A paging container for iterating over a list of :class:`Sku ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Sku]'} - } - - def __init__(self, *args, **kwargs): - - super(SkuPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku_py3.py deleted file mode 100644 index ab98d7b85f74..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/sku_py3.py +++ /dev/null @@ -1,79 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the sku name. Required for account - creation; optional for update. Note that in older versions, sku name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS' - :type name: str or ~azure.mgmt.storage.v2018_03_01_preview.models.SkuName - :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'StorageV2', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified sku, - including file encryption, network acls, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2018_03_01_preview.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2018_03_01_preview.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, *, name, restrictions=None, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = restrictions diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account.py deleted file mode 100644 index 186c985c850e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account.py +++ /dev/null @@ -1,175 +0,0 @@ -# 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 .tracked_resource import TrackedResource - - -class StorageAccount(TrackedResource): - """The storage account. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2018_03_01_preview.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'StorageV2', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_03_01_preview.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2018_03_01_preview.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2018_03_01_preview.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2018_03_01_preview.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: - ~azure.mgmt.storage.v2018_03_01_preview.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2018_03_01_preview.models.NetworkRuleSet - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. Default value: False . - :type is_hns_enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccount, self).__init__(**kwargs) - self.sku = None - self.kind = None - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) - self.network_rule_set = None - self.is_hns_enabled = kwargs.get('is_hns_enabled', False) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_check_name_availability_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_check_name_availability_parameters.py deleted file mode 100644 index dbe41bb2c6b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_check_name_availability_parameters.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, **kwargs): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_check_name_availability_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_check_name_availability_parameters_py3.py deleted file mode 100644 index 8d2b031e2284..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_check_name_availability_parameters_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, *, name: str, **kwargs) -> None: - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_create_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_create_parameters.py deleted file mode 100644 index 0a58961a5682..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_create_parameters.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the sku name. - :type sku: ~azure.mgmt.storage.v2018_03_01_preview.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'StorageV2', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_03_01_preview.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: - ~azure.mgmt.storage.v2018_03_01_preview.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: - ~azure.mgmt.storage.v2018_03_01_preview.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_03_01_preview.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. Default value: False . - :type is_hns_enabled: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) - self.is_hns_enabled = kwargs.get('is_hns_enabled', False) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_create_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_create_parameters_py3.py deleted file mode 100644 index 95af6cb8090e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_create_parameters_py3.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the sku name. - :type sku: ~azure.mgmt.storage.v2018_03_01_preview.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'StorageV2', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_03_01_preview.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: - ~azure.mgmt.storage.v2018_03_01_preview.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: - ~azure.mgmt.storage.v2018_03_01_preview.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_03_01_preview.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. Default value: False . - :type is_hns_enabled: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_https_traffic_only: bool=False, is_hns_enabled: bool=False, **kwargs) -> None: - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.network_rule_set = network_rule_set - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only - self.is_hns_enabled = is_hns_enabled diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_key.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_key.py deleted file mode 100644 index ed3a2995cf02..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_key.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs): - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_key_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_key_py3.py deleted file mode 100644 index fa850882f1bb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_key_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_list_keys_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_list_keys_result.py deleted file mode 100644 index 4d56465c568c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_list_keys_result.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs): - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_list_keys_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_list_keys_result_py3.py deleted file mode 100644 index 4d2a927c421f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_list_keys_result_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_management_policies.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_management_policies.py deleted file mode 100644 index 59ee515d9a04..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_management_policies.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 StorageAccountManagementPolicies(Resource): - """The Get Storage Account ManagementPolicies operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param policy: The Storage Account ManagementPolicies Rules, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: object - :ivar last_modified_time: Returns the date and time the ManagementPolicies - was last modified. - :vartype last_modified_time: datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'policy': {'key': 'properties.policy', 'type': 'object'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(StorageAccountManagementPolicies, self).__init__(**kwargs) - self.policy = kwargs.get('policy', None) - self.last_modified_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_management_policies_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_management_policies_py3.py deleted file mode 100644 index 3dc977624949..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_management_policies_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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_py3 import Resource - - -class StorageAccountManagementPolicies(Resource): - """The Get Storage Account ManagementPolicies operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param policy: The Storage Account ManagementPolicies Rules, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: object - :ivar last_modified_time: Returns the date and time the ManagementPolicies - was last modified. - :vartype last_modified_time: datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'policy': {'key': 'properties.policy', 'type': 'object'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, policy=None, **kwargs) -> None: - super(StorageAccountManagementPolicies, self).__init__(**kwargs) - self.policy = policy - self.last_modified_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_paged.py deleted file mode 100644 index 9bcc5490740d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 StorageAccountPaged(Paged): - """ - A paging container for iterating over a list of :class:`StorageAccount ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[StorageAccount]'} - } - - def __init__(self, *args, **kwargs): - - super(StorageAccountPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_py3.py deleted file mode 100644 index 2e2b81409599..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_py3.py +++ /dev/null @@ -1,175 +0,0 @@ -# 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 .tracked_resource_py3 import TrackedResource - - -class StorageAccount(TrackedResource): - """The storage account. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2018_03_01_preview.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'StorageV2', 'BlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_03_01_preview.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2018_03_01_preview.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2018_03_01_preview.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2018_03_01_preview.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: - ~azure.mgmt.storage.v2018_03_01_preview.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2018_03_01_preview.models.NetworkRuleSet - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. Default value: False . - :type is_hns_enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, *, location: str, tags=None, identity=None, enable_https_traffic_only: bool=False, is_hns_enabled: bool=False, **kwargs) -> None: - super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) - self.sku = None - self.kind = None - self.identity = identity - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = None - self.is_hns_enabled = is_hns_enabled diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_regenerate_key_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_regenerate_key_parameters.py deleted file mode 100644 index 6dba2135fdc7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_regenerate_key_parameters.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_regenerate_key_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_regenerate_key_parameters_py3.py deleted file mode 100644 index 6e06a071eba3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_regenerate_key_parameters_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = key_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_update_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_update_parameters.py deleted file mode 100644 index 16136fe068dc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_update_parameters.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku - names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2018_03_01_preview.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_03_01_preview.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: - ~azure.mgmt.storage.v2018_03_01_preview.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: - ~azure.mgmt.storage.v2018_03_01_preview.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_03_01_preview.models.NetworkRuleSet - :param kind: Optional. Indicates the type of storage account. Currently - only StorageV2 value supported by server. Possible values include: - 'Storage', 'StorageV2', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - } - - def __init__(self, **kwargs): - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', False) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.kind = kwargs.get('kind', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_update_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_update_parameters_py3.py deleted file mode 100644 index fa13aa650aa6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/storage_account_update_parameters_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku - names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2018_03_01_preview.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_03_01_preview.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: - ~azure.mgmt.storage.v2018_03_01_preview.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: - ~azure.mgmt.storage.v2018_03_01_preview.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.AccessTier - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. Default value: False . - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_03_01_preview.models.NetworkRuleSet - :param kind: Optional. Indicates the type of storage account. Currently - only StorageV2 value supported by server. Possible values include: - 'Storage', 'StorageV2', 'BlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Kind - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - } - - def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_https_traffic_only: bool=False, network_rule_set=None, kind=None, **kwargs) -> None: - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = sku - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = network_rule_set - self.kind = kind diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/tag_property.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/tag_property.py deleted file mode 100644 index 3b879061fd2b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/tag_property.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 TagProperty(Model): - """A tag of the LegalHold of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tag: The tag value. - :vartype tag: str - :ivar timestamp: Returns the date and time the tag was added. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who added the - tag. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who added the tag. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who added the tag. - :vartype upn: str - """ - - _validation = { - 'tag': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'tag': {'key': 'tag', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TagProperty, self).__init__(**kwargs) - self.tag = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/tag_property_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/tag_property_py3.py deleted file mode 100644 index 22aaf6cb82ba..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/tag_property_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 TagProperty(Model): - """A tag of the LegalHold of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tag: The tag value. - :vartype tag: str - :ivar timestamp: Returns the date and time the tag was added. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who added the - tag. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who added the tag. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who added the tag. - :vartype upn: str - """ - - _validation = { - 'tag': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'tag': {'key': 'tag', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(TagProperty, self).__init__(**kwargs) - self.tag = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/tracked_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/tracked_resource.py deleted file mode 100644 index 27ab94c7a8dd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/tracked_resource.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 TrackedResource(Resource): - """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs.get('location', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/tracked_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/tracked_resource_py3.py deleted file mode 100644 index b28cc1859448..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/tracked_resource_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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_py3 import Resource - - -class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/update_history_property.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/update_history_property.py deleted file mode 100644 index 6681582b4a14..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/update_history_property.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 UpdateHistoryProperty(Model): - """An update history of the ImmutabilityPolicy of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar update: The ImmutabilityPolicy update type of a blob container, - possible values include: put, lock and extend. Possible values include: - 'put', 'lock', 'extend' - :vartype update: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyUpdateType - :ivar immutability_period_since_creation_in_days: The immutability period - for the blobs in the container since the policy creation, in days. - :vartype immutability_period_since_creation_in_days: int - :ivar timestamp: Returns the date and time the ImmutabilityPolicy was - updated. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who updated the - ImmutabilityPolicy. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who updated the ImmutabilityPolicy. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who updated the - ImmutabilityPolicy. - :vartype upn: str - """ - - _validation = { - 'update': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'update': {'key': 'update', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UpdateHistoryProperty, self).__init__(**kwargs) - self.update = None - self.immutability_period_since_creation_in_days = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/update_history_property_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/update_history_property_py3.py deleted file mode 100644 index ca55acf0c8fb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/update_history_property_py3.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 UpdateHistoryProperty(Model): - """An update history of the ImmutabilityPolicy of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar update: The ImmutabilityPolicy update type of a blob container, - possible values include: put, lock and extend. Possible values include: - 'put', 'lock', 'extend' - :vartype update: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicyUpdateType - :ivar immutability_period_since_creation_in_days: The immutability period - for the blobs in the container since the policy creation, in days. - :vartype immutability_period_since_creation_in_days: int - :ivar timestamp: Returns the date and time the ImmutabilityPolicy was - updated. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who updated the - ImmutabilityPolicy. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who updated the ImmutabilityPolicy. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who updated the - ImmutabilityPolicy. - :vartype upn: str - """ - - _validation = { - 'update': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'update': {'key': 'update', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UpdateHistoryProperty, self).__init__(**kwargs) - self.update = None - self.immutability_period_since_creation_in_days = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage.py deleted file mode 100644 index cbd34c470b04..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2018_03_01_preview.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs): - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage_name.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage_name.py deleted file mode 100644 index e4082bf52384..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage_name.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage_name_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage_name_py3.py deleted file mode 100644 index f519bb5072b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage_name_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage_paged.py deleted file mode 100644 index 290c72b9edf7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 UsagePaged(Paged): - """ - A paging container for iterating over a list of :class:`Usage ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Usage]'} - } - - def __init__(self, *args, **kwargs): - - super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage_py3.py deleted file mode 100644 index 0e9f13729f6e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/usage_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2018_03_01_preview.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs) -> None: - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/virtual_network_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/virtual_network_rule.py deleted file mode 100644 index 2a5bc18acbba..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/virtual_network_rule.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2018_03_01_preview.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) - self.action = kwargs.get('action', "Allow") - self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/virtual_network_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/virtual_network_rule_py3.py deleted file mode 100644 index 9da122642920..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_03_01_preview.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2018_03_01_preview.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = virtual_network_resource_id - self.action = action - self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/__init__.py index 6282db615d53..0c16aae7dde7 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/__init__.py @@ -9,11 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .operations import Operations -from .skus_operations import SkusOperations -from .storage_accounts_operations import StorageAccountsOperations -from .usages_operations import UsagesOperations -from .blob_containers_operations import BlobContainersOperations +from ._operations import Operations +from ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._usages_operations import UsagesOperations +from ._blob_containers_operations import BlobContainersOperations __all__ = [ 'Operations', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_blob_containers_operations.py new file mode 100644 index 000000000000..47a4ab0f07be --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_blob_containers_operations.py @@ -0,0 +1,1125 @@ +# 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 BlobContainersOperations(object): + """BlobContainersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-03-01-preview". + :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-01-preview" + self.immutability_policy_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists all containers and does not support a prefix like data plane. + Also SRP today does not return continuation token. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: ListContainerItems or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.ListContainerItems or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('ListContainerItems', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} + + def create( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Creates a new container under the specified account as described by + request body. The container resource includes metadata and properties + for that container. It does not include a list of the blobs contained + by the container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.BlobContainer + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def update( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Updates container properties as specified in request body. Properties + not mentioned in the request will be unchanged. Update fails if the + specified container doesn't already exist. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_03_01_preview.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.BlobContainer + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def get( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Gets properties of a specified container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_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: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.BlobContainer + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def delete( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Deletes specified container under its account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def set_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Sets legal hold tags. Setting the same tag results in an idempotent + operation. SetLegalHold follows an append pattern and does not clear + out the existing tags that are not specified in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.set_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} + + def clear_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Clears legal hold tags. Clearing the same or non-existent tag results + in an idempotent operation. ClearLegalHold clears out only the + specified tags in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.clear_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} + + def create_or_update_immutability_policy( + self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an unlocked immutability policy. ETag in If-Match is + honored if given but not required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.create_or_update_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def get_immutability_policy( + self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): + """Gets the existing immutability policy along with the corresponding ETag + in response headers and body. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def delete_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Aborts an unlocked immutability policy. The response of delete has + immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is + required for this operation. Deleting a locked immutability policy is + not allowed, only way is to delete the container after deleting all + blobs inside the container. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def lock_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Sets the ImmutabilityPolicy to Locked state. The only action allowed on + a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is + required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lock_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} + + def extend_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): + """Extends the immutabilityPeriodSinceCreationInDays of a locked + immutabilityPolicy. The only action allowed on a Locked policy will be + this action. ETag in If-Match is required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.extend_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} + + def lease( + self, resource_group_name, account_name, container_name, parameters=None, custom_headers=None, raw=False, **operation_config): + """The Lease Container operation establishes and manages a lock on a + container for delete operations. The lock duration can be 15 to 60 + seconds, or can be infinite. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param parameters: Lease Container request body. + :type parameters: + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseContainerRequest + :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: LeaseContainerResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseContainerResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lease.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseContainerRequest') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LeaseContainerResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_operations.py new file mode 100644 index 000000000000..5d3e71019605 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_operations.py @@ -0,0 +1,102 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Storage 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 Operation + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.OperationPaged[~azure.mgmt.storage.v2018_03_01_preview.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_skus_operations.py new file mode 100644 index 000000000000..d8a66575cf03 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_skus_operations.py @@ -0,0 +1,107 @@ +# 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 SkusOperations(object): + """SkusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the available SKUs supported by Microsoft.Storage for given + 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 Sku + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.SkuPaged[~azure.mgmt.storage.v2018_03_01_preview.models.Sku] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..691260a39b80 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_storage_accounts_operations.py @@ -0,0 +1,1049 @@ +# 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 StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-03-01-preview". + :ivar management_policy_name: The name of the Storage Account Management Policy. It should always be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-01-preview" + self.management_policy_name = "default" + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: The storage account name. + :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.CheckNameAvailabilityResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) + + # 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', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountCreateParameters + :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 StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountUpdateParameters + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountPaged[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountPaged[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountListKeysResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: The name of storage keys that want to be regenerated, + possible values are key1, key2. + :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountListKeysResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} + + def list_account_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials + for the storage account. + :type parameters: + ~azure.mgmt.storage.v2018_03_01_preview.models.AccountSasParameters + :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: ListAccountSasResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.ListAccountSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_account_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'AccountSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListAccountSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} + + def list_service_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS + credentials. + :type parameters: + ~azure.mgmt.storage.v2018_03_01_preview.models.ServiceSasParameters + :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: ListServiceSasResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.ListServiceSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_service_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'ServiceSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListServiceSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} + + def get_management_policies( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the data policy rules associated with the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccountManagementPolicies or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountManagementPolicies + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_management_policies.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccountManagementPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_management_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} + + def create_or_update_management_policies( + self, resource_group_name, account_name, policy=None, custom_headers=None, raw=False, **operation_config): + """Sets the data policy rules associated with the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + :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: StorageAccountManagementPolicies or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountManagementPolicies + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + properties = models.ManagementPoliciesRulesSetParameter(policy=policy) + + # Construct URL + url = self.create_or_update_management_policies.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(properties, 'ManagementPoliciesRulesSetParameter') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccountManagementPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_management_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} + + def delete_management_policies( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes the data policy rules associated with the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_management_policies.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete_management_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_usages_operations.py new file mode 100644 index 000000000000..d123f61a19df --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_usages_operations.py @@ -0,0 +1,177 @@ +# 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 UsagesOperations(object): + """UsagesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources under the + 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 Usage + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.UsagePaged[~azure.mgmt.storage.v2018_03_01_preview.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} + + def list_by_location( + self, location, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources of the + location under the subscription. + + :param location: The location of the Azure Storage resource. + :type location: 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 Usage + :rtype: + ~azure.mgmt.storage.v2018_03_01_preview.models.UsagePaged[~azure.mgmt.storage.v2018_03_01_preview.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, '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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/blob_containers_operations.py deleted file mode 100644 index 9b1ce276d01b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/blob_containers_operations.py +++ /dev/null @@ -1,1135 +0,0 @@ -# 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 BlobContainersOperations(object): - """BlobContainersOperations 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 API version to use for this operation. Constant value: "2018-03-01-preview". - :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-03-01-preview" - self.immutability_policy_name = "default" - - self.config = config - - def list( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists all containers and does not support a prefix like data plane. - Also SRP today does not return continuation token. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: ListContainerItems or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.ListContainerItems or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('ListContainerItems', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} - - def create( - self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): - """Creates a new container under the specified account as described by - request body. The container resource includes metadata and properties - for that container. It does not include a list of the blobs contained - by the container. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.PublicAccess - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: 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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.BlobContainer - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) - - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(blob_container, 'BlobContainer') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def update( - self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): - """Updates container properties as specified in request body. Properties - not mentioned in the request will be unchanged. Update fails if the - specified container doesn't already exist. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_03_01_preview.models.PublicAccess - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: 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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.BlobContainer - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(blob_container, 'BlobContainer') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def get( - self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): - """Gets properties of a specified container. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_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: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.BlobContainer - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def delete( - self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): - """Deletes specified container under its account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def set_legal_hold( - self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): - """Sets legal hold tags. Setting the same tag results in an idempotent - operation. SetLegalHold follows an append pattern and does not clear - out the existing tags that are not specified in the request. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param tags: Each tag should be 3 to 23 alphanumeric characters and is - normalized to lower case at SRP. - :type tags: list[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: LegalHold or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHold or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - legal_hold = models.LegalHold(tags=tags) - - # Construct URL - url = self.set_legal_hold.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(legal_hold, 'LegalHold') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LegalHold', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} - - def clear_legal_hold( - self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): - """Clears legal hold tags. Clearing the same or non-existent tag results - in an idempotent operation. ClearLegalHold clears out only the - specified tags in the request. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param tags: Each tag should be 3 to 23 alphanumeric characters and is - normalized to lower case at SRP. - :type tags: list[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: LegalHold or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.LegalHold or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - legal_hold = models.LegalHold(tags=tags) - - # Construct URL - url = self.clear_legal_hold.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(legal_hold, 'LegalHold') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LegalHold', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} - - def create_or_update_immutability_policy( - self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates an unlocked immutability policy. ETag in If-Match is - honored if given but not required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param immutability_period_since_creation_in_days: The immutability - period for the blobs in the container since the policy creation, in - days. - :type immutability_period_since_creation_in_days: int - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = None - if immutability_period_since_creation_in_days is not None: - parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) - - # Construct URL - url = self.create_or_update_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') - else: - body_content = None - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def get_immutability_policy( - self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): - """Gets the existing immutability policy along with the corresponding ETag - in response headers and body. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def delete_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): - """Aborts an unlocked immutability policy. The response of delete has - immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is - required for this operation. Deleting a locked immutability policy is - not allowed, only way is to delete the container after deleting all - blobs inside the container. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def lock_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): - """Sets the ImmutabilityPolicy to Locked state. The only action allowed on - a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is - required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.lock_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} - - def extend_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): - """Extends the immutabilityPeriodSinceCreationInDays of a locked - immutabilityPolicy. The only action allowed on a Locked policy will be - this action. ETag in If-Match is required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: str - :param immutability_period_since_creation_in_days: The immutability - period for the blobs in the container since the policy creation, in - days. - :type immutability_period_since_creation_in_days: int - :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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = None - if immutability_period_since_creation_in_days is not None: - parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) - - # Construct URL - url = self.extend_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} - - def lease( - self, resource_group_name, account_name, container_name, parameters=None, custom_headers=None, raw=False, **operation_config): - """The Lease Container operation establishes and manages a lock on a - container for delete operations. The lock duration can be 15 to 60 - seconds, or can be infinite. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param parameters: Lease Container request body. - :type parameters: - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseContainerRequest - :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: LeaseContainerResponse or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.LeaseContainerResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.lease.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'LeaseContainerRequest') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LeaseContainerResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/operations.py deleted file mode 100644 index 3acb8e5f66f9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/operations.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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 API version to use for this operation. Constant value: "2018-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-03-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available Storage 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 Operation - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.OperationPaged[~azure.mgmt.storage.v2018_03_01_preview.models.Operation] - :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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.OperationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/skus_operations.py deleted file mode 100644 index 03ba08d79b11..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/skus_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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 SkusOperations(object): - """SkusOperations 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 API version to use for this operation. Constant value: "2018-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-03-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists the available SKUs supported by Microsoft.Storage for given - 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 Sku - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.SkuPaged[~azure.mgmt.storage.v2018_03_01_preview.models.Sku] - :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', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.SkuPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/storage_accounts_operations.py deleted file mode 100644 index 43561fe69fd1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/storage_accounts_operations.py +++ /dev/null @@ -1,1052 +0,0 @@ -# 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 StorageAccountsOperations(object): - """StorageAccountsOperations 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 API version to use for this operation. Constant value: "2018-03-01-preview". - :ivar management_policy_name: The name of the Storage Account Management Policy. It should always be 'default'. Constant value: "default". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-03-01-preview" - self.management_policy_name = "default" - - self.config = config - - def check_name_availability( - self, name, custom_headers=None, raw=False, **operation_config): - """Checks that the storage account name is valid and is not already in - use. - - :param name: The storage account name. - :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.CheckNameAvailabilityResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) - - # 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', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('CheckNameAvailabilityResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} - - - def _create_initial( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountCreateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Asynchronously creates a new storage account with the specified - parameters. If an account is already created and a subsequent create - request is issued with different properties, the account properties - will be updated. If an account is already created and a subsequent - create or update request is issued with the exact same set of - properties, the request will succeed. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the created account. - :type parameters: - ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountCreateParameters - :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 StorageAccount or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes a storage account in Microsoft Azure. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def get_properties( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Returns the properties for the specified storage account including but - not limited to name, SKU name, location, and account status. The - ListKeys operation should be used to retrieve storage keys. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def update( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """The update operation can be used to update the SKU, encryption, access - tier, or tags for a storage account. It can also be used to map the - account to a custom domain. Only one custom domain is supported per - storage account; the replacement/change of custom domain is not - supported. In order to replace an old custom domain, the old value must - be cleared/unregistered before a new value can be set. The update of - multiple properties is supported. This call does not change the storage - keys for the account. If you want to change the storage account keys, - use the regenerate keys operation. The location and name of the storage - account cannot be changed after creation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the updated account. - :type parameters: - ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountUpdateParameters - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the subscription. Note - that storage keys are not returned; use the ListKeys operation for - this. - - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountPaged[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount] - :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', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the given resource - group. Note that storage keys are not returned; use the ListKeys - operation for this. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountPaged[~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccount] - :raises: :class:`CloudError` - """ - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(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.Storage/storageAccounts'} - - def list_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountListKeysResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} - - def regenerate_key( - self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerates one of the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param key_name: The name of storage keys that want to be regenerated, - possible values are key1, key2. - :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountListKeysResult - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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_key1, 'StorageAccountRegenerateKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} - - def list_account_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List SAS credentials of a storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list SAS credentials - for the storage account. - :type parameters: - ~azure.mgmt.storage.v2018_03_01_preview.models.AccountSasParameters - :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: ListAccountSasResponse or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.ListAccountSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_account_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'AccountSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListAccountSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} - - def list_service_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List service SAS credentials of a specific resource. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list service SAS - credentials. - :type parameters: - ~azure.mgmt.storage.v2018_03_01_preview.models.ServiceSasParameters - :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: ListServiceSasResponse or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.ListServiceSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_service_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'ServiceSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListServiceSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} - - def get_management_policies( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Gets the data policy rules associated with the specified storage - account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccountManagementPolicies or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountManagementPolicies - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_management_policies.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccountManagementPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_management_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} - - def create_or_update_management_policies( - self, resource_group_name, account_name, policy=None, custom_headers=None, raw=False, **operation_config): - """Sets the data policy rules associated with the specified storage - account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param policy: The Storage Account ManagementPolicies Rules, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: object - :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: StorageAccountManagementPolicies or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountManagementPolicies - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - properties = models.ManagementPoliciesRulesSetParameter(policy=policy) - - # Construct URL - url = self.create_or_update_management_policies.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(properties, 'ManagementPoliciesRulesSetParameter') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccountManagementPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update_management_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} - - def delete_management_policies( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes the data policy rules associated with the specified storage - account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete_management_policies.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete_management_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/usages_operations.py deleted file mode 100644 index f47d740798f0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/usages_operations.py +++ /dev/null @@ -1,171 +0,0 @@ -# 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 UsagesOperations(object): - """UsagesOperations 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 API version to use for this operation. Constant value: "2018-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-03-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets the current usage count and the limit for the resources under the - 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 Usage - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.UsagePaged[~azure.mgmt.storage.v2018_03_01_preview.models.Usage] - :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', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.UsagePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'} - - def list_by_location( - self, location, custom_headers=None, raw=False, **operation_config): - """Gets the current usage count and the limit for the resources of the - location under the subscription. - - :param location: The location of the Azure Storage resource. - :type location: 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 Usage - :rtype: - ~azure.mgmt.storage.v2018_03_01_preview.models.UsagePaged[~azure.mgmt.storage.v2018_03_01_preview.models.Usage] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_location.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, '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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.UsagePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/storage_management_client.py deleted file mode 100644 index 8f683afba982..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/storage_management_client.py +++ /dev/null @@ -1,101 +0,0 @@ -# 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.operations import Operations -from .operations.skus_operations import SkusOperations -from .operations.storage_accounts_operations import StorageAccountsOperations -from .operations.usages_operations import UsagesOperations -from .operations.blob_containers_operations import BlobContainersOperations -from . import models - - -class StorageManagementClientConfiguration(AzureConfiguration): - """Configuration for StorageManagementClient - 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 ID of the target subscription. - :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(StorageManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class StorageManagementClient(SDKClient): - """The Azure Storage Management API. - - :ivar config: Configuration for client. - :vartype config: StorageManagementClientConfiguration - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.storage.v2018_03_01_preview.operations.Operations - :ivar skus: Skus operations - :vartype skus: azure.mgmt.storage.v2018_03_01_preview.operations.SkusOperations - :ivar storage_accounts: StorageAccounts operations - :vartype storage_accounts: azure.mgmt.storage.v2018_03_01_preview.operations.StorageAccountsOperations - :ivar usages: Usages operations - :vartype usages: azure.mgmt.storage.v2018_03_01_preview.operations.UsagesOperations - :ivar blob_containers: BlobContainers operations - :vartype blob_containers: azure.mgmt.storage.v2018_03_01_preview.operations.BlobContainersOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - super(StorageManagementClient, self).__init__(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-03-01-preview' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.skus = SkusOperations( - self._client, self.config, self._serialize, self._deserialize) - self.storage_accounts = StorageAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.usages = UsagesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.blob_containers = BlobContainersOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/__init__.py index 0854715e0c10..da2c3f969e67 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient -from .version import VERSION +from ._configuration import StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] -__all__ = ['StorageManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_configuration.py new file mode 100644 index 000000000000..57fa5132dc82 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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 ID of the target subscription. + :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(StorageManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_storage_management_client.py new file mode 100644 index 000000000000..8567483043ad --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_storage_management_client.py @@ -0,0 +1,78 @@ +# 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 ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import UsagesOperations +from .operations import BlobServicesOperations +from .operations import BlobContainersOperations +from .operations import ManagementPoliciesOperations +from . import models + + +class StorageManagementClient(SDKClient): + """The Azure Storage Management API. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2018_07_01.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2018_07_01.operations.SkusOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2018_07_01.operations.StorageAccountsOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.storage.v2018_07_01.operations.UsagesOperations + :ivar blob_services: BlobServices operations + :vartype blob_services: azure.mgmt.storage.v2018_07_01.operations.BlobServicesOperations + :ivar blob_containers: BlobContainers operations + :vartype blob_containers: azure.mgmt.storage.v2018_07_01.operations.BlobContainersOperations + :ivar management_policies: ManagementPolicies operations + :vartype management_policies: azure.mgmt.storage.v2018_07_01.operations.ManagementPoliciesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, 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.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_services = BlobServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.management_policies = ManagementPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/__init__.py index e5e20c59f10f..f187998f4c6b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/__init__.py @@ -10,120 +10,120 @@ # -------------------------------------------------------------------------- try: - from .operation_display_py3 import OperationDisplay - from .dimension_py3 import Dimension - from .metric_specification_py3 import MetricSpecification - from .service_specification_py3 import ServiceSpecification - from .operation_py3 import Operation - from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters - from .sku_capability_py3 import SKUCapability - from .restriction_py3 import Restriction - from .sku_py3 import Sku - from .check_name_availability_result_py3 import CheckNameAvailabilityResult - from .custom_domain_py3 import CustomDomain - from .encryption_service_py3 import EncryptionService - from .encryption_services_py3 import EncryptionServices - from .key_vault_properties_py3 import KeyVaultProperties - from .encryption_py3 import Encryption - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - from .identity_py3 import Identity - from .storage_account_create_parameters_py3 import StorageAccountCreateParameters - from .endpoints_py3 import Endpoints - from .geo_replication_stats_py3 import GeoReplicationStats - from .storage_account_py3 import StorageAccount - from .storage_account_key_py3 import StorageAccountKey - from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters - from .usage_name_py3 import UsageName - from .usage_py3 import Usage - from .account_sas_parameters_py3 import AccountSasParameters - from .list_account_sas_response_py3 import ListAccountSasResponse - from .service_sas_parameters_py3 import ServiceSasParameters - from .list_service_sas_response_py3 import ListServiceSasResponse - from .proxy_resource_py3 import ProxyResource - from .azure_entity_resource_py3 import AzureEntityResource - from .resource_py3 import Resource - from .tracked_resource_py3 import TrackedResource - from .update_history_property_py3 import UpdateHistoryProperty - from .immutability_policy_properties_py3 import ImmutabilityPolicyProperties - from .tag_property_py3 import TagProperty - from .legal_hold_properties_py3 import LegalHoldProperties - from .blob_container_py3 import BlobContainer - from .immutability_policy_py3 import ImmutabilityPolicy - from .legal_hold_py3 import LegalHold - from .list_container_item_py3 import ListContainerItem - from .list_container_items_py3 import ListContainerItems - from .cors_rule_py3 import CorsRule - from .cors_rules_py3 import CorsRules - from .delete_retention_policy_py3 import DeleteRetentionPolicy - from .blob_service_properties_py3 import BlobServiceProperties - from .lease_container_request_py3 import LeaseContainerRequest - from .lease_container_response_py3 import LeaseContainerResponse - from .storage_account_management_policies_py3 import StorageAccountManagementPolicies - from .management_policies_rules_set_parameter_py3 import ManagementPoliciesRulesSetParameter + from ._models_py3 import AccountSasParameters + from ._models_py3 import AzureEntityResource + from ._models_py3 import BlobContainer + from ._models_py3 import BlobServiceProperties + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CorsRule + from ._models_py3 import CorsRules + from ._models_py3 import CustomDomain + from ._models_py3 import DeleteRetentionPolicy + from ._models_py3 import Dimension + from ._models_py3 import Encryption + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import GeoReplicationStats + from ._models_py3 import Identity + from ._models_py3 import ImmutabilityPolicy + from ._models_py3 import ImmutabilityPolicyProperties + from ._models_py3 import IPRule + from ._models_py3 import KeyVaultProperties + from ._models_py3 import LeaseContainerRequest + from ._models_py3 import LeaseContainerResponse + from ._models_py3 import LegalHold + from ._models_py3 import LegalHoldProperties + from ._models_py3 import ListAccountSasResponse + from ._models_py3 import ListContainerItem + from ._models_py3 import ListContainerItems + from ._models_py3 import ListServiceSasResponse + from ._models_py3 import ManagementPoliciesRulesSetParameter + from ._models_py3 import MetricSpecification + from ._models_py3 import NetworkRuleSet + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import Restriction + from ._models_py3 import ServiceSasParameters + from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SKUCapability + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountManagementPolicies + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import TagProperty + from ._models_py3 import TrackedResource + from ._models_py3 import UpdateHistoryProperty + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import VirtualNetworkRule except (SyntaxError, ImportError): - from .operation_display import OperationDisplay - from .dimension import Dimension - from .metric_specification import MetricSpecification - from .service_specification import ServiceSpecification - from .operation import Operation - from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters - from .sku_capability import SKUCapability - from .restriction import Restriction - from .sku import Sku - from .check_name_availability_result import CheckNameAvailabilityResult - from .custom_domain import CustomDomain - from .encryption_service import EncryptionService - from .encryption_services import EncryptionServices - from .key_vault_properties import KeyVaultProperties - from .encryption import Encryption - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - from .identity import Identity - from .storage_account_create_parameters import StorageAccountCreateParameters - from .endpoints import Endpoints - from .geo_replication_stats import GeoReplicationStats - from .storage_account import StorageAccount - from .storage_account_key import StorageAccountKey - from .storage_account_list_keys_result import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters import StorageAccountUpdateParameters - from .usage_name import UsageName - from .usage import Usage - from .account_sas_parameters import AccountSasParameters - from .list_account_sas_response import ListAccountSasResponse - from .service_sas_parameters import ServiceSasParameters - from .list_service_sas_response import ListServiceSasResponse - from .proxy_resource import ProxyResource - from .azure_entity_resource import AzureEntityResource - from .resource import Resource - from .tracked_resource import TrackedResource - from .update_history_property import UpdateHistoryProperty - from .immutability_policy_properties import ImmutabilityPolicyProperties - from .tag_property import TagProperty - from .legal_hold_properties import LegalHoldProperties - from .blob_container import BlobContainer - from .immutability_policy import ImmutabilityPolicy - from .legal_hold import LegalHold - from .list_container_item import ListContainerItem - from .list_container_items import ListContainerItems - from .cors_rule import CorsRule - from .cors_rules import CorsRules - from .delete_retention_policy import DeleteRetentionPolicy - from .blob_service_properties import BlobServiceProperties - from .lease_container_request import LeaseContainerRequest - from .lease_container_response import LeaseContainerResponse - from .storage_account_management_policies import StorageAccountManagementPolicies - from .management_policies_rules_set_parameter import ManagementPoliciesRulesSetParameter -from .operation_paged import OperationPaged -from .sku_paged import SkuPaged -from .storage_account_paged import StorageAccountPaged -from .usage_paged import UsagePaged -from .storage_management_client_enums import ( + from ._models import AccountSasParameters + from ._models import AzureEntityResource + from ._models import BlobContainer + from ._models import BlobServiceProperties + from ._models import CheckNameAvailabilityResult + from ._models import CorsRule + from ._models import CorsRules + from ._models import CustomDomain + from ._models import DeleteRetentionPolicy + from ._models import Dimension + from ._models import Encryption + from ._models import EncryptionService + from ._models import EncryptionServices + from ._models import Endpoints + from ._models import GeoReplicationStats + from ._models import Identity + from ._models import ImmutabilityPolicy + from ._models import ImmutabilityPolicyProperties + from ._models import IPRule + from ._models import KeyVaultProperties + from ._models import LeaseContainerRequest + from ._models import LeaseContainerResponse + from ._models import LegalHold + from ._models import LegalHoldProperties + from ._models import ListAccountSasResponse + from ._models import ListContainerItem + from ._models import ListContainerItems + from ._models import ListServiceSasResponse + from ._models import ManagementPoliciesRulesSetParameter + from ._models import MetricSpecification + from ._models import NetworkRuleSet + from ._models import Operation + from ._models import OperationDisplay + from ._models import ProxyResource + from ._models import Resource + from ._models import Restriction + from ._models import ServiceSasParameters + from ._models import ServiceSpecification + from ._models import Sku + from ._models import SKUCapability + from ._models import StorageAccount + from ._models import StorageAccountCheckNameAvailabilityParameters + from ._models import StorageAccountCreateParameters + from ._models import StorageAccountKey + from ._models import StorageAccountListKeysResult + from ._models import StorageAccountManagementPolicies + from ._models import StorageAccountRegenerateKeyParameters + from ._models import StorageAccountUpdateParameters + from ._models import TagProperty + from ._models import TrackedResource + from ._models import UpdateHistoryProperty + from ._models import Usage + from ._models import UsageName + from ._models import VirtualNetworkRule +from ._paged_models import OperationPaged +from ._paged_models import SkuPaged +from ._paged_models import StorageAccountPaged +from ._paged_models import UsagePaged +from ._storage_management_client_enums import ( ReasonCode, SkuName, SkuTier, @@ -155,60 +155,60 @@ ) __all__ = [ - 'OperationDisplay', - 'Dimension', - 'MetricSpecification', - 'ServiceSpecification', - 'Operation', - 'StorageAccountCheckNameAvailabilityParameters', - 'SKUCapability', - 'Restriction', - 'Sku', + 'AccountSasParameters', + 'AzureEntityResource', + 'BlobContainer', + 'BlobServiceProperties', 'CheckNameAvailabilityResult', + 'CorsRule', + 'CorsRules', 'CustomDomain', + 'DeleteRetentionPolicy', + 'Dimension', + 'Encryption', 'EncryptionService', 'EncryptionServices', - 'KeyVaultProperties', - 'Encryption', - 'VirtualNetworkRule', - 'IPRule', - 'NetworkRuleSet', - 'Identity', - 'StorageAccountCreateParameters', 'Endpoints', 'GeoReplicationStats', + 'Identity', + 'ImmutabilityPolicy', + 'ImmutabilityPolicyProperties', + 'IPRule', + 'KeyVaultProperties', + 'LeaseContainerRequest', + 'LeaseContainerResponse', + 'LegalHold', + 'LegalHoldProperties', + 'ListAccountSasResponse', + 'ListContainerItem', + 'ListContainerItems', + 'ListServiceSasResponse', + 'ManagementPoliciesRulesSetParameter', + 'MetricSpecification', + 'NetworkRuleSet', + 'Operation', + 'OperationDisplay', + 'ProxyResource', + 'Resource', + 'Restriction', + 'ServiceSasParameters', + 'ServiceSpecification', + 'Sku', + 'SKUCapability', 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', 'StorageAccountKey', 'StorageAccountListKeysResult', + 'StorageAccountManagementPolicies', 'StorageAccountRegenerateKeyParameters', 'StorageAccountUpdateParameters', - 'UsageName', - 'Usage', - 'AccountSasParameters', - 'ListAccountSasResponse', - 'ServiceSasParameters', - 'ListServiceSasResponse', - 'ProxyResource', - 'AzureEntityResource', - 'Resource', + 'TagProperty', 'TrackedResource', 'UpdateHistoryProperty', - 'ImmutabilityPolicyProperties', - 'TagProperty', - 'LegalHoldProperties', - 'BlobContainer', - 'ImmutabilityPolicy', - 'LegalHold', - 'ListContainerItem', - 'ListContainerItems', - 'CorsRule', - 'CorsRules', - 'DeleteRetentionPolicy', - 'BlobServiceProperties', - 'LeaseContainerRequest', - 'LeaseContainerResponse', - 'StorageAccountManagementPolicies', - 'ManagementPoliciesRulesSetParameter', + 'Usage', + 'UsageName', + 'VirtualNetworkRule', 'OperationPaged', 'SkuPaged', 'StorageAccountPaged', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models.py new file mode 100644 index 000000000000..927b1f77074f --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models.py @@ -0,0 +1,2408 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2018_07_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2018_07_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_07_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_07_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_07_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_07_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_07_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_07_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_07_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BlobContainer, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param cors: Specifies CORS rules for the Blob service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2018_07_01.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the + default version to use for requests to the Blob service if an incoming + request’s version is not specified. Possible values include version + 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for soft + delete. + :type delete_retention_policy: + ~azure.mgmt.storage.v2018_07_01.models.DeleteRetentionPolicy + """ + + _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'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + } + + def __init__(self, **kwargs): + super(BlobServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + self.default_service_version = kwargs.get('default_service_version', None) + self.delete_retention_policy = kwargs.get('delete_retention_policy', None) + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2018_07_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CorsRule(Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. + A list of origin domains that will be allowed via CORS, or "*" to allow + all domains + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. + A list of HTTP methods that are allowed to be executed by the origin. + :type allowed_methods: list[str] + :param max_age_in_seconds: Required. Required if CorsRule element is + present. The number of seconds that the client/browser should cache a + preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. + A list of response headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. + A list of headers allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = kwargs.get('allowed_origins', None) + self.allowed_methods = kwargs.get('allowed_methods', None) + self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None) + self.exposed_headers = kwargs.get('exposed_headers', None) + self.allowed_headers = kwargs.get('allowed_headers', None) + + +class CorsRules(Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the + request. . + + :param cors_rules: The List of CORS rules. You can include up to five + CorsRule elements in the request. + :type cors_rules: list[~azure.mgmt.storage.v2018_07_01.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__(self, **kwargs): + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = kwargs.get('cors_rules', None) + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class DeleteRetentionPolicy(Model): + """The blob service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled for the + Blob service. + :type enabled: bool + :param days: Indicates the number of days that the deleted blob should be + retained. The minimum specified value can be 1 and the maximum value can + be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.days = kwargs.get('days', None) + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2018_07_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2018_07_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_07_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class GeoReplicationStats(Model): + """Statistics related to replication for storage account's Blob, Table, Queue + and File services. It is only available when geo-redundant replication is + enabled for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of the secondary location. Possible values are: - + Live: Indicates that the secondary location is active and operational. - + Bootstrap: Indicates initial synchronization from the primary location to + the secondary location is in progress.This typically occurs when + replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: 'Live', + 'Bootstrap', 'Unavailable' + :vartype status: str or + ~azure.mgmt.storage.v2018_07_01.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time + value are guaranteed to be available for read operations. Primary writes + following this point in time may or may not be available for reads. + Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: datetime + :ivar can_failover: A boolean flag which indicates whether or not account + failover is supported for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + 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 immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2018_07_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.etag = None + self.update_history = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_07_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2018_07_01.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = kwargs.get('action', None) + self.lease_id = kwargs.get('lease_id', None) + self.break_period = kwargs.get('break_period', None) + self.lease_duration = kwargs.get('lease_duration', None) + self.proposed_lease_id = kwargs.get('proposed_lease_id', None) + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = kwargs.get('lease_id', None) + self.lease_time_seconds = kwargs.get('lease_time_seconds', None) + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + 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 has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2018_07_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, **kwargs): + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_07_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_07_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_07_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_07_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_07_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListContainerItems(Model): + """The list of blob containers. + + :param value: The list of blob containers. + :type value: + list[~azure.mgmt.storage.v2018_07_01.models.ListContainerItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + } + + def __init__(self, **kwargs): + super(ListContainerItems, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ManagementPoliciesRulesSetParameter(Model): + """The Storage Account ManagementPolicies Rules, in JSON format. See more + details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + """ + + _attribute_map = { + 'policy': {'key': 'properties.policy', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ManagementPoliciesRulesSetParameter, self).__init__(**kwargs) + self.policy = kwargs.get('policy', None) + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2018_07_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2018_07_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_07_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2018_07_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2018_07_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2018_07_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2018_07_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of 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(OperationDisplay, 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) + + +class ProxyResource(Resource): + """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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2018_07_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. + Possible values include: Blob (b), Container (c), File (f), Share (s). + Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2018_07_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_07_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_07_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2018_07_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the SKU name. Required for account + creation; optional for update. Note that in older versions, SKU name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS' + :type name: str or ~azure.mgmt.storage.v2018_07_01.models.SkuName + :ivar tier: Gets the SKU tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2018_07_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified SKU, + including file encryption, network ACLs, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2018_07_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2018_07_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +class SKUCapability(Model): + """The capability information in the specified SKU, including file encryption, + network ACLs, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified SKU, including file encryption, network ACLs, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class StorageAccount(TrackedResource): + """The storage account. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2018_07_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_07_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2018_07_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2018_07_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2018_07_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2018_07_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2018_07_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2018_07_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2018_07_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2018_07_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats + :vartype geo_replication_stats: + ~azure.mgmt.storage.v2018_07_01.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will + be true, otherwise, it will be null. + :vartype failover_in_progress: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = None + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + self.geo_replication_stats = None + self.failover_in_progress = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU name. + :type sku: ~azure.mgmt.storage.v2018_07_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_07_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_07_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_07_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_07_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2018_07_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2018_07_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountManagementPolicies(Resource): + """The Get Storage Account ManagementPolicies operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + :ivar last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(StorageAccountManagementPolicies, self).__init__(**kwargs) + self.policy = kwargs.get('policy', None) + self.last_modified_time = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of + those SKU names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_07_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_07_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_07_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_07_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_07_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.kind = kwargs.get('kind', None) + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2018_07_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2018_07_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_07_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2018_07_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models_py3.py new file mode 100644 index 000000000000..fc79b54c5261 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models_py3.py @@ -0,0 +1,2408 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2018_07_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2018_07_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_07_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_07_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_07_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_07_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_07_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_07_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_07_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(BlobContainer, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param cors: Specifies CORS rules for the Blob service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2018_07_01.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the + default version to use for requests to the Blob service if an incoming + request’s version is not specified. Possible values include version + 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for soft + delete. + :type delete_retention_policy: + ~azure.mgmt.storage.v2018_07_01.models.DeleteRetentionPolicy + """ + + _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'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + } + + def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, **kwargs) -> None: + super(BlobServiceProperties, self).__init__(**kwargs) + self.cors = cors + self.default_service_version = default_service_version + self.delete_retention_policy = delete_retention_policy + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2018_07_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CorsRule(Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. + A list of origin domains that will be allowed via CORS, or "*" to allow + all domains + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. + A list of HTTP methods that are allowed to be executed by the origin. + :type allowed_methods: list[str] + :param max_age_in_seconds: Required. Required if CorsRule element is + present. The number of seconds that the client/browser should cache a + preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. + A list of response headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. + A list of headers allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__(self, *, allowed_origins, allowed_methods, max_age_in_seconds: int, exposed_headers, allowed_headers, **kwargs) -> None: + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = allowed_origins + self.allowed_methods = allowed_methods + self.max_age_in_seconds = max_age_in_seconds + self.exposed_headers = exposed_headers + self.allowed_headers = allowed_headers + + +class CorsRules(Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the + request. . + + :param cors_rules: The List of CORS rules. You can include up to five + CorsRule elements in the request. + :type cors_rules: list[~azure.mgmt.storage.v2018_07_01.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__(self, *, cors_rules=None, **kwargs) -> None: + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = cors_rules + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class DeleteRetentionPolicy(Model): + """The blob service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled for the + Blob service. + :type enabled: bool + :param days: Indicates the number of days that the deleted blob should be + retained. The minimum specified value can be 1 and the maximum value can + be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool=None, days: int=None, **kwargs) -> None: + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = enabled + self.days = days + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2018_07_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2018_07_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_07_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class GeoReplicationStats(Model): + """Statistics related to replication for storage account's Blob, Table, Queue + and File services. It is only available when geo-redundant replication is + enabled for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of the secondary location. Possible values are: - + Live: Indicates that the secondary location is active and operational. - + Bootstrap: Indicates initial synchronization from the primary location to + the secondary location is in progress.This typically occurs when + replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: 'Live', + 'Bootstrap', 'Unavailable' + :vartype status: str or + ~azure.mgmt.storage.v2018_07_01.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time + value are guaranteed to be available for read operations. Primary writes + following this point in time may or may not be available for reads. + Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: datetime + :ivar can_failover: A boolean flag which indicates whether or not account + failover is supported for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + 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 immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2018_07_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.etag = None + self.update_history = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_07_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2018_07_01.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, *, action, lease_id: str=None, break_period: int=None, lease_duration: int=None, proposed_lease_id: str=None, **kwargs) -> None: + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = action + self.lease_id = lease_id + self.break_period = break_period + self.lease_duration = lease_duration + self.proposed_lease_id = proposed_lease_id + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, *, lease_id: str=None, lease_time_seconds: str=None, **kwargs) -> None: + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = lease_id + self.lease_time_seconds = lease_time_seconds + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + 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 has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, *, tags, **kwargs) -> None: + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2018_07_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_07_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_07_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_07_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_07_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_07_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListContainerItems(Model): + """The list of blob containers. + + :param value: The list of blob containers. + :type value: + list[~azure.mgmt.storage.v2018_07_01.models.ListContainerItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ListContainerItems, self).__init__(**kwargs) + self.value = value + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ManagementPoliciesRulesSetParameter(Model): + """The Storage Account ManagementPolicies Rules, in JSON format. See more + details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + """ + + _attribute_map = { + 'policy': {'key': 'properties.policy', 'type': 'object'}, + } + + def __init__(self, *, policy=None, **kwargs) -> None: + super(ManagementPoliciesRulesSetParameter, self).__init__(**kwargs) + self.policy = policy + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2018_07_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2018_07_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_07_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2018_07_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2018_07_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2018_07_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2018_07_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of 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(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ProxyResource(Resource): + """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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2018_07_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. + Possible values include: Blob (b), Container (c), File (f), Share (s). + Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2018_07_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_07_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_07_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource=None, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2018_07_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the SKU name. Required for account + creation; optional for update. Note that in older versions, SKU name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS' + :type name: str or ~azure.mgmt.storage.v2018_07_01.models.SkuName + :ivar tier: Gets the SKU tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2018_07_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified SKU, + including file encryption, network ACLs, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2018_07_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2018_07_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions + + +class SKUCapability(Model): + """The capability information in the specified SKU, including file encryption, + network ACLs, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified SKU, including file encryption, network ACLs, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class StorageAccount(TrackedResource): + """The storage account. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2018_07_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_07_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2018_07_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2018_07_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2018_07_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2018_07_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2018_07_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2018_07_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2018_07_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2018_07_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats + :vartype geo_replication_stats: + ~azure.mgmt.storage.v2018_07_01.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will + be true, otherwise, it will be null. + :vartype failover_in_progress: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None: + super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_azure_files_aad_integration = enable_azure_files_aad_integration + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None + self.is_hns_enabled = is_hns_enabled + self.geo_replication_stats = None + self.failover_in_progress = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU name. + :type sku: ~azure.mgmt.storage.v2018_07_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_07_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_07_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_07_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_07_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.enable_azure_files_aad_integration = enable_azure_files_aad_integration + self.enable_https_traffic_only = enable_https_traffic_only + self.is_hns_enabled = is_hns_enabled + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2018_07_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2018_07_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountManagementPolicies(Resource): + """The Get Storage Account ManagementPolicies operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + :ivar last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, policy=None, **kwargs) -> None: + super(StorageAccountManagementPolicies, self).__init__(**kwargs) + self.policy = policy + self.last_modified_time = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of + those SKU names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_07_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_07_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_07_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_07_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_07_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, network_rule_set=None, kind=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_azure_files_aad_integration = enable_azure_files_aad_integration + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.kind = kind + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2018_07_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2018_07_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_07_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2018_07_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_paged_models.py new file mode 100644 index 000000000000..526105d79683 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_paged_models.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 msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class SkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`Sku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Sku]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuPaged, self).__init__(*args, **kwargs) +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_storage_management_client_enums.py similarity index 100% rename from sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_management_client_enums.py rename to sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_storage_management_client_enums.py diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/account_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/account_sas_parameters.py deleted file mode 100644 index 2684b847f902..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/account_sas_parameters.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2018_07_01.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2018_07_01.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_07_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_07_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AccountSasParameters, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.resource_types = kwargs.get('resource_types', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/account_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/account_sas_parameters_py3.py deleted file mode 100644 index bafb5b3e65f2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/account_sas_parameters_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2018_07_01.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2018_07_01.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_07_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_07_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: - super(AccountSasParameters, self).__init__(**kwargs) - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/azure_entity_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/azure_entity_resource.py deleted file mode 100644 index 3bffaab8d35b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/azure_entity_resource.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/azure_entity_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/azure_entity_resource_py3.py deleted file mode 100644 index d3f80d87498a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/azure_entity_resource_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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_py3 import Resource - - -class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_container.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_container.py deleted file mode 100644 index 7116fe02923d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_container.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class BlobContainer(AzureEntityResource): - """Properties of the blob container, including Id, resource name, resource - type, Etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_07_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_07_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_07_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_07_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_07_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(BlobContainer, self).__init__(**kwargs) - self.public_access = kwargs.get('public_access', None) - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = kwargs.get('metadata', None) - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_container_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_container_py3.py deleted file mode 100644 index c4dc0079b3ba..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_container_py3.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class BlobContainer(AzureEntityResource): - """Properties of the blob container, including Id, resource name, resource - type, Etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_07_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_07_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_07_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_07_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_07_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: - super(BlobContainer, self).__init__(**kwargs) - self.public_access = public_access - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = metadata - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_service_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_service_properties.py deleted file mode 100644 index 912f341bb581..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_service_properties.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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 BlobServiceProperties(Resource): - """The properties of a storage account’s Blob service. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param cors: Specifies CORS rules for the Blob service. You can include up - to five CorsRule elements in the request. If no CorsRule elements are - included in the request body, all CORS rules will be deleted, and CORS - will be disabled for the Blob service. - :type cors: ~azure.mgmt.storage.v2018_07_01.models.CorsRules - :param default_service_version: DefaultServiceVersion indicates the - default version to use for requests to the Blob service if an incoming - request’s version is not specified. Possible values include version - 2008-10-27 and all more recent versions. - :type default_service_version: str - :param delete_retention_policy: The blob service properties for soft - delete. - :type delete_retention_policy: - ~azure.mgmt.storage.v2018_07_01.models.DeleteRetentionPolicy - """ - - _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'}, - 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, - 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, - 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, - } - - def __init__(self, **kwargs): - super(BlobServiceProperties, self).__init__(**kwargs) - self.cors = kwargs.get('cors', None) - self.default_service_version = kwargs.get('default_service_version', None) - self.delete_retention_policy = kwargs.get('delete_retention_policy', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_service_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_service_properties_py3.py deleted file mode 100644 index b2532b2a6cfc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/blob_service_properties_py3.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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_py3 import Resource - - -class BlobServiceProperties(Resource): - """The properties of a storage account’s Blob service. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param cors: Specifies CORS rules for the Blob service. You can include up - to five CorsRule elements in the request. If no CorsRule elements are - included in the request body, all CORS rules will be deleted, and CORS - will be disabled for the Blob service. - :type cors: ~azure.mgmt.storage.v2018_07_01.models.CorsRules - :param default_service_version: DefaultServiceVersion indicates the - default version to use for requests to the Blob service if an incoming - request’s version is not specified. Possible values include version - 2008-10-27 and all more recent versions. - :type default_service_version: str - :param delete_retention_policy: The blob service properties for soft - delete. - :type delete_retention_policy: - ~azure.mgmt.storage.v2018_07_01.models.DeleteRetentionPolicy - """ - - _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'}, - 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, - 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, - 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, - } - - def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, **kwargs) -> None: - super(BlobServiceProperties, self).__init__(**kwargs) - self.cors = cors - self.default_service_version = default_service_version - self.delete_retention_policy = delete_retention_policy diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/check_name_availability_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/check_name_availability_result.py deleted file mode 100644 index 80798d59633b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/check_name_availability_result.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2018_07_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/check_name_availability_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/check_name_availability_result_py3.py deleted file mode 100644 index 6d09f2814e76..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/check_name_availability_result_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2018_07_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/cors_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/cors_rule.py deleted file mode 100644 index 0777423f048f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/cors_rule.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 CorsRule(Model): - """Specifies a CORS rule for the Blob service. - - All required parameters must be populated in order to send to Azure. - - :param allowed_origins: Required. Required if CorsRule element is present. - A list of origin domains that will be allowed via CORS, or "*" to allow - all domains - :type allowed_origins: list[str] - :param allowed_methods: Required. Required if CorsRule element is present. - A list of HTTP methods that are allowed to be executed by the origin. - :type allowed_methods: list[str] - :param max_age_in_seconds: Required. Required if CorsRule element is - present. The number of seconds that the client/browser should cache a - preflight response. - :type max_age_in_seconds: int - :param exposed_headers: Required. Required if CorsRule element is present. - A list of response headers to expose to CORS clients. - :type exposed_headers: list[str] - :param allowed_headers: Required. Required if CorsRule element is present. - A list of headers allowed to be part of the cross-origin request. - :type allowed_headers: list[str] - """ - - _validation = { - 'allowed_origins': {'required': True}, - 'allowed_methods': {'required': True}, - 'max_age_in_seconds': {'required': True}, - 'exposed_headers': {'required': True}, - 'allowed_headers': {'required': True}, - } - - _attribute_map = { - 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, - 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, - 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, - 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, - 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(CorsRule, self).__init__(**kwargs) - self.allowed_origins = kwargs.get('allowed_origins', None) - self.allowed_methods = kwargs.get('allowed_methods', None) - self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None) - self.exposed_headers = kwargs.get('exposed_headers', None) - self.allowed_headers = kwargs.get('allowed_headers', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/cors_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/cors_rule_py3.py deleted file mode 100644 index b88a7928cd1c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/cors_rule_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 CorsRule(Model): - """Specifies a CORS rule for the Blob service. - - All required parameters must be populated in order to send to Azure. - - :param allowed_origins: Required. Required if CorsRule element is present. - A list of origin domains that will be allowed via CORS, or "*" to allow - all domains - :type allowed_origins: list[str] - :param allowed_methods: Required. Required if CorsRule element is present. - A list of HTTP methods that are allowed to be executed by the origin. - :type allowed_methods: list[str] - :param max_age_in_seconds: Required. Required if CorsRule element is - present. The number of seconds that the client/browser should cache a - preflight response. - :type max_age_in_seconds: int - :param exposed_headers: Required. Required if CorsRule element is present. - A list of response headers to expose to CORS clients. - :type exposed_headers: list[str] - :param allowed_headers: Required. Required if CorsRule element is present. - A list of headers allowed to be part of the cross-origin request. - :type allowed_headers: list[str] - """ - - _validation = { - 'allowed_origins': {'required': True}, - 'allowed_methods': {'required': True}, - 'max_age_in_seconds': {'required': True}, - 'exposed_headers': {'required': True}, - 'allowed_headers': {'required': True}, - } - - _attribute_map = { - 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, - 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, - 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, - 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, - 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, - } - - def __init__(self, *, allowed_origins, allowed_methods, max_age_in_seconds: int, exposed_headers, allowed_headers, **kwargs) -> None: - super(CorsRule, self).__init__(**kwargs) - self.allowed_origins = allowed_origins - self.allowed_methods = allowed_methods - self.max_age_in_seconds = max_age_in_seconds - self.exposed_headers = exposed_headers - self.allowed_headers = allowed_headers diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/cors_rules.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/cors_rules.py deleted file mode 100644 index 4b021f3c3688..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/cors_rules.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 CorsRules(Model): - """Sets the CORS rules. You can include up to five CorsRule elements in the - request. . - - :param cors_rules: The List of CORS rules. You can include up to five - CorsRule elements in the request. - :type cors_rules: list[~azure.mgmt.storage.v2018_07_01.models.CorsRule] - """ - - _attribute_map = { - 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, - } - - def __init__(self, **kwargs): - super(CorsRules, self).__init__(**kwargs) - self.cors_rules = kwargs.get('cors_rules', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/cors_rules_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/cors_rules_py3.py deleted file mode 100644 index 7a8695adabaa..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/cors_rules_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 CorsRules(Model): - """Sets the CORS rules. You can include up to five CorsRule elements in the - request. . - - :param cors_rules: The List of CORS rules. You can include up to five - CorsRule elements in the request. - :type cors_rules: list[~azure.mgmt.storage.v2018_07_01.models.CorsRule] - """ - - _attribute_map = { - 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, - } - - def __init__(self, *, cors_rules=None, **kwargs) -> None: - super(CorsRules, self).__init__(**kwargs) - self.cors_rules = cors_rules diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/custom_domain.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/custom_domain.py deleted file mode 100644 index d5cc10da36cb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/custom_domain.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(CustomDomain, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/custom_domain_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/custom_domain_py3.py deleted file mode 100644 index 25dce0b57aee..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/custom_domain_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: - super(CustomDomain, self).__init__(**kwargs) - self.name = name - self.use_sub_domain_name = use_sub_domain_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/delete_retention_policy.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/delete_retention_policy.py deleted file mode 100644 index 1edc91c2320a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/delete_retention_policy.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 DeleteRetentionPolicy(Model): - """The blob service properties for soft delete. - - :param enabled: Indicates whether DeleteRetentionPolicy is enabled for the - Blob service. - :type enabled: bool - :param days: Indicates the number of days that the deleted blob should be - retained. The minimum specified value can be 1 and the maximum value can - be 365. - :type days: int - """ - - _validation = { - 'days': {'maximum': 365, 'minimum': 1}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'days': {'key': 'days', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(DeleteRetentionPolicy, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.days = kwargs.get('days', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/delete_retention_policy_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/delete_retention_policy_py3.py deleted file mode 100644 index 9fcc691aadad..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/delete_retention_policy_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 DeleteRetentionPolicy(Model): - """The blob service properties for soft delete. - - :param enabled: Indicates whether DeleteRetentionPolicy is enabled for the - Blob service. - :type enabled: bool - :param days: Indicates the number of days that the deleted blob should be - retained. The minimum specified value can be 1 and the maximum value can - be 365. - :type days: int - """ - - _validation = { - 'days': {'maximum': 365, 'minimum': 1}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'days': {'key': 'days', 'type': 'int'}, - } - - def __init__(self, *, enabled: bool=None, days: int=None, **kwargs) -> None: - super(DeleteRetentionPolicy, self).__init__(**kwargs) - self.enabled = enabled - self.days = days diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/dimension.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/dimension.py deleted file mode 100644 index 2398aa46e8f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/dimension.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Dimension, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/dimension_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/dimension_py3.py deleted file mode 100644 index af5b0aac3d23..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/dimension_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: - super(Dimension, self).__init__(**kwargs) - self.name = name - self.display_name = display_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption.py deleted file mode 100644 index b7579543feed..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2018_07_01.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or ~azure.mgmt.storage.v2018_07_01.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2018_07_01.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, **kwargs): - super(Encryption, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.key_source = kwargs.get('key_source', "Microsoft.Storage") - self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_py3.py deleted file mode 100644 index 7b12b027cbe9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2018_07_01.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or ~azure.mgmt.storage.v2018_07_01.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2018_07_01.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: - super(Encryption, self).__init__(**kwargs) - self.services = services - self.key_source = key_source - self.key_vault_properties = key_vault_properties diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_service.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_service.py deleted file mode 100644 index 3a020c468f64..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_service.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(EncryptionService, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_service_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_service_py3.py deleted file mode 100644 index 0566050c6155..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_service_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, enabled: bool=None, **kwargs) -> None: - super(EncryptionService, self).__init__(**kwargs) - self.enabled = enabled - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_services.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_services.py deleted file mode 100644 index 12606368487d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_services.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, **kwargs): - super(EncryptionServices, self).__init__(**kwargs) - self.blob = kwargs.get('blob', None) - self.file = kwargs.get('file', None) - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_services_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_services_py3.py deleted file mode 100644 index 2385b58cd95b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/encryption_services_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2018_07_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, *, blob=None, file=None, **kwargs) -> None: - super(EncryptionServices, self).__init__(**kwargs) - self.blob = blob - self.file = file - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/endpoints.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/endpoints.py deleted file mode 100644 index 66b1c3459a5e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/endpoints.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, - table, web or dfs object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - :ivar web: Gets the web endpoint. - :vartype web: str - :ivar dfs: Gets the dfs endpoint. - :vartype dfs: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - 'web': {'readonly': True}, - 'dfs': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - 'web': {'key': 'web', 'type': 'str'}, - 'dfs': {'key': 'dfs', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None - self.web = None - self.dfs = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/endpoints_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/endpoints_py3.py deleted file mode 100644 index ced561acd85b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/endpoints_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, - table, web or dfs object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - :ivar web: Gets the web endpoint. - :vartype web: str - :ivar dfs: Gets the dfs endpoint. - :vartype dfs: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - 'web': {'readonly': True}, - 'dfs': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - 'web': {'key': 'web', 'type': 'str'}, - 'dfs': {'key': 'dfs', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None - self.web = None - self.dfs = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/geo_replication_stats.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/geo_replication_stats.py deleted file mode 100644 index e6001667cd0a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/geo_replication_stats.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 GeoReplicationStats(Model): - """Statistics related to replication for storage account's Blob, Table, Queue - and File services. It is only available when geo-redundant replication is - enabled for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar status: The status of the secondary location. Possible values are: - - Live: Indicates that the secondary location is active and operational. - - Bootstrap: Indicates initial synchronization from the primary location to - the secondary location is in progress.This typically occurs when - replication is first enabled. - Unavailable: Indicates that the secondary - location is temporarily unavailable. Possible values include: 'Live', - 'Bootstrap', 'Unavailable' - :vartype status: str or - ~azure.mgmt.storage.v2018_07_01.models.GeoReplicationStatus - :ivar last_sync_time: All primary writes preceding this UTC date/time - value are guaranteed to be available for read operations. Primary writes - following this point in time may or may not be available for reads. - Element may be default value if value of LastSyncTime is not available, - this can happen if secondary is offline or we are in bootstrap. - :vartype last_sync_time: datetime - :ivar can_failover: A boolean flag which indicates whether or not account - failover is supported for the account. - :vartype can_failover: bool - """ - - _validation = { - 'status': {'readonly': True}, - 'last_sync_time': {'readonly': True}, - 'can_failover': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, - 'can_failover': {'key': 'canFailover', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(GeoReplicationStats, self).__init__(**kwargs) - self.status = None - self.last_sync_time = None - self.can_failover = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/geo_replication_stats_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/geo_replication_stats_py3.py deleted file mode 100644 index 25040a8a0476..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/geo_replication_stats_py3.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 GeoReplicationStats(Model): - """Statistics related to replication for storage account's Blob, Table, Queue - and File services. It is only available when geo-redundant replication is - enabled for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar status: The status of the secondary location. Possible values are: - - Live: Indicates that the secondary location is active and operational. - - Bootstrap: Indicates initial synchronization from the primary location to - the secondary location is in progress.This typically occurs when - replication is first enabled. - Unavailable: Indicates that the secondary - location is temporarily unavailable. Possible values include: 'Live', - 'Bootstrap', 'Unavailable' - :vartype status: str or - ~azure.mgmt.storage.v2018_07_01.models.GeoReplicationStatus - :ivar last_sync_time: All primary writes preceding this UTC date/time - value are guaranteed to be available for read operations. Primary writes - following this point in time may or may not be available for reads. - Element may be default value if value of LastSyncTime is not available, - this can happen if secondary is offline or we are in bootstrap. - :vartype last_sync_time: datetime - :ivar can_failover: A boolean flag which indicates whether or not account - failover is supported for the account. - :vartype can_failover: bool - """ - - _validation = { - 'status': {'readonly': True}, - 'last_sync_time': {'readonly': True}, - 'can_failover': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, - 'can_failover': {'key': 'canFailover', 'type': 'bool'}, - } - - def __init__(self, **kwargs) -> None: - super(GeoReplicationStats, self).__init__(**kwargs) - self.status = None - self.last_sync_time = None - self.can_failover = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/identity.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/identity.py deleted file mode 100644 index f526b986fc70..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/identity.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/identity_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/identity_py3.py deleted file mode 100644 index 22d25fdd85b7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/identity_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs) -> None: - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy.py deleted file mode 100644 index a1fd181e57f7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class ImmutabilityPolicy(AzureEntityResource): - """The ImmutabilityPolicy property of a blob container, including Id, resource - name, resource type, Etag. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImmutabilityPolicy, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) - self.state = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy_properties.py deleted file mode 100644 index dd21a8a48d65..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy_properties.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 ImmutabilityPolicyProperties(Model): - """The properties of an ImmutabilityPolicy of a blob container. - - 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 immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyState - :ivar etag: ImmutabilityPolicy Etag. - :vartype etag: str - :ivar update_history: The ImmutabilityPolicy update history of the blob - container. - :vartype update_history: - list[~azure.mgmt.storage.v2018_07_01.models.UpdateHistoryProperty] - """ - - _validation = { - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - 'etag': {'readonly': True}, - 'update_history': {'readonly': True}, - } - - _attribute_map = { - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, - } - - def __init__(self, **kwargs): - super(ImmutabilityPolicyProperties, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) - self.state = None - self.etag = None - self.update_history = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy_properties_py3.py deleted file mode 100644 index 32ff9c58ae2b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy_properties_py3.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 ImmutabilityPolicyProperties(Model): - """The properties of an ImmutabilityPolicy of a blob container. - - 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 immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyState - :ivar etag: ImmutabilityPolicy Etag. - :vartype etag: str - :ivar update_history: The ImmutabilityPolicy update history of the blob - container. - :vartype update_history: - list[~azure.mgmt.storage.v2018_07_01.models.UpdateHistoryProperty] - """ - - _validation = { - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - 'etag': {'readonly': True}, - 'update_history': {'readonly': True}, - } - - _attribute_map = { - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, - } - - def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: - super(ImmutabilityPolicyProperties, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days - self.state = None - self.etag = None - self.update_history = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy_py3.py deleted file mode 100644 index 1c17d360cc01..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/immutability_policy_py3.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class ImmutabilityPolicy(AzureEntityResource): - """The ImmutabilityPolicy property of a blob container, including Id, resource - name, resource type, Etag. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: - super(ImmutabilityPolicy, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days - self.state = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/ip_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/ip_rule.py deleted file mode 100644 index decfb4bec67c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/ip_rule.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_07_01.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.action = kwargs.get('action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/ip_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/ip_rule_py3.py deleted file mode 100644 index 6cc874cb6e8e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/ip_rule_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_07_01.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = ip_address_or_range - self.action = action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/key_vault_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/key_vault_properties.py deleted file mode 100644 index 44eaf379f6f2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/key_vault_properties.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - self.key_version = kwargs.get('key_version', None) - self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/key_vault_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/key_vault_properties_py3.py deleted file mode 100644 index 9e6350eec898..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/key_vault_properties_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = key_name - self.key_version = key_version - self.key_vault_uri = key_vault_uri diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/lease_container_request.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/lease_container_request.py deleted file mode 100644 index 1c9bcd18dba9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/lease_container_request.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 LeaseContainerRequest(Model): - """Lease Container request schema. - - All required parameters must be populated in order to send to Azure. - - :param action: Required. Specifies the lease action. Can be one of the - available actions. Possible values include: 'Acquire', 'Renew', 'Change', - 'Release', 'Break' - :type action: str or ~azure.mgmt.storage.v2018_07_01.models.enum - :param lease_id: Identifies the lease. Can be specified in any valid GUID - string format. - :type lease_id: str - :param break_period: Optional. For a break action, proposed duration the - lease should continue before it is broken, in seconds, between 0 and 60. - :type break_period: int - :param lease_duration: Required for acquire. Specifies the duration of the - lease, in seconds, or negative one (-1) for a lease that never expires. - :type lease_duration: int - :param proposed_lease_id: Optional for acquire, required for change. - Proposed lease ID, in a GUID string format. - :type proposed_lease_id: str - """ - - _validation = { - 'action': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'break_period': {'key': 'breakPeriod', 'type': 'int'}, - 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, - 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LeaseContainerRequest, self).__init__(**kwargs) - self.action = kwargs.get('action', None) - self.lease_id = kwargs.get('lease_id', None) - self.break_period = kwargs.get('break_period', None) - self.lease_duration = kwargs.get('lease_duration', None) - self.proposed_lease_id = kwargs.get('proposed_lease_id', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/lease_container_request_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/lease_container_request_py3.py deleted file mode 100644 index c8cf4b1df78f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/lease_container_request_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 LeaseContainerRequest(Model): - """Lease Container request schema. - - All required parameters must be populated in order to send to Azure. - - :param action: Required. Specifies the lease action. Can be one of the - available actions. Possible values include: 'Acquire', 'Renew', 'Change', - 'Release', 'Break' - :type action: str or ~azure.mgmt.storage.v2018_07_01.models.enum - :param lease_id: Identifies the lease. Can be specified in any valid GUID - string format. - :type lease_id: str - :param break_period: Optional. For a break action, proposed duration the - lease should continue before it is broken, in seconds, between 0 and 60. - :type break_period: int - :param lease_duration: Required for acquire. Specifies the duration of the - lease, in seconds, or negative one (-1) for a lease that never expires. - :type lease_duration: int - :param proposed_lease_id: Optional for acquire, required for change. - Proposed lease ID, in a GUID string format. - :type proposed_lease_id: str - """ - - _validation = { - 'action': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'break_period': {'key': 'breakPeriod', 'type': 'int'}, - 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, - 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, - } - - def __init__(self, *, action, lease_id: str=None, break_period: int=None, lease_duration: int=None, proposed_lease_id: str=None, **kwargs) -> None: - super(LeaseContainerRequest, self).__init__(**kwargs) - self.action = action - self.lease_id = lease_id - self.break_period = break_period - self.lease_duration = lease_duration - self.proposed_lease_id = proposed_lease_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/lease_container_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/lease_container_response.py deleted file mode 100644 index 666f0e899f1e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/lease_container_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 LeaseContainerResponse(Model): - """Lease Container response schema. - - :param lease_id: Returned unique lease ID that must be included with any - request to delete the container, or to renew, change, or release the - lease. - :type lease_id: str - :param lease_time_seconds: Approximate time remaining in the lease period, - in seconds. - :type lease_time_seconds: str - """ - - _attribute_map = { - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LeaseContainerResponse, self).__init__(**kwargs) - self.lease_id = kwargs.get('lease_id', None) - self.lease_time_seconds = kwargs.get('lease_time_seconds', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/lease_container_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/lease_container_response_py3.py deleted file mode 100644 index fa87d930571d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/lease_container_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 LeaseContainerResponse(Model): - """Lease Container response schema. - - :param lease_id: Returned unique lease ID that must be included with any - request to delete the container, or to renew, change, or release the - lease. - :type lease_id: str - :param lease_time_seconds: Approximate time remaining in the lease period, - in seconds. - :type lease_time_seconds: str - """ - - _attribute_map = { - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, - } - - def __init__(self, *, lease_id: str=None, lease_time_seconds: str=None, **kwargs) -> None: - super(LeaseContainerResponse, self).__init__(**kwargs) - self.lease_id = lease_id - self.lease_time_seconds = lease_time_seconds diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold.py deleted file mode 100644 index 4eb93df1d9fe..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 LegalHold(Model): - """The LegalHold property of a blob container. - - 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 has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: Required. Each tag should be 3 to 23 alphanumeric characters - and is normalized to lower case at SRP. - :type tags: list[str] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - 'tags': {'required': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(LegalHold, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = kwargs.get('tags', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold_properties.py deleted file mode 100644 index fcf2cd1a681b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold_properties.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 LegalHoldProperties(Model): - """The LegalHold property of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: The list of LegalHold tags of a blob container. - :type tags: list[~azure.mgmt.storage.v2018_07_01.models.TagProperty] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[TagProperty]'}, - } - - def __init__(self, **kwargs): - super(LegalHoldProperties, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = kwargs.get('tags', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold_properties_py3.py deleted file mode 100644 index e6066c97b396..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold_properties_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 LegalHoldProperties(Model): - """The LegalHold property of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: The list of LegalHold tags of a blob container. - :type tags: list[~azure.mgmt.storage.v2018_07_01.models.TagProperty] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[TagProperty]'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(LegalHoldProperties, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = tags diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold_py3.py deleted file mode 100644 index a4bc196cb604..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/legal_hold_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 LegalHold(Model): - """The LegalHold property of a blob container. - - 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 has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: Required. Each tag should be 3 to 23 alphanumeric characters - and is normalized to lower case at SRP. - :type tags: list[str] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - 'tags': {'required': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - } - - def __init__(self, *, tags, **kwargs) -> None: - super(LegalHold, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = tags diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_account_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_account_sas_response.py deleted file mode 100644 index a56e959a34bd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_account_sas_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_account_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_account_sas_response_py3.py deleted file mode 100644 index b8b9a314d9f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_account_sas_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_item.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_item.py deleted file mode 100644 index 5fe7cc1b0ce7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_item.py +++ /dev/null @@ -1,118 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class ListContainerItem(AzureEntityResource): - """The blob container properties be listed out. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_07_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_07_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_07_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_07_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_07_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(ListContainerItem, self).__init__(**kwargs) - self.public_access = kwargs.get('public_access', None) - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = kwargs.get('metadata', None) - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_item_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_item_py3.py deleted file mode 100644 index 1e67232a5a61..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_item_py3.py +++ /dev/null @@ -1,118 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class ListContainerItem(AzureEntityResource): - """The blob container properties be listed out. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_07_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_07_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_07_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_07_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_07_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: - super(ListContainerItem, self).__init__(**kwargs) - self.public_access = public_access - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = metadata - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_items.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_items.py deleted file mode 100644 index 9fc5346e5102..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_items.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ListContainerItems(Model): - """The list of blob containers. - - :param value: The list of blob containers. - :type value: - list[~azure.mgmt.storage.v2018_07_01.models.ListContainerItem] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ListContainerItem]'}, - } - - def __init__(self, **kwargs): - super(ListContainerItems, self).__init__(**kwargs) - self.value = kwargs.get('value', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_items_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_items_py3.py deleted file mode 100644 index a689dc1e3f14..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_container_items_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ListContainerItems(Model): - """The list of blob containers. - - :param value: The list of blob containers. - :type value: - list[~azure.mgmt.storage.v2018_07_01.models.ListContainerItem] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ListContainerItem]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(ListContainerItems, self).__init__(**kwargs) - self.value = value diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_service_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_service_sas_response.py deleted file mode 100644 index d4ab160ae364..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_service_sas_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_service_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_service_sas_response_py3.py deleted file mode 100644 index 7c20617658df..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/list_service_sas_response_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/management_policies_rules_set_parameter.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/management_policies_rules_set_parameter.py deleted file mode 100644 index c814a5b9391f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/management_policies_rules_set_parameter.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 ManagementPoliciesRulesSetParameter(Model): - """The Storage Account ManagementPolicies Rules, in JSON format. See more - details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - - :param policy: The Storage Account ManagementPolicies Rules, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: object - """ - - _attribute_map = { - 'policy': {'key': 'properties.policy', 'type': 'object'}, - } - - def __init__(self, **kwargs): - super(ManagementPoliciesRulesSetParameter, self).__init__(**kwargs) - self.policy = kwargs.get('policy', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/management_policies_rules_set_parameter_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/management_policies_rules_set_parameter_py3.py deleted file mode 100644 index 7fb665877844..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/management_policies_rules_set_parameter_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 ManagementPoliciesRulesSetParameter(Model): - """The Storage Account ManagementPolicies Rules, in JSON format. See more - details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - - :param policy: The Storage Account ManagementPolicies Rules, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: object - """ - - _attribute_map = { - 'policy': {'key': 'properties.policy', 'type': 'object'}, - } - - def __init__(self, *, policy=None, **kwargs) -> None: - super(ManagementPoliciesRulesSetParameter, self).__init__(**kwargs) - self.policy = policy diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/metric_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/metric_specification.py deleted file mode 100644 index 0b12a11ef865..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/metric_specification.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: list[~azure.mgmt.storage.v2018_07_01.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MetricSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.dimensions = kwargs.get('dimensions', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) - self.category = kwargs.get('category', None) - self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/metric_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/metric_specification_py3.py deleted file mode 100644 index 7a2c4777e90b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/metric_specification_py3.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: list[~azure.mgmt.storage.v2018_07_01.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: - super(MetricSpecification, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.dimensions = dimensions - self.aggregation_type = aggregation_type - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/network_rule_set.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/network_rule_set.py deleted file mode 100644 index 9ec169475870..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/network_rule_set.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2018_07_01.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2018_07_01.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: list[~azure.mgmt.storage.v2018_07_01.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2018_07_01.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = kwargs.get('bypass', "AzureServices") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) - self.default_action = kwargs.get('default_action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/network_rule_set_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/network_rule_set_py3.py deleted file mode 100644 index 50fc223d26f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/network_rule_set_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2018_07_01.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2018_07_01.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: list[~azure.mgmt.storage.v2018_07_01.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2018_07_01.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = bypass - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules - self.default_action = default_action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation.py deleted file mode 100644 index b75742f63b76..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~azure.mgmt.storage.v2018_07_01.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2018_07_01.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_display.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_display.py deleted file mode 100644 index 029cfa2a8304..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_display.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of 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(OperationDisplay, 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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_display_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_display_py3.py deleted file mode 100644 index 318ba2236d3e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_display_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of 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(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_paged.py deleted file mode 100644 index a24f58ac96c1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_py3.py deleted file mode 100644 index b89d9bd94606..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/operation_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~azure.mgmt.storage.v2018_07_01.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2018_07_01.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/proxy_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/proxy_resource.py deleted file mode 100644 index 0de8fb6bd420..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/proxy_resource.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 ProxyResource(Resource): - """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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/proxy_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/proxy_resource_py3.py deleted file mode 100644 index 2e8391f912d6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/proxy_resource_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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_py3 import Resource - - -class ProxyResource(Resource): - """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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/resource.py deleted file mode 100644 index 9333a2ac49ef..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/resource.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/resource_py3.py deleted file mode 100644 index 370e6c506581..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/resource_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/restriction.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/restriction.py deleted file mode 100644 index f23b0c7f6f1a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/restriction.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2018_07_01.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = kwargs.get('reason_code', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/restriction_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/restriction_py3.py deleted file mode 100644 index 35b1b47b8988..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/restriction_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2018_07_01.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, *, reason_code=None, **kwargs) -> None: - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = reason_code diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_sas_parameters.py deleted file mode 100644 index f03945cf2d52..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_sas_parameters.py +++ /dev/null @@ -1,120 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2018_07_01.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_07_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_07_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = kwargs.get('canonicalized_resource', None) - self.resource = kwargs.get('resource', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.identifier = kwargs.get('identifier', None) - self.partition_key_start = kwargs.get('partition_key_start', None) - self.partition_key_end = kwargs.get('partition_key_end', None) - self.row_key_start = kwargs.get('row_key_start', None) - self.row_key_end = kwargs.get('row_key_end', None) - self.key_to_sign = kwargs.get('key_to_sign', None) - self.cache_control = kwargs.get('cache_control', None) - self.content_disposition = kwargs.get('content_disposition', None) - self.content_encoding = kwargs.get('content_encoding', None) - self.content_language = kwargs.get('content_language', None) - self.content_type = kwargs.get('content_type', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_sas_parameters_py3.py deleted file mode 100644 index 758fc33fe5ce..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_sas_parameters_py3.py +++ /dev/null @@ -1,120 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2018_07_01.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_07_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_07_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, *, canonicalized_resource: str, resource=None, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_specification.py deleted file mode 100644 index f2def7472dc0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_specification.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2018_07_01.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, **kwargs): - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_specification_py3.py deleted file mode 100644 index aa4f6e34f791..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/service_specification_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2018_07_01.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku.py deleted file mode 100644 index 09d4d6f39c47..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the SKU name. Required for account - creation; optional for update. Note that in older versions, SKU name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', - 'Premium_ZRS' - :type name: str or ~azure.mgmt.storage.v2018_07_01.models.SkuName - :ivar tier: Gets the SKU tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2018_07_01.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', - 'BlockBlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified SKU, - including file encryption, network ACLs, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2018_07_01.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2018_07_01.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = kwargs.get('restrictions', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_capability.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_capability.py deleted file mode 100644 index 3f27b5e45feb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_capability.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified SKU, including file encryption, - network ACLs, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified SKU, including file encryption, network ACLs, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_capability_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_capability_py3.py deleted file mode 100644 index 5bc3628f2173..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_capability_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified SKU, including file encryption, - network ACLs, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified SKU, including file encryption, network ACLs, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_paged.py deleted file mode 100644 index 8956385239ae..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 SkuPaged(Paged): - """ - A paging container for iterating over a list of :class:`Sku ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Sku]'} - } - - def __init__(self, *args, **kwargs): - - super(SkuPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_py3.py deleted file mode 100644 index 1139681f50ed..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/sku_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the SKU name. Required for account - creation; optional for update. Note that in older versions, SKU name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', - 'Premium_ZRS' - :type name: str or ~azure.mgmt.storage.v2018_07_01.models.SkuName - :ivar tier: Gets the SKU tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2018_07_01.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', - 'BlockBlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified SKU, - including file encryption, network ACLs, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2018_07_01.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2018_07_01.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, *, name, restrictions=None, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = restrictions diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account.py deleted file mode 100644 index 0c9c592accff..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account.py +++ /dev/null @@ -1,191 +0,0 @@ -# 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 .tracked_resource import TrackedResource - - -class StorageAccount(TrackedResource): - """The storage account. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2018_07_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_07_01.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2018_07_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2018_07_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2018_07_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2018_07_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2018_07_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2018_07_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2018_07_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2018_07_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. - :type is_hns_enabled: bool - :ivar geo_replication_stats: Geo Replication Stats - :vartype geo_replication_stats: - ~azure.mgmt.storage.v2018_07_01.models.GeoReplicationStats - :ivar failover_in_progress: If the failover is in progress, the value will - be true, otherwise, it will be null. - :vartype failover_in_progress: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'readonly': True}, - 'geo_replication_stats': {'readonly': True}, - 'failover_in_progress': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, - 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccount, self).__init__(**kwargs) - self.sku = None - self.kind = None - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) - self.network_rule_set = None - self.is_hns_enabled = kwargs.get('is_hns_enabled', None) - self.geo_replication_stats = None - self.failover_in_progress = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_check_name_availability_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_check_name_availability_parameters.py deleted file mode 100644 index dbe41bb2c6b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_check_name_availability_parameters.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, **kwargs): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_check_name_availability_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_check_name_availability_parameters_py3.py deleted file mode 100644 index 8d2b031e2284..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_check_name_availability_parameters_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, *, name: str, **kwargs) -> None: - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_create_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_create_parameters.py deleted file mode 100644 index 045aa31eba4a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_create_parameters.py +++ /dev/null @@ -1,102 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the SKU name. - :type sku: ~azure.mgmt.storage.v2018_07_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'StorageV2', 'BlobStorage', - 'FileStorage', 'BlockBlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_07_01.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2018_07_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2018_07_01.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_07_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. - :type is_hns_enabled: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) - self.is_hns_enabled = kwargs.get('is_hns_enabled', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_create_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_create_parameters_py3.py deleted file mode 100644 index 094bc764f3a3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_create_parameters_py3.py +++ /dev/null @@ -1,102 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the SKU name. - :type sku: ~azure.mgmt.storage.v2018_07_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'StorageV2', 'BlobStorage', - 'FileStorage', 'BlockBlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_07_01.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2018_07_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2018_07_01.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_07_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. - :type is_hns_enabled: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None: - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.network_rule_set = network_rule_set - self.access_tier = access_tier - self.enable_azure_files_aad_integration = enable_azure_files_aad_integration - self.enable_https_traffic_only = enable_https_traffic_only - self.is_hns_enabled = is_hns_enabled diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_key.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_key.py deleted file mode 100644 index 5fafecd6a4ce..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_key.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2018_07_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs): - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_key_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_key_py3.py deleted file mode 100644 index 7ee7e99f2bdf..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_key_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2018_07_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_list_keys_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_list_keys_result.py deleted file mode 100644 index 0d5d0cbbe0bf..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_list_keys_result.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2018_07_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs): - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_list_keys_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_list_keys_result_py3.py deleted file mode 100644 index d14a6efa05c6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_list_keys_result_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2018_07_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_management_policies.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_management_policies.py deleted file mode 100644 index 59ee515d9a04..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_management_policies.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 StorageAccountManagementPolicies(Resource): - """The Get Storage Account ManagementPolicies operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param policy: The Storage Account ManagementPolicies Rules, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: object - :ivar last_modified_time: Returns the date and time the ManagementPolicies - was last modified. - :vartype last_modified_time: datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'policy': {'key': 'properties.policy', 'type': 'object'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(StorageAccountManagementPolicies, self).__init__(**kwargs) - self.policy = kwargs.get('policy', None) - self.last_modified_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_management_policies_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_management_policies_py3.py deleted file mode 100644 index 3dc977624949..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_management_policies_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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_py3 import Resource - - -class StorageAccountManagementPolicies(Resource): - """The Get Storage Account ManagementPolicies operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param policy: The Storage Account ManagementPolicies Rules, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: object - :ivar last_modified_time: Returns the date and time the ManagementPolicies - was last modified. - :vartype last_modified_time: datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'policy': {'key': 'properties.policy', 'type': 'object'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, policy=None, **kwargs) -> None: - super(StorageAccountManagementPolicies, self).__init__(**kwargs) - self.policy = policy - self.last_modified_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_paged.py deleted file mode 100644 index 28b37472e3cb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 StorageAccountPaged(Paged): - """ - A paging container for iterating over a list of :class:`StorageAccount ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[StorageAccount]'} - } - - def __init__(self, *args, **kwargs): - - super(StorageAccountPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_py3.py deleted file mode 100644 index a08fcf8b985c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_py3.py +++ /dev/null @@ -1,191 +0,0 @@ -# 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 .tracked_resource_py3 import TrackedResource - - -class StorageAccount(TrackedResource): - """The storage account. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2018_07_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_07_01.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2018_07_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2018_07_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2018_07_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2018_07_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2018_07_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2018_07_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2018_07_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2018_07_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. - :type is_hns_enabled: bool - :ivar geo_replication_stats: Geo Replication Stats - :vartype geo_replication_stats: - ~azure.mgmt.storage.v2018_07_01.models.GeoReplicationStats - :ivar failover_in_progress: If the failover is in progress, the value will - be true, otherwise, it will be null. - :vartype failover_in_progress: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'readonly': True}, - 'geo_replication_stats': {'readonly': True}, - 'failover_in_progress': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, - 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, - } - - def __init__(self, *, location: str, tags=None, identity=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None: - super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) - self.sku = None - self.kind = None - self.identity = identity - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_azure_files_aad_integration = enable_azure_files_aad_integration - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = None - self.is_hns_enabled = is_hns_enabled - self.geo_replication_stats = None - self.failover_in_progress = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_regenerate_key_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_regenerate_key_parameters.py deleted file mode 100644 index 6dba2135fdc7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_regenerate_key_parameters.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_regenerate_key_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_regenerate_key_parameters_py3.py deleted file mode 100644 index 6e06a071eba3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_regenerate_key_parameters_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = key_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_update_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_update_parameters.py deleted file mode 100644 index 0bd21d95a2c6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_update_parameters.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of - those SKU names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2018_07_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_07_01.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2018_07_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2018_07_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_07_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet - :param kind: Optional. Indicates the type of storage account. Currently - only StorageV2 value supported by server. Possible values include: - 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - } - - def __init__(self, **kwargs): - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.kind = kwargs.get('kind', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_update_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_update_parameters_py3.py deleted file mode 100644 index f65f85ff454b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/storage_account_update_parameters_py3.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of - those SKU names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2018_07_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_07_01.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2018_07_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2018_07_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_07_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_07_01.models.NetworkRuleSet - :param kind: Optional. Indicates the type of storage account. Currently - only StorageV2 value supported by server. Possible values include: - 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_07_01.models.Kind - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - } - - def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, network_rule_set=None, kind=None, **kwargs) -> None: - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = sku - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_azure_files_aad_integration = enable_azure_files_aad_integration - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = network_rule_set - self.kind = kind diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tag_property.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tag_property.py deleted file mode 100644 index 3b879061fd2b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tag_property.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 TagProperty(Model): - """A tag of the LegalHold of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tag: The tag value. - :vartype tag: str - :ivar timestamp: Returns the date and time the tag was added. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who added the - tag. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who added the tag. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who added the tag. - :vartype upn: str - """ - - _validation = { - 'tag': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'tag': {'key': 'tag', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TagProperty, self).__init__(**kwargs) - self.tag = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tag_property_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tag_property_py3.py deleted file mode 100644 index 22aaf6cb82ba..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tag_property_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 TagProperty(Model): - """A tag of the LegalHold of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tag: The tag value. - :vartype tag: str - :ivar timestamp: Returns the date and time the tag was added. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who added the - tag. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who added the tag. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who added the tag. - :vartype upn: str - """ - - _validation = { - 'tag': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'tag': {'key': 'tag', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(TagProperty, self).__init__(**kwargs) - self.tag = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tracked_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tracked_resource.py deleted file mode 100644 index 27ab94c7a8dd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tracked_resource.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 TrackedResource(Resource): - """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs.get('location', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tracked_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tracked_resource_py3.py deleted file mode 100644 index b28cc1859448..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/tracked_resource_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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_py3 import Resource - - -class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/update_history_property.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/update_history_property.py deleted file mode 100644 index e8e07b3db664..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/update_history_property.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 UpdateHistoryProperty(Model): - """An update history of the ImmutabilityPolicy of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar update: The ImmutabilityPolicy update type of a blob container, - possible values include: put, lock and extend. Possible values include: - 'put', 'lock', 'extend' - :vartype update: str or - ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyUpdateType - :ivar immutability_period_since_creation_in_days: The immutability period - for the blobs in the container since the policy creation, in days. - :vartype immutability_period_since_creation_in_days: int - :ivar timestamp: Returns the date and time the ImmutabilityPolicy was - updated. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who updated the - ImmutabilityPolicy. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who updated the ImmutabilityPolicy. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who updated the - ImmutabilityPolicy. - :vartype upn: str - """ - - _validation = { - 'update': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'update': {'key': 'update', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UpdateHistoryProperty, self).__init__(**kwargs) - self.update = None - self.immutability_period_since_creation_in_days = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/update_history_property_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/update_history_property_py3.py deleted file mode 100644 index d503f9b91344..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/update_history_property_py3.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 UpdateHistoryProperty(Model): - """An update history of the ImmutabilityPolicy of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar update: The ImmutabilityPolicy update type of a blob container, - possible values include: put, lock and extend. Possible values include: - 'put', 'lock', 'extend' - :vartype update: str or - ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicyUpdateType - :ivar immutability_period_since_creation_in_days: The immutability period - for the blobs in the container since the policy creation, in days. - :vartype immutability_period_since_creation_in_days: int - :ivar timestamp: Returns the date and time the ImmutabilityPolicy was - updated. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who updated the - ImmutabilityPolicy. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who updated the ImmutabilityPolicy. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who updated the - ImmutabilityPolicy. - :vartype upn: str - """ - - _validation = { - 'update': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'update': {'key': 'update', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UpdateHistoryProperty, self).__init__(**kwargs) - self.update = None - self.immutability_period_since_creation_in_days = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage.py deleted file mode 100644 index ca31da73d629..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2018_07_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2018_07_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs): - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_name.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_name.py deleted file mode 100644 index e4082bf52384..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_name.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_name_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_name_py3.py deleted file mode 100644 index f519bb5072b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_name_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_paged.py deleted file mode 100644 index d5b106fd2757..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 UsagePaged(Paged): - """ - A paging container for iterating over a list of :class:`Usage ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Usage]'} - } - - def __init__(self, *args, **kwargs): - - super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_py3.py deleted file mode 100644 index 7115cd739ce7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/usage_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2018_07_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2018_07_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs) -> None: - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/virtual_network_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/virtual_network_rule.py deleted file mode 100644 index 22e2c834dfc0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/virtual_network_rule.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_07_01.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2018_07_01.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) - self.action = kwargs.get('action', "Allow") - self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/virtual_network_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/virtual_network_rule_py3.py deleted file mode 100644 index b1401da53ba4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_07_01.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2018_07_01.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = virtual_network_resource_id - self.action = action - self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/__init__.py index 78a2d1b4828c..37f098d2856f 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/__init__.py @@ -9,13 +9,13 @@ # regenerated. # -------------------------------------------------------------------------- -from .operations import Operations -from .skus_operations import SkusOperations -from .storage_accounts_operations import StorageAccountsOperations -from .usages_operations import UsagesOperations -from .blob_services_operations import BlobServicesOperations -from .blob_containers_operations import BlobContainersOperations -from .management_policies_operations import ManagementPoliciesOperations +from ._operations import Operations +from ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._usages_operations import UsagesOperations +from ._blob_services_operations import BlobServicesOperations +from ._blob_containers_operations import BlobContainersOperations +from ._management_policies_operations import ManagementPoliciesOperations __all__ = [ 'Operations', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_containers_operations.py new file mode 100644 index 000000000000..bdd37db81272 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_containers_operations.py @@ -0,0 +1,1118 @@ +# 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 BlobContainersOperations(object): + """BlobContainersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-07-01". + :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-01" + self.immutability_policy_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists all containers and does not support a prefix like data plane. + Also SRP today does not return continuation token. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: ListContainerItems or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.ListContainerItems or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('ListContainerItems', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} + + def create( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Creates a new container under the specified account as described by + request body. The container resource includes metadata and properties + for that container. It does not include a list of the blobs contained + by the container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_07_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def update( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Updates container properties as specified in request body. Properties + not mentioned in the request will be unchanged. Update fails if the + specified container doesn't already exist. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_07_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def get( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Gets properties of a specified container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_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: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def delete( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Deletes specified container under its account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def set_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Sets legal hold tags. Setting the same tag results in an idempotent + operation. SetLegalHold follows an append pattern and does not clear + out the existing tags that are not specified in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.set_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} + + def clear_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Clears legal hold tags. Clearing the same or non-existent tag results + in an idempotent operation. ClearLegalHold clears out only the + specified tags in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.clear_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} + + def create_or_update_immutability_policy( + self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an unlocked immutability policy. ETag in If-Match is + honored if given but not required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.create_or_update_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def get_immutability_policy( + self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): + """Gets the existing immutability policy along with the corresponding ETag + in response headers and body. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def delete_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Aborts an unlocked immutability policy. The response of delete has + immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is + required for this operation. Deleting a locked immutability policy is + not allowed, only way is to delete the container after deleting all + blobs inside the container. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def lock_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Sets the ImmutabilityPolicy to Locked state. The only action allowed on + a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is + required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lock_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} + + def extend_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): + """Extends the immutabilityPeriodSinceCreationInDays of a locked + immutabilityPolicy. The only action allowed on a Locked policy will be + this action. ETag in If-Match is required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.extend_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} + + def lease( + self, resource_group_name, account_name, container_name, parameters=None, custom_headers=None, raw=False, **operation_config): + """The Lease Container operation establishes and manages a lock on a + container for delete operations. The lock duration can be 15 to 60 + seconds, or can be infinite. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param parameters: Lease Container request body. + :type parameters: + ~azure.mgmt.storage.v2018_07_01.models.LeaseContainerRequest + :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: LeaseContainerResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.LeaseContainerResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lease.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseContainerRequest') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LeaseContainerResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_services_operations.py new file mode 100644 index 000000000000..b99f8179a45b --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_blob_services_operations.py @@ -0,0 +1,185 @@ +# 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 BlobServicesOperations(object): + """BlobServicesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-07-01". + :ivar blob_services_name: The name of the blob Service within the specified storage account. Blob Service Name must be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-01" + self.blob_services_name = "default" + + self.config = config + + def set_service_properties( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """Sets the properties of a storage account’s Blob service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Blob service, + including properties for Storage Analytics and CORS (Cross-Origin + Resource Sharing) rules. + :type parameters: + ~azure.mgmt.storage.v2018_07_01.models.BlobServiceProperties + :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: BlobServiceProperties or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.set_service_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'BlobServiceProperties') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('BlobServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} + + def get_service_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of a storage account’s Blob service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: BlobServiceProperties or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_service_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('BlobServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_management_policies_operations.py new file mode 100644 index 000000000000..efabaa4364d6 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_management_policies_operations.py @@ -0,0 +1,246 @@ +# 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 ManagementPoliciesOperations(object): + """ManagementPoliciesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-03-01-preview". + :ivar management_policy_name: The name of the Storage Account Management Policy. It should always be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-01-preview" + self.management_policy_name = "default" + + self.config = config + + def get( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the data policy rules associated with the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccountManagementPolicies or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.StorageAccountManagementPolicies + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccountManagementPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} + + def create_or_update( + self, resource_group_name, account_name, policy=None, custom_headers=None, raw=False, **operation_config): + """Sets the data policy rules associated with the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param policy: The Storage Account ManagementPolicies Rules, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: object + :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: StorageAccountManagementPolicies or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.StorageAccountManagementPolicies + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + properties = models.ManagementPoliciesRulesSetParameter(policy=policy) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(properties, 'ManagementPoliciesRulesSetParameter') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccountManagementPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes the data policy rules associated with the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_operations.py new file mode 100644 index 000000000000..612d841fc018 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_operations.py @@ -0,0 +1,102 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Storage 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 Operation + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.OperationPaged[~azure.mgmt.storage.v2018_07_01.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_skus_operations.py new file mode 100644 index 000000000000..20b08e1759e7 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_skus_operations.py @@ -0,0 +1,107 @@ +# 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 SkusOperations(object): + """SkusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the available SKUs supported by Microsoft.Storage for given + 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 Sku + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.SkuPaged[~azure.mgmt.storage.v2018_07_01.models.Sku] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..a0bca262e441 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_storage_accounts_operations.py @@ -0,0 +1,934 @@ +# 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 StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-01" + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: The storage account name. + :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) + + # 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', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2018_07_01.models.StorageAccountCreateParameters + :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 StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2018_07_01.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2018_07_01.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param expand: May be used to expand the properties within account's + properties. By default, data is not included when fetching properties. + Currently we only support geoReplicationStats. Possible values + include: 'geoReplicationStats' + :type expand: str or + ~azure.mgmt.storage.v2018_07_01.models.StorageAccountExpand + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'StorageAccountExpand') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2018_07_01.models.StorageAccountUpdateParameters + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_07_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_07_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: The name of storage keys that want to be regenerated, + possible values are key1, key2. + :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} + + def list_account_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials + for the storage account. + :type parameters: + ~azure.mgmt.storage.v2018_07_01.models.AccountSasParameters + :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: ListAccountSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.ListAccountSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_account_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'AccountSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListAccountSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} + + def list_service_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS + credentials. + :type parameters: + ~azure.mgmt.storage.v2018_07_01.models.ServiceSasParameters + :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: ListServiceSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_07_01.models.ListServiceSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_service_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'ServiceSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListServiceSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} + + + def _failover_initial( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.failover.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, 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 failover( + self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Failover request can be triggered for a storage account in case of + availability issues. The failover occurs from the storage account's + primary cluster to secondary cluster for RA-GRS accounts. The secondary + cluster will become primary after failover. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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._failover_initial( + resource_group_name=resource_group_name, + account_name=account_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, lro_options={'final-state-via': 'location'}, **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) + failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_usages_operations.py new file mode 100644 index 000000000000..eab7c87e8039 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_usages_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class UsagesOperations(object): + """UsagesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-01" + + self.config = config + + def list_by_location( + self, location, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources of the + location under the subscription. + + :param location: The location of the Azure Storage resource. + :type location: 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 Usage + :rtype: + ~azure.mgmt.storage.v2018_07_01.models.UsagePaged[~azure.mgmt.storage.v2018_07_01.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, '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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/blob_containers_operations.py deleted file mode 100644 index 46b53c34d5c2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/blob_containers_operations.py +++ /dev/null @@ -1,1128 +0,0 @@ -# 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 BlobContainersOperations(object): - """BlobContainersOperations 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 API version to use for this operation. Constant value: "2018-07-01". - :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-07-01" - self.immutability_policy_name = "default" - - self.config = config - - def list( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists all containers and does not support a prefix like data plane. - Also SRP today does not return continuation token. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: ListContainerItems or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.ListContainerItems or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('ListContainerItems', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} - - def create( - self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): - """Creates a new container under the specified account as described by - request body. The container resource includes metadata and properties - for that container. It does not include a list of the blobs contained - by the container. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_07_01.models.PublicAccess - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: 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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobContainer or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) - - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(blob_container, 'BlobContainer') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def update( - self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): - """Updates container properties as specified in request body. Properties - not mentioned in the request will be unchanged. Update fails if the - specified container doesn't already exist. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_07_01.models.PublicAccess - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: 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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobContainer or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(blob_container, 'BlobContainer') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def get( - self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): - """Gets properties of a specified container. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_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: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobContainer or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def delete( - self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): - """Deletes specified container under its account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def set_legal_hold( - self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): - """Sets legal hold tags. Setting the same tag results in an idempotent - operation. SetLegalHold follows an append pattern and does not clear - out the existing tags that are not specified in the request. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param tags: Each tag should be 3 to 23 alphanumeric characters and is - normalized to lower case at SRP. - :type tags: list[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: LegalHold or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.LegalHold or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - legal_hold = models.LegalHold(tags=tags) - - # Construct URL - url = self.set_legal_hold.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(legal_hold, 'LegalHold') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LegalHold', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} - - def clear_legal_hold( - self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): - """Clears legal hold tags. Clearing the same or non-existent tag results - in an idempotent operation. ClearLegalHold clears out only the - specified tags in the request. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param tags: Each tag should be 3 to 23 alphanumeric characters and is - normalized to lower case at SRP. - :type tags: list[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: LegalHold or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.LegalHold or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - legal_hold = models.LegalHold(tags=tags) - - # Construct URL - url = self.clear_legal_hold.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(legal_hold, 'LegalHold') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LegalHold', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} - - def create_or_update_immutability_policy( - self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates an unlocked immutability policy. ETag in If-Match is - honored if given but not required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param immutability_period_since_creation_in_days: The immutability - period for the blobs in the container since the policy creation, in - days. - :type immutability_period_since_creation_in_days: int - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = None - if immutability_period_since_creation_in_days is not None: - parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) - - # Construct URL - url = self.create_or_update_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') - else: - body_content = None - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def get_immutability_policy( - self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): - """Gets the existing immutability policy along with the corresponding ETag - in response headers and body. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def delete_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): - """Aborts an unlocked immutability policy. The response of delete has - immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is - required for this operation. Deleting a locked immutability policy is - not allowed, only way is to delete the container after deleting all - blobs inside the container. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def lock_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): - """Sets the ImmutabilityPolicy to Locked state. The only action allowed on - a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is - required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.lock_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} - - def extend_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): - """Extends the immutabilityPeriodSinceCreationInDays of a locked - immutabilityPolicy. The only action allowed on a Locked policy will be - this action. ETag in If-Match is required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: str - :param immutability_period_since_creation_in_days: The immutability - period for the blobs in the container since the policy creation, in - days. - :type immutability_period_since_creation_in_days: int - :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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = None - if immutability_period_since_creation_in_days is not None: - parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) - - # Construct URL - url = self.extend_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} - - def lease( - self, resource_group_name, account_name, container_name, parameters=None, custom_headers=None, raw=False, **operation_config): - """The Lease Container operation establishes and manages a lock on a - container for delete operations. The lock duration can be 15 to 60 - seconds, or can be infinite. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param parameters: Lease Container request body. - :type parameters: - ~azure.mgmt.storage.v2018_07_01.models.LeaseContainerRequest - :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: LeaseContainerResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.LeaseContainerResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.lease.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'LeaseContainerRequest') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LeaseContainerResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/blob_services_operations.py deleted file mode 100644 index 306a2f399adc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/blob_services_operations.py +++ /dev/null @@ -1,185 +0,0 @@ -# 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 BlobServicesOperations(object): - """BlobServicesOperations 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 API version to use for this operation. Constant value: "2018-07-01". - :ivar blob_services_name: The name of the blob Service within the specified storage account. Blob Service Name must be 'default'. Constant value: "default". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-07-01" - self.blob_services_name = "default" - - self.config = config - - def set_service_properties( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """Sets the properties of a storage account’s Blob service, including - properties for Storage Analytics and CORS (Cross-Origin Resource - Sharing) rules. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The properties of a storage account’s Blob service, - including properties for Storage Analytics and CORS (Cross-Origin - Resource Sharing) rules. - :type parameters: - ~azure.mgmt.storage.v2018_07_01.models.BlobServiceProperties - :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: BlobServiceProperties or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobServiceProperties - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.set_service_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'BlobServiceProperties') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('BlobServiceProperties', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} - - def get_service_properties( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Gets the properties of a storage account’s Blob service, including - properties for Storage Analytics and CORS (Cross-Origin Resource - Sharing) rules. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: BlobServiceProperties or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.BlobServiceProperties - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_service_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('BlobServiceProperties', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/management_policies_operations.py deleted file mode 100644 index d81c7619fee4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/management_policies_operations.py +++ /dev/null @@ -1,246 +0,0 @@ -# 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 ManagementPoliciesOperations(object): - """ManagementPoliciesOperations 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 API version to use for this operation. Constant value: "2018-03-01-preview". - :ivar management_policy_name: The name of the Storage Account Management Policy. It should always be 'default'. Constant value: "default". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-03-01-preview" - self.management_policy_name = "default" - - self.config = config - - def get( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Gets the data policy rules associated with the specified storage - account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccountManagementPolicies or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.storage.v2018_07_01.models.StorageAccountManagementPolicies - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccountManagementPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} - - def create_or_update( - self, resource_group_name, account_name, policy=None, custom_headers=None, raw=False, **operation_config): - """Sets the data policy rules associated with the specified storage - account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param policy: The Storage Account ManagementPolicies Rules, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: object - :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: StorageAccountManagementPolicies or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.storage.v2018_07_01.models.StorageAccountManagementPolicies - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - properties = models.ManagementPoliciesRulesSetParameter(policy=policy) - - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(properties, 'ManagementPoliciesRulesSetParameter') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccountManagementPolicies', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes the data policy rules associated with the specified storage - account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/operations.py deleted file mode 100644 index e10e2242f7fc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/operations.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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 API version to use for this operation. Constant value: "2018-07-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-07-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available Storage 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 Operation - :rtype: - ~azure.mgmt.storage.v2018_07_01.models.OperationPaged[~azure.mgmt.storage.v2018_07_01.models.Operation] - :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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.OperationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/skus_operations.py deleted file mode 100644 index 248eaa0bdeca..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/skus_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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 SkusOperations(object): - """SkusOperations 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 API version to use for this operation. Constant value: "2018-07-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-07-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists the available SKUs supported by Microsoft.Storage for given - 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 Sku - :rtype: - ~azure.mgmt.storage.v2018_07_01.models.SkuPaged[~azure.mgmt.storage.v2018_07_01.models.Sku] - :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', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.SkuPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/storage_accounts_operations.py deleted file mode 100644 index 3b12cc79e359..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/storage_accounts_operations.py +++ /dev/null @@ -1,935 +0,0 @@ -# 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 StorageAccountsOperations(object): - """StorageAccountsOperations 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 API version to use for this operation. Constant value: "2018-07-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-07-01" - - self.config = config - - def check_name_availability( - self, name, custom_headers=None, raw=False, **operation_config): - """Checks that the storage account name is valid and is not already in - use. - - :param name: The storage account name. - :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_07_01.models.CheckNameAvailabilityResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) - - # 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', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('CheckNameAvailabilityResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} - - - def _create_initial( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountCreateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Asynchronously creates a new storage account with the specified - parameters. If an account is already created and a subsequent create - request is issued with different properties, the account properties - will be updated. If an account is already created and a subsequent - create or update request is issued with the exact same set of - properties, the request will succeed. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the created account. - :type parameters: - ~azure.mgmt.storage.v2018_07_01.models.StorageAccountCreateParameters - :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 StorageAccount or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2018_07_01.models.StorageAccount] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2018_07_01.models.StorageAccount]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes a storage account in Microsoft Azure. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def get_properties( - self, resource_group_name, account_name, expand=None, custom_headers=None, raw=False, **operation_config): - """Returns the properties for the specified storage account including but - not limited to name, SKU name, location, and account status. The - ListKeys operation should be used to retrieve storage keys. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param expand: May be used to expand the properties within account's - properties. By default, data is not included when fetching properties. - Currently we only support geoReplicationStats. Possible values - include: 'geoReplicationStats' - :type expand: str or - ~azure.mgmt.storage.v2018_07_01.models.StorageAccountExpand - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'StorageAccountExpand') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def update( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """The update operation can be used to update the SKU, encryption, access - tier, or tags for a storage account. It can also be used to map the - account to a custom domain. Only one custom domain is supported per - storage account; the replacement/change of custom domain is not - supported. In order to replace an old custom domain, the old value must - be cleared/unregistered before a new value can be set. The update of - multiple properties is supported. This call does not change the storage - keys for the account. If you want to change the storage account keys, - use the regenerate keys operation. The location and name of the storage - account cannot be changed after creation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the updated account. - :type parameters: - ~azure.mgmt.storage.v2018_07_01.models.StorageAccountUpdateParameters - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the subscription. Note - that storage keys are not returned; use the ListKeys operation for - this. - - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2018_07_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_07_01.models.StorageAccount] - :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', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the given resource - group. Note that storage keys are not returned; use the ListKeys - operation for this. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2018_07_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_07_01.models.StorageAccount] - :raises: :class:`CloudError` - """ - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(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.Storage/storageAccounts'} - - def list_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_07_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} - - def regenerate_key( - self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerates one of the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param key_name: The name of storage keys that want to be regenerated, - possible values are key1, key2. - :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_07_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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_key1, 'StorageAccountRegenerateKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} - - def list_account_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List SAS credentials of a storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list SAS credentials - for the storage account. - :type parameters: - ~azure.mgmt.storage.v2018_07_01.models.AccountSasParameters - :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: ListAccountSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.ListAccountSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_account_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'AccountSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListAccountSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} - - def list_service_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List service SAS credentials of a specific resource. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list service SAS - credentials. - :type parameters: - ~azure.mgmt.storage.v2018_07_01.models.ServiceSasParameters - :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: ListServiceSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_07_01.models.ListServiceSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_service_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'ServiceSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListServiceSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} - - - def _failover_initial( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.failover.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, 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 failover( - self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Failover request can be triggered for a storage account in case of - availability issues. The failover occurs from the storage account's - primary cluster to secondary cluster for RA-GRS accounts. The secondary - cluster will become primary after failover. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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._failover_initial( - resource_group_name=resource_group_name, - account_name=account_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, lro_options={'final-state-via': 'location'}, **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) - failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/usages_operations.py deleted file mode 100644 index 9f16af2fc35d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/usages_operations.py +++ /dev/null @@ -1,106 +0,0 @@ -# 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 UsagesOperations(object): - """UsagesOperations 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 API version to use for this operation. Constant value: "2018-07-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-07-01" - - self.config = config - - def list_by_location( - self, location, custom_headers=None, raw=False, **operation_config): - """Gets the current usage count and the limit for the resources of the - location under the subscription. - - :param location: The location of the Azure Storage resource. - :type location: 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 Usage - :rtype: - ~azure.mgmt.storage.v2018_07_01.models.UsagePaged[~azure.mgmt.storage.v2018_07_01.models.Usage] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_location.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, '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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.UsagePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/storage_management_client.py deleted file mode 100644 index 05ed8b323576..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/storage_management_client.py +++ /dev/null @@ -1,110 +0,0 @@ -# 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.operations import Operations -from .operations.skus_operations import SkusOperations -from .operations.storage_accounts_operations import StorageAccountsOperations -from .operations.usages_operations import UsagesOperations -from .operations.blob_services_operations import BlobServicesOperations -from .operations.blob_containers_operations import BlobContainersOperations -from .operations.management_policies_operations import ManagementPoliciesOperations -from . import models - - -class StorageManagementClientConfiguration(AzureConfiguration): - """Configuration for StorageManagementClient - 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 ID of the target subscription. - :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(StorageManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class StorageManagementClient(SDKClient): - """The Azure Storage Management API. - - :ivar config: Configuration for client. - :vartype config: StorageManagementClientConfiguration - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.storage.v2018_07_01.operations.Operations - :ivar skus: Skus operations - :vartype skus: azure.mgmt.storage.v2018_07_01.operations.SkusOperations - :ivar storage_accounts: StorageAccounts operations - :vartype storage_accounts: azure.mgmt.storage.v2018_07_01.operations.StorageAccountsOperations - :ivar usages: Usages operations - :vartype usages: azure.mgmt.storage.v2018_07_01.operations.UsagesOperations - :ivar blob_services: BlobServices operations - :vartype blob_services: azure.mgmt.storage.v2018_07_01.operations.BlobServicesOperations - :ivar blob_containers: BlobContainers operations - :vartype blob_containers: azure.mgmt.storage.v2018_07_01.operations.BlobContainersOperations - :ivar management_policies: ManagementPolicies operations - :vartype management_policies: azure.mgmt.storage.v2018_07_01.operations.ManagementPoliciesOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - super(StorageManagementClient, 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.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.skus = SkusOperations( - self._client, self.config, self._serialize, self._deserialize) - self.storage_accounts = StorageAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.usages = UsagesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.blob_services = BlobServicesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.blob_containers = BlobContainersOperations( - self._client, self.config, self._serialize, self._deserialize) - self.management_policies = ManagementPoliciesOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/__init__.py index 0854715e0c10..da2c3f969e67 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient -from .version import VERSION +from ._configuration import StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] -__all__ = ['StorageManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_configuration.py new file mode 100644 index 000000000000..57fa5132dc82 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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 ID of the target subscription. + :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(StorageManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_storage_management_client.py new file mode 100644 index 000000000000..c07fc78d5428 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_storage_management_client.py @@ -0,0 +1,79 @@ +# 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 ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import UsagesOperations +from .operations import ManagementPoliciesOperations +from .operations import BlobServicesOperations +from .operations import BlobContainersOperations +from . import models + + +class StorageManagementClient(SDKClient): + """The Azure Storage Management API. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2018_11_01.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2018_11_01.operations.SkusOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2018_11_01.operations.StorageAccountsOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.storage.v2018_11_01.operations.UsagesOperations + :ivar management_policies: ManagementPolicies operations + :vartype management_policies: azure.mgmt.storage.v2018_11_01.operations.ManagementPoliciesOperations + :ivar blob_services: BlobServices operations + :vartype blob_services: azure.mgmt.storage.v2018_11_01.operations.BlobServicesOperations + :ivar blob_containers: BlobContainers operations + :vartype blob_containers: azure.mgmt.storage.v2018_11_01.operations.BlobContainersOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-11-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.management_policies = ManagementPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_services = BlobServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/__init__.py index 1e5d1a426aaf..6201d41b9fad 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/__init__.py @@ -10,136 +10,136 @@ # -------------------------------------------------------------------------- try: - from .operation_display_py3 import OperationDisplay - from .dimension_py3 import Dimension - from .metric_specification_py3 import MetricSpecification - from .service_specification_py3 import ServiceSpecification - from .operation_py3 import Operation - from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters - from .sku_capability_py3 import SKUCapability - from .restriction_py3 import Restriction - from .sku_py3 import Sku - from .check_name_availability_result_py3 import CheckNameAvailabilityResult - from .custom_domain_py3 import CustomDomain - from .encryption_service_py3 import EncryptionService - from .encryption_services_py3 import EncryptionServices - from .key_vault_properties_py3 import KeyVaultProperties - from .encryption_py3 import Encryption - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - from .identity_py3 import Identity - from .storage_account_create_parameters_py3 import StorageAccountCreateParameters - from .endpoints_py3 import Endpoints - from .geo_replication_stats_py3 import GeoReplicationStats - from .storage_account_py3 import StorageAccount - from .storage_account_key_py3 import StorageAccountKey - from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters - from .usage_name_py3 import UsageName - from .usage_py3 import Usage - from .account_sas_parameters_py3 import AccountSasParameters - from .list_account_sas_response_py3 import ListAccountSasResponse - from .service_sas_parameters_py3 import ServiceSasParameters - from .list_service_sas_response_py3 import ListServiceSasResponse - from .date_after_modification_py3 import DateAfterModification - from .management_policy_base_blob_py3 import ManagementPolicyBaseBlob - from .date_after_creation_py3 import DateAfterCreation - from .management_policy_snap_shot_py3 import ManagementPolicySnapShot - from .management_policy_action_py3 import ManagementPolicyAction - from .management_policy_filter_py3 import ManagementPolicyFilter - from .management_policy_definition_py3 import ManagementPolicyDefinition - from .management_policy_rule_py3 import ManagementPolicyRule - from .management_policy_schema_py3 import ManagementPolicySchema - from .management_policy_py3 import ManagementPolicy - from .proxy_resource_py3 import ProxyResource - from .tracked_resource_py3 import TrackedResource - from .azure_entity_resource_py3 import AzureEntityResource - from .resource_py3 import Resource - from .update_history_property_py3 import UpdateHistoryProperty - from .immutability_policy_properties_py3 import ImmutabilityPolicyProperties - from .tag_property_py3 import TagProperty - from .legal_hold_properties_py3 import LegalHoldProperties - from .blob_container_py3 import BlobContainer - from .immutability_policy_py3 import ImmutabilityPolicy - from .legal_hold_py3 import LegalHold - from .list_container_item_py3 import ListContainerItem - from .list_container_items_py3 import ListContainerItems - from .cors_rule_py3 import CorsRule - from .cors_rules_py3 import CorsRules - from .delete_retention_policy_py3 import DeleteRetentionPolicy - from .blob_service_properties_py3 import BlobServiceProperties - from .lease_container_request_py3 import LeaseContainerRequest - from .lease_container_response_py3 import LeaseContainerResponse + from ._models_py3 import AccountSasParameters + from ._models_py3 import AzureEntityResource + from ._models_py3 import BlobContainer + from ._models_py3 import BlobServiceProperties + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CorsRule + from ._models_py3 import CorsRules + from ._models_py3 import CustomDomain + from ._models_py3 import DateAfterCreation + from ._models_py3 import DateAfterModification + from ._models_py3 import DeleteRetentionPolicy + from ._models_py3 import Dimension + from ._models_py3 import Encryption + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import GeoReplicationStats + from ._models_py3 import Identity + from ._models_py3 import ImmutabilityPolicy + from ._models_py3 import ImmutabilityPolicyProperties + from ._models_py3 import IPRule + from ._models_py3 import KeyVaultProperties + from ._models_py3 import LeaseContainerRequest + from ._models_py3 import LeaseContainerResponse + from ._models_py3 import LegalHold + from ._models_py3 import LegalHoldProperties + from ._models_py3 import ListAccountSasResponse + from ._models_py3 import ListContainerItem + from ._models_py3 import ListContainerItems + from ._models_py3 import ListServiceSasResponse + from ._models_py3 import ManagementPolicy + from ._models_py3 import ManagementPolicyAction + from ._models_py3 import ManagementPolicyBaseBlob + from ._models_py3 import ManagementPolicyDefinition + from ._models_py3 import ManagementPolicyFilter + from ._models_py3 import ManagementPolicyRule + from ._models_py3 import ManagementPolicySchema + from ._models_py3 import ManagementPolicySnapShot + from ._models_py3 import MetricSpecification + from ._models_py3 import NetworkRuleSet + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import Restriction + from ._models_py3 import ServiceSasParameters + from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SKUCapability + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import TagProperty + from ._models_py3 import TrackedResource + from ._models_py3 import UpdateHistoryProperty + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import VirtualNetworkRule except (SyntaxError, ImportError): - from .operation_display import OperationDisplay - from .dimension import Dimension - from .metric_specification import MetricSpecification - from .service_specification import ServiceSpecification - from .operation import Operation - from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters - from .sku_capability import SKUCapability - from .restriction import Restriction - from .sku import Sku - from .check_name_availability_result import CheckNameAvailabilityResult - from .custom_domain import CustomDomain - from .encryption_service import EncryptionService - from .encryption_services import EncryptionServices - from .key_vault_properties import KeyVaultProperties - from .encryption import Encryption - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - from .identity import Identity - from .storage_account_create_parameters import StorageAccountCreateParameters - from .endpoints import Endpoints - from .geo_replication_stats import GeoReplicationStats - from .storage_account import StorageAccount - from .storage_account_key import StorageAccountKey - from .storage_account_list_keys_result import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters import StorageAccountUpdateParameters - from .usage_name import UsageName - from .usage import Usage - from .account_sas_parameters import AccountSasParameters - from .list_account_sas_response import ListAccountSasResponse - from .service_sas_parameters import ServiceSasParameters - from .list_service_sas_response import ListServiceSasResponse - from .date_after_modification import DateAfterModification - from .management_policy_base_blob import ManagementPolicyBaseBlob - from .date_after_creation import DateAfterCreation - from .management_policy_snap_shot import ManagementPolicySnapShot - from .management_policy_action import ManagementPolicyAction - from .management_policy_filter import ManagementPolicyFilter - from .management_policy_definition import ManagementPolicyDefinition - from .management_policy_rule import ManagementPolicyRule - from .management_policy_schema import ManagementPolicySchema - from .management_policy import ManagementPolicy - from .proxy_resource import ProxyResource - from .tracked_resource import TrackedResource - from .azure_entity_resource import AzureEntityResource - from .resource import Resource - from .update_history_property import UpdateHistoryProperty - from .immutability_policy_properties import ImmutabilityPolicyProperties - from .tag_property import TagProperty - from .legal_hold_properties import LegalHoldProperties - from .blob_container import BlobContainer - from .immutability_policy import ImmutabilityPolicy - from .legal_hold import LegalHold - from .list_container_item import ListContainerItem - from .list_container_items import ListContainerItems - from .cors_rule import CorsRule - from .cors_rules import CorsRules - from .delete_retention_policy import DeleteRetentionPolicy - from .blob_service_properties import BlobServiceProperties - from .lease_container_request import LeaseContainerRequest - from .lease_container_response import LeaseContainerResponse -from .operation_paged import OperationPaged -from .sku_paged import SkuPaged -from .storage_account_paged import StorageAccountPaged -from .usage_paged import UsagePaged -from .storage_management_client_enums import ( + from ._models import AccountSasParameters + from ._models import AzureEntityResource + from ._models import BlobContainer + from ._models import BlobServiceProperties + from ._models import CheckNameAvailabilityResult + from ._models import CorsRule + from ._models import CorsRules + from ._models import CustomDomain + from ._models import DateAfterCreation + from ._models import DateAfterModification + from ._models import DeleteRetentionPolicy + from ._models import Dimension + from ._models import Encryption + from ._models import EncryptionService + from ._models import EncryptionServices + from ._models import Endpoints + from ._models import GeoReplicationStats + from ._models import Identity + from ._models import ImmutabilityPolicy + from ._models import ImmutabilityPolicyProperties + from ._models import IPRule + from ._models import KeyVaultProperties + from ._models import LeaseContainerRequest + from ._models import LeaseContainerResponse + from ._models import LegalHold + from ._models import LegalHoldProperties + from ._models import ListAccountSasResponse + from ._models import ListContainerItem + from ._models import ListContainerItems + from ._models import ListServiceSasResponse + from ._models import ManagementPolicy + from ._models import ManagementPolicyAction + from ._models import ManagementPolicyBaseBlob + from ._models import ManagementPolicyDefinition + from ._models import ManagementPolicyFilter + from ._models import ManagementPolicyRule + from ._models import ManagementPolicySchema + from ._models import ManagementPolicySnapShot + from ._models import MetricSpecification + from ._models import NetworkRuleSet + from ._models import Operation + from ._models import OperationDisplay + from ._models import ProxyResource + from ._models import Resource + from ._models import Restriction + from ._models import ServiceSasParameters + from ._models import ServiceSpecification + from ._models import Sku + from ._models import SKUCapability + from ._models import StorageAccount + from ._models import StorageAccountCheckNameAvailabilityParameters + from ._models import StorageAccountCreateParameters + from ._models import StorageAccountKey + from ._models import StorageAccountListKeysResult + from ._models import StorageAccountRegenerateKeyParameters + from ._models import StorageAccountUpdateParameters + from ._models import TagProperty + from ._models import TrackedResource + from ._models import UpdateHistoryProperty + from ._models import Usage + from ._models import UsageName + from ._models import VirtualNetworkRule +from ._paged_models import OperationPaged +from ._paged_models import SkuPaged +from ._paged_models import StorageAccountPaged +from ._paged_models import UsagePaged +from ._storage_management_client_enums import ( ReasonCode, SkuName, SkuTier, @@ -171,68 +171,68 @@ ) __all__ = [ - 'OperationDisplay', - 'Dimension', - 'MetricSpecification', - 'ServiceSpecification', - 'Operation', - 'StorageAccountCheckNameAvailabilityParameters', - 'SKUCapability', - 'Restriction', - 'Sku', + 'AccountSasParameters', + 'AzureEntityResource', + 'BlobContainer', + 'BlobServiceProperties', 'CheckNameAvailabilityResult', + 'CorsRule', + 'CorsRules', 'CustomDomain', + 'DateAfterCreation', + 'DateAfterModification', + 'DeleteRetentionPolicy', + 'Dimension', + 'Encryption', 'EncryptionService', 'EncryptionServices', - 'KeyVaultProperties', - 'Encryption', - 'VirtualNetworkRule', - 'IPRule', - 'NetworkRuleSet', - 'Identity', - 'StorageAccountCreateParameters', 'Endpoints', 'GeoReplicationStats', - 'StorageAccount', - 'StorageAccountKey', - 'StorageAccountListKeysResult', - 'StorageAccountRegenerateKeyParameters', - 'StorageAccountUpdateParameters', - 'UsageName', - 'Usage', - 'AccountSasParameters', + 'Identity', + 'ImmutabilityPolicy', + 'ImmutabilityPolicyProperties', + 'IPRule', + 'KeyVaultProperties', + 'LeaseContainerRequest', + 'LeaseContainerResponse', + 'LegalHold', + 'LegalHoldProperties', 'ListAccountSasResponse', - 'ServiceSasParameters', + 'ListContainerItem', + 'ListContainerItems', 'ListServiceSasResponse', - 'DateAfterModification', - 'ManagementPolicyBaseBlob', - 'DateAfterCreation', - 'ManagementPolicySnapShot', + 'ManagementPolicy', 'ManagementPolicyAction', - 'ManagementPolicyFilter', + 'ManagementPolicyBaseBlob', 'ManagementPolicyDefinition', + 'ManagementPolicyFilter', 'ManagementPolicyRule', 'ManagementPolicySchema', - 'ManagementPolicy', + 'ManagementPolicySnapShot', + 'MetricSpecification', + 'NetworkRuleSet', + 'Operation', + 'OperationDisplay', 'ProxyResource', - 'TrackedResource', - 'AzureEntityResource', 'Resource', - 'UpdateHistoryProperty', - 'ImmutabilityPolicyProperties', + 'Restriction', + 'ServiceSasParameters', + 'ServiceSpecification', + 'Sku', + 'SKUCapability', + 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', + 'StorageAccountKey', + 'StorageAccountListKeysResult', + 'StorageAccountRegenerateKeyParameters', + 'StorageAccountUpdateParameters', 'TagProperty', - 'LegalHoldProperties', - 'BlobContainer', - 'ImmutabilityPolicy', - 'LegalHold', - 'ListContainerItem', - 'ListContainerItems', - 'CorsRule', - 'CorsRules', - 'DeleteRetentionPolicy', - 'BlobServiceProperties', - 'LeaseContainerRequest', - 'LeaseContainerResponse', + 'TrackedResource', + 'UpdateHistoryProperty', + 'Usage', + 'UsageName', + 'VirtualNetworkRule', 'OperationPaged', 'SkuPaged', 'StorageAccountPaged', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models.py new file mode 100644 index 000000000000..882a3c56956e --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models.py @@ -0,0 +1,2634 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2018_11_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2018_11_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_11_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_11_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_11_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_11_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_11_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_11_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_11_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BlobContainer, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param cors: Specifies CORS rules for the Blob service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2018_11_01.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the + default version to use for requests to the Blob service if an incoming + request’s version is not specified. Possible values include version + 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for soft + delete. + :type delete_retention_policy: + ~azure.mgmt.storage.v2018_11_01.models.DeleteRetentionPolicy + """ + + _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'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + } + + def __init__(self, **kwargs): + super(BlobServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + self.default_service_version = kwargs.get('default_service_version', None) + self.delete_retention_policy = kwargs.get('delete_retention_policy', None) + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2018_11_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CorsRule(Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. + A list of origin domains that will be allowed via CORS, or "*" to allow + all domains + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. + A list of HTTP methods that are allowed to be executed by the origin. + :type allowed_methods: list[str] + :param max_age_in_seconds: Required. Required if CorsRule element is + present. The number of seconds that the client/browser should cache a + preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. + A list of response headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. + A list of headers allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = kwargs.get('allowed_origins', None) + self.allowed_methods = kwargs.get('allowed_methods', None) + self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None) + self.exposed_headers = kwargs.get('exposed_headers', None) + self.allowed_headers = kwargs.get('allowed_headers', None) + + +class CorsRules(Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the + request. . + + :param cors_rules: The List of CORS rules. You can include up to five + CorsRule elements in the request. + :type cors_rules: list[~azure.mgmt.storage.v2018_11_01.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__(self, **kwargs): + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = kwargs.get('cors_rules', None) + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class DateAfterCreation(Model): + """Object to define the number of days after creation. + + All required parameters must be populated in order to send to Azure. + + :param days_after_creation_greater_than: Required. Integer value + indicating the age in days after creation + :type days_after_creation_greater_than: int + """ + + _validation = { + 'days_after_creation_greater_than': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(DateAfterCreation, self).__init__(**kwargs) + self.days_after_creation_greater_than = kwargs.get('days_after_creation_greater_than', None) + + +class DateAfterModification(Model): + """Object to define the number of days after last modification. + + All required parameters must be populated in order to send to Azure. + + :param days_after_modification_greater_than: Required. Integer value + indicating the age in days after last modification + :type days_after_modification_greater_than: int + """ + + _validation = { + 'days_after_modification_greater_than': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(DateAfterModification, self).__init__(**kwargs) + self.days_after_modification_greater_than = kwargs.get('days_after_modification_greater_than', None) + + +class DeleteRetentionPolicy(Model): + """The blob service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled for the + Blob service. + :type enabled: bool + :param days: Indicates the number of days that the deleted blob should be + retained. The minimum specified value can be 1 and the maximum value can + be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.days = kwargs.get('days', None) + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2018_11_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2018_11_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_11_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class GeoReplicationStats(Model): + """Statistics related to replication for storage account's Blob, Table, Queue + and File services. It is only available when geo-redundant replication is + enabled for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of the secondary location. Possible values are: - + Live: Indicates that the secondary location is active and operational. - + Bootstrap: Indicates initial synchronization from the primary location to + the secondary location is in progress.This typically occurs when + replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: 'Live', + 'Bootstrap', 'Unavailable' + :vartype status: str or + ~azure.mgmt.storage.v2018_11_01.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time + value are guaranteed to be available for read operations. Primary writes + following this point in time may or may not be available for reads. + Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: datetime + :ivar can_failover: A boolean flag which indicates whether or not account + failover is supported for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + 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 immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2018_11_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.etag = None + self.update_history = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_11_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2018_11_01.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = kwargs.get('action', None) + self.lease_id = kwargs.get('lease_id', None) + self.break_period = kwargs.get('break_period', None) + self.lease_duration = kwargs.get('lease_duration', None) + self.proposed_lease_id = kwargs.get('proposed_lease_id', None) + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = kwargs.get('lease_id', None) + self.lease_time_seconds = kwargs.get('lease_time_seconds', None) + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + 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 has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2018_11_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, **kwargs): + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_11_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_11_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_11_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_11_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_11_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListContainerItems(Model): + """The list of blob containers. + + :param value: The list of blob containers. + :type value: + list[~azure.mgmt.storage.v2018_11_01.models.ListContainerItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + } + + def __init__(self, **kwargs): + super(ListContainerItems, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ManagementPolicy(Resource): + """The Get Storage Account ManagementPolicies operation response. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + :param policy: Required. The Storage Account ManagementPolicy, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'policy': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicy, self).__init__(**kwargs) + self.last_modified_time = None + self.policy = kwargs.get('policy', None) + + +class ManagementPolicyAction(Model): + """Actions are applied to the filtered blobs when the execution condition is + met. + + :param base_blob: The management policy action for base blob + :type base_blob: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyBaseBlob + :param snapshot: The management policy action for snapshot + :type snapshot: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicySnapShot + """ + + _attribute_map = { + 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, + 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyAction, self).__init__(**kwargs) + self.base_blob = kwargs.get('base_blob', None) + self.snapshot = kwargs.get('snapshot', None) + + +class ManagementPolicyBaseBlob(Model): + """Management policy action for base blob. + + :param tier_to_cool: The function to tier blobs to cool storage. Support + blobs currently at Hot tier + :type tier_to_cool: + ~azure.mgmt.storage.v2018_11_01.models.DateAfterModification + :param tier_to_archive: The function to tier blobs to archive storage. + Support blobs currently at Hot or Cool tier + :type tier_to_archive: + ~azure.mgmt.storage.v2018_11_01.models.DateAfterModification + :param delete: The function to delete the blob + :type delete: ~azure.mgmt.storage.v2018_11_01.models.DateAfterModification + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, + 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyBaseBlob, self).__init__(**kwargs) + self.tier_to_cool = kwargs.get('tier_to_cool', None) + self.tier_to_archive = kwargs.get('tier_to_archive', None) + self.delete = kwargs.get('delete', None) + + +class ManagementPolicyDefinition(Model): + """An object that defines the Lifecycle rule. Each definition is made up with + a filters set and an actions set. + + All required parameters must be populated in order to send to Azure. + + :param actions: Required. An object that defines the action set. + :type actions: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyAction + :param filters: An object that defines the filter set. + :type filters: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyFilter + """ + + _validation = { + 'actions': {'required': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, + 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyDefinition, self).__init__(**kwargs) + self.actions = kwargs.get('actions', None) + self.filters = kwargs.get('filters', None) + + +class ManagementPolicyFilter(Model): + """Filters limit rule actions to a subset of blobs within the storage account. + If multiple filters are defined, a logical AND is performed on all filters. + . + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for prefixes to be match. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Only + blockBlob is supported. + :type blob_types: list[str] + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyFilter, self).__init__(**kwargs) + self.prefix_match = kwargs.get('prefix_match', None) + self.blob_types = kwargs.get('blob_types', None) + + +class ManagementPolicyRule(Model): + """An object that wraps the Lifecycle rule. Each rule is uniquely defined by + name. + + 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 enabled: Rule is enabled if set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha + numeric characters. Rule name is case-sensitive. It must be unique within + a policy. + :type name: str + :ivar type: Required. The valid value is Lifecycle. Default value: + "Lifecycle" . + :vartype type: str + :param definition: Required. An object that defines the Lifecycle rule. + :type definition: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyDefinition + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, + } + + type = "Lifecycle" + + def __init__(self, **kwargs): + super(ManagementPolicyRule, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.name = kwargs.get('name', None) + self.definition = kwargs.get('definition', None) + + +class ManagementPolicySchema(Model): + """The Storage Account ManagementPolicies Rules. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + All required parameters must be populated in order to send to Azure. + + :param rules: Required. The Storage Account ManagementPolicies Rules. See + more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type rules: + list[~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicySchema, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + + +class ManagementPolicySnapShot(Model): + """Management policy action for snapshot. + + :param delete: The function to delete the blob snapshot + :type delete: ~azure.mgmt.storage.v2018_11_01.models.DateAfterCreation + """ + + _attribute_map = { + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicySnapShot, self).__init__(**kwargs) + self.delete = kwargs.get('delete', None) + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2018_11_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2018_11_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_11_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2018_11_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2018_11_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2018_11_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2018_11_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of 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(OperationDisplay, 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) + + +class ProxyResource(Resource): + """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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2018_11_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. + Possible values include: Blob (b), Container (c), File (f), Share (s). + Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2018_11_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_11_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_11_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2018_11_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the SKU name. Required for account + creation; optional for update. Note that in older versions, SKU name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS' + :type name: str or ~azure.mgmt.storage.v2018_11_01.models.SkuName + :ivar tier: Gets the SKU tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2018_11_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified SKU, + including file encryption, network ACLs, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2018_11_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2018_11_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +class SKUCapability(Model): + """The capability information in the specified SKU, including file encryption, + network ACLs, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified SKU, including file encryption, network ACLs, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class StorageAccount(TrackedResource): + """The storage account. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2018_11_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_11_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2018_11_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2018_11_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2018_11_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2018_11_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2018_11_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2018_11_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2018_11_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2018_11_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_11_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats + :vartype geo_replication_stats: + ~azure.mgmt.storage.v2018_11_01.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will + be true, otherwise, it will be null. + :vartype failover_in_progress: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = None + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + self.geo_replication_stats = None + self.failover_in_progress = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU name. + :type sku: ~azure.mgmt.storage.v2018_11_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_11_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_11_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_11_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_11_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_11_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2018_11_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2018_11_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of + those SKU names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_11_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_11_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_11_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_11_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_11_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_11_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.kind = kwargs.get('kind', None) + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2018_11_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2018_11_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_11_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2018_11_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models_py3.py new file mode 100644 index 000000000000..45e1b020f2a8 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models_py3.py @@ -0,0 +1,2634 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2018_11_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2018_11_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_11_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_11_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_11_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_11_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_11_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_11_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_11_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(BlobContainer, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param cors: Specifies CORS rules for the Blob service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2018_11_01.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the + default version to use for requests to the Blob service if an incoming + request’s version is not specified. Possible values include version + 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for soft + delete. + :type delete_retention_policy: + ~azure.mgmt.storage.v2018_11_01.models.DeleteRetentionPolicy + """ + + _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'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + } + + def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, **kwargs) -> None: + super(BlobServiceProperties, self).__init__(**kwargs) + self.cors = cors + self.default_service_version = default_service_version + self.delete_retention_policy = delete_retention_policy + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2018_11_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CorsRule(Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. + A list of origin domains that will be allowed via CORS, or "*" to allow + all domains + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. + A list of HTTP methods that are allowed to be executed by the origin. + :type allowed_methods: list[str] + :param max_age_in_seconds: Required. Required if CorsRule element is + present. The number of seconds that the client/browser should cache a + preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. + A list of response headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. + A list of headers allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__(self, *, allowed_origins, allowed_methods, max_age_in_seconds: int, exposed_headers, allowed_headers, **kwargs) -> None: + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = allowed_origins + self.allowed_methods = allowed_methods + self.max_age_in_seconds = max_age_in_seconds + self.exposed_headers = exposed_headers + self.allowed_headers = allowed_headers + + +class CorsRules(Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the + request. . + + :param cors_rules: The List of CORS rules. You can include up to five + CorsRule elements in the request. + :type cors_rules: list[~azure.mgmt.storage.v2018_11_01.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__(self, *, cors_rules=None, **kwargs) -> None: + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = cors_rules + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class DateAfterCreation(Model): + """Object to define the number of days after creation. + + All required parameters must be populated in order to send to Azure. + + :param days_after_creation_greater_than: Required. Integer value + indicating the age in days after creation + :type days_after_creation_greater_than: int + """ + + _validation = { + 'days_after_creation_greater_than': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'int'}, + } + + def __init__(self, *, days_after_creation_greater_than: int, **kwargs) -> None: + super(DateAfterCreation, self).__init__(**kwargs) + self.days_after_creation_greater_than = days_after_creation_greater_than + + +class DateAfterModification(Model): + """Object to define the number of days after last modification. + + All required parameters must be populated in order to send to Azure. + + :param days_after_modification_greater_than: Required. Integer value + indicating the age in days after last modification + :type days_after_modification_greater_than: int + """ + + _validation = { + 'days_after_modification_greater_than': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'int'}, + } + + def __init__(self, *, days_after_modification_greater_than: int, **kwargs) -> None: + super(DateAfterModification, self).__init__(**kwargs) + self.days_after_modification_greater_than = days_after_modification_greater_than + + +class DeleteRetentionPolicy(Model): + """The blob service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled for the + Blob service. + :type enabled: bool + :param days: Indicates the number of days that the deleted blob should be + retained. The minimum specified value can be 1 and the maximum value can + be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool=None, days: int=None, **kwargs) -> None: + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = enabled + self.days = days + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2018_11_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2018_11_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2018_11_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class GeoReplicationStats(Model): + """Statistics related to replication for storage account's Blob, Table, Queue + and File services. It is only available when geo-redundant replication is + enabled for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of the secondary location. Possible values are: - + Live: Indicates that the secondary location is active and operational. - + Bootstrap: Indicates initial synchronization from the primary location to + the secondary location is in progress.This typically occurs when + replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: 'Live', + 'Bootstrap', 'Unavailable' + :vartype status: str or + ~azure.mgmt.storage.v2018_11_01.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time + value are guaranteed to be available for read operations. Primary writes + following this point in time may or may not be available for reads. + Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: datetime + :ivar can_failover: A boolean flag which indicates whether or not account + failover is supported for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + 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 immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2018_11_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.etag = None + self.update_history = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_11_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2018_11_01.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, *, action, lease_id: str=None, break_period: int=None, lease_duration: int=None, proposed_lease_id: str=None, **kwargs) -> None: + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = action + self.lease_id = lease_id + self.break_period = break_period + self.lease_duration = lease_duration + self.proposed_lease_id = proposed_lease_id + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, *, lease_id: str=None, lease_time_seconds: str=None, **kwargs) -> None: + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = lease_id + self.lease_time_seconds = lease_time_seconds + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + 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 has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, *, tags, **kwargs) -> None: + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2018_11_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_11_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2018_11_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2018_11_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2018_11_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2018_11_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListContainerItems(Model): + """The list of blob containers. + + :param value: The list of blob containers. + :type value: + list[~azure.mgmt.storage.v2018_11_01.models.ListContainerItem] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ListContainerItems, self).__init__(**kwargs) + self.value = value + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ManagementPolicy(Resource): + """The Get Storage Account ManagementPolicies operation response. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + :param policy: Required. The Storage Account ManagementPolicy, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'policy': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, + } + + def __init__(self, *, policy, **kwargs) -> None: + super(ManagementPolicy, self).__init__(**kwargs) + self.last_modified_time = None + self.policy = policy + + +class ManagementPolicyAction(Model): + """Actions are applied to the filtered blobs when the execution condition is + met. + + :param base_blob: The management policy action for base blob + :type base_blob: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyBaseBlob + :param snapshot: The management policy action for snapshot + :type snapshot: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicySnapShot + """ + + _attribute_map = { + 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, + 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, + } + + def __init__(self, *, base_blob=None, snapshot=None, **kwargs) -> None: + super(ManagementPolicyAction, self).__init__(**kwargs) + self.base_blob = base_blob + self.snapshot = snapshot + + +class ManagementPolicyBaseBlob(Model): + """Management policy action for base blob. + + :param tier_to_cool: The function to tier blobs to cool storage. Support + blobs currently at Hot tier + :type tier_to_cool: + ~azure.mgmt.storage.v2018_11_01.models.DateAfterModification + :param tier_to_archive: The function to tier blobs to archive storage. + Support blobs currently at Hot or Cool tier + :type tier_to_archive: + ~azure.mgmt.storage.v2018_11_01.models.DateAfterModification + :param delete: The function to delete the blob + :type delete: ~azure.mgmt.storage.v2018_11_01.models.DateAfterModification + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, + 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, + } + + def __init__(self, *, tier_to_cool=None, tier_to_archive=None, delete=None, **kwargs) -> None: + super(ManagementPolicyBaseBlob, self).__init__(**kwargs) + self.tier_to_cool = tier_to_cool + self.tier_to_archive = tier_to_archive + self.delete = delete + + +class ManagementPolicyDefinition(Model): + """An object that defines the Lifecycle rule. Each definition is made up with + a filters set and an actions set. + + All required parameters must be populated in order to send to Azure. + + :param actions: Required. An object that defines the action set. + :type actions: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyAction + :param filters: An object that defines the filter set. + :type filters: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyFilter + """ + + _validation = { + 'actions': {'required': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, + 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, + } + + def __init__(self, *, actions, filters=None, **kwargs) -> None: + super(ManagementPolicyDefinition, self).__init__(**kwargs) + self.actions = actions + self.filters = filters + + +class ManagementPolicyFilter(Model): + """Filters limit rule actions to a subset of blobs within the storage account. + If multiple filters are defined, a logical AND is performed on all filters. + . + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for prefixes to be match. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Only + blockBlob is supported. + :type blob_types: list[str] + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + } + + def __init__(self, *, blob_types, prefix_match=None, **kwargs) -> None: + super(ManagementPolicyFilter, self).__init__(**kwargs) + self.prefix_match = prefix_match + self.blob_types = blob_types + + +class ManagementPolicyRule(Model): + """An object that wraps the Lifecycle rule. Each rule is uniquely defined by + name. + + 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 enabled: Rule is enabled if set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha + numeric characters. Rule name is case-sensitive. It must be unique within + a policy. + :type name: str + :ivar type: Required. The valid value is Lifecycle. Default value: + "Lifecycle" . + :vartype type: str + :param definition: Required. An object that defines the Lifecycle rule. + :type definition: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyDefinition + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, + } + + type = "Lifecycle" + + def __init__(self, *, name: str, definition, enabled: bool=None, **kwargs) -> None: + super(ManagementPolicyRule, self).__init__(**kwargs) + self.enabled = enabled + self.name = name + self.definition = definition + + +class ManagementPolicySchema(Model): + """The Storage Account ManagementPolicies Rules. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + All required parameters must be populated in order to send to Azure. + + :param rules: Required. The Storage Account ManagementPolicies Rules. See + more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type rules: + list[~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, + } + + def __init__(self, *, rules, **kwargs) -> None: + super(ManagementPolicySchema, self).__init__(**kwargs) + self.rules = rules + + +class ManagementPolicySnapShot(Model): + """Management policy action for snapshot. + + :param delete: The function to delete the blob snapshot + :type delete: ~azure.mgmt.storage.v2018_11_01.models.DateAfterCreation + """ + + _attribute_map = { + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__(self, *, delete=None, **kwargs) -> None: + super(ManagementPolicySnapShot, self).__init__(**kwargs) + self.delete = delete + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2018_11_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2018_11_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2018_11_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2018_11_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2018_11_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2018_11_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2018_11_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of 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(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ProxyResource(Resource): + """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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2018_11_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. + Possible values include: Blob (b), Container (c), File (f), Share (s). + Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2018_11_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2018_11_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2018_11_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource=None, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2018_11_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the SKU name. Required for account + creation; optional for update. Note that in older versions, SKU name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS' + :type name: str or ~azure.mgmt.storage.v2018_11_01.models.SkuName + :ivar tier: Gets the SKU tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2018_11_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified SKU, + including file encryption, network ACLs, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2018_11_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2018_11_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'SkuName'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions + + +class SKUCapability(Model): + """The capability information in the specified SKU, including file encryption, + network ACLs, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified SKU, including file encryption, network ACLs, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class StorageAccount(TrackedResource): + """The storage account. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2018_11_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_11_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2018_11_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2018_11_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2018_11_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2018_11_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2018_11_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2018_11_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2018_11_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2018_11_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2018_11_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats + :vartype geo_replication_stats: + ~azure.mgmt.storage.v2018_11_01.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will + be true, otherwise, it will be null. + :vartype failover_in_progress: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None: + super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.enable_azure_files_aad_integration = enable_azure_files_aad_integration + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None + self.is_hns_enabled = is_hns_enabled + self.geo_replication_stats = None + self.failover_in_progress = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU name. + :type sku: ~azure.mgmt.storage.v2018_11_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_11_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_11_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_11_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_11_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_11_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.enable_azure_files_aad_integration = enable_azure_files_aad_integration + self.enable_https_traffic_only = enable_https_traffic_only + self.is_hns_enabled = is_hns_enabled + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2018_11_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2018_11_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of + those SKU names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2018_11_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2018_11_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2018_11_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2018_11_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2018_11_01.models.AccessTier + :param enable_azure_files_aad_integration: Enables Azure Files AAD + Integration for SMB if sets to true. + :type enable_azure_files_aad_integration: bool + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2018_11_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'Kind'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, network_rule_set=None, kind=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.enable_azure_files_aad_integration = enable_azure_files_aad_integration + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.kind = kind + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2018_11_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2018_11_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2018_11_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2018_11_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_paged_models.py new file mode 100644 index 000000000000..27e28cdc293f --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_paged_models.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 msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class SkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`Sku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Sku]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuPaged, self).__init__(*args, **kwargs) +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_storage_management_client_enums.py similarity index 100% rename from sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_management_client_enums.py rename to sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_storage_management_client_enums.py diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/account_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/account_sas_parameters.py deleted file mode 100644 index e7c045bfb0c3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/account_sas_parameters.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2018_11_01.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2018_11_01.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_11_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_11_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AccountSasParameters, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.resource_types = kwargs.get('resource_types', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/account_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/account_sas_parameters_py3.py deleted file mode 100644 index 2a4b649492a3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/account_sas_parameters_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2018_11_01.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2018_11_01.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_11_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_11_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: - super(AccountSasParameters, self).__init__(**kwargs) - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/azure_entity_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/azure_entity_resource.py deleted file mode 100644 index 3bffaab8d35b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/azure_entity_resource.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/azure_entity_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/azure_entity_resource_py3.py deleted file mode 100644 index d3f80d87498a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/azure_entity_resource_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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_py3 import Resource - - -class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/blob_container.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/blob_container.py deleted file mode 100644 index 02eb42ed1b7b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/blob_container.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class BlobContainer(AzureEntityResource): - """Properties of the blob container, including Id, resource name, resource - type, Etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_11_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_11_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_11_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_11_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_11_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(BlobContainer, self).__init__(**kwargs) - self.public_access = kwargs.get('public_access', None) - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = kwargs.get('metadata', None) - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/blob_container_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/blob_container_py3.py deleted file mode 100644 index 7ec441c4c256..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/blob_container_py3.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class BlobContainer(AzureEntityResource): - """Properties of the blob container, including Id, resource name, resource - type, Etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_11_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_11_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_11_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_11_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_11_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: - super(BlobContainer, self).__init__(**kwargs) - self.public_access = public_access - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = metadata - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/blob_service_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/blob_service_properties.py deleted file mode 100644 index d300b77a39dc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/blob_service_properties.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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 BlobServiceProperties(Resource): - """The properties of a storage account’s Blob service. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param cors: Specifies CORS rules for the Blob service. You can include up - to five CorsRule elements in the request. If no CorsRule elements are - included in the request body, all CORS rules will be deleted, and CORS - will be disabled for the Blob service. - :type cors: ~azure.mgmt.storage.v2018_11_01.models.CorsRules - :param default_service_version: DefaultServiceVersion indicates the - default version to use for requests to the Blob service if an incoming - request’s version is not specified. Possible values include version - 2008-10-27 and all more recent versions. - :type default_service_version: str - :param delete_retention_policy: The blob service properties for soft - delete. - :type delete_retention_policy: - ~azure.mgmt.storage.v2018_11_01.models.DeleteRetentionPolicy - """ - - _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'}, - 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, - 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, - 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, - } - - def __init__(self, **kwargs): - super(BlobServiceProperties, self).__init__(**kwargs) - self.cors = kwargs.get('cors', None) - self.default_service_version = kwargs.get('default_service_version', None) - self.delete_retention_policy = kwargs.get('delete_retention_policy', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/blob_service_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/blob_service_properties_py3.py deleted file mode 100644 index 4595e3ed6027..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/blob_service_properties_py3.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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_py3 import Resource - - -class BlobServiceProperties(Resource): - """The properties of a storage account’s Blob service. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param cors: Specifies CORS rules for the Blob service. You can include up - to five CorsRule elements in the request. If no CorsRule elements are - included in the request body, all CORS rules will be deleted, and CORS - will be disabled for the Blob service. - :type cors: ~azure.mgmt.storage.v2018_11_01.models.CorsRules - :param default_service_version: DefaultServiceVersion indicates the - default version to use for requests to the Blob service if an incoming - request’s version is not specified. Possible values include version - 2008-10-27 and all more recent versions. - :type default_service_version: str - :param delete_retention_policy: The blob service properties for soft - delete. - :type delete_retention_policy: - ~azure.mgmt.storage.v2018_11_01.models.DeleteRetentionPolicy - """ - - _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'}, - 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, - 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, - 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, - } - - def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, **kwargs) -> None: - super(BlobServiceProperties, self).__init__(**kwargs) - self.cors = cors - self.default_service_version = default_service_version - self.delete_retention_policy = delete_retention_policy diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/check_name_availability_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/check_name_availability_result.py deleted file mode 100644 index 03b9f760a48f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/check_name_availability_result.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2018_11_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/check_name_availability_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/check_name_availability_result_py3.py deleted file mode 100644 index 8cf811aa6140..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/check_name_availability_result_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2018_11_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/cors_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/cors_rule.py deleted file mode 100644 index 0777423f048f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/cors_rule.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 CorsRule(Model): - """Specifies a CORS rule for the Blob service. - - All required parameters must be populated in order to send to Azure. - - :param allowed_origins: Required. Required if CorsRule element is present. - A list of origin domains that will be allowed via CORS, or "*" to allow - all domains - :type allowed_origins: list[str] - :param allowed_methods: Required. Required if CorsRule element is present. - A list of HTTP methods that are allowed to be executed by the origin. - :type allowed_methods: list[str] - :param max_age_in_seconds: Required. Required if CorsRule element is - present. The number of seconds that the client/browser should cache a - preflight response. - :type max_age_in_seconds: int - :param exposed_headers: Required. Required if CorsRule element is present. - A list of response headers to expose to CORS clients. - :type exposed_headers: list[str] - :param allowed_headers: Required. Required if CorsRule element is present. - A list of headers allowed to be part of the cross-origin request. - :type allowed_headers: list[str] - """ - - _validation = { - 'allowed_origins': {'required': True}, - 'allowed_methods': {'required': True}, - 'max_age_in_seconds': {'required': True}, - 'exposed_headers': {'required': True}, - 'allowed_headers': {'required': True}, - } - - _attribute_map = { - 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, - 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, - 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, - 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, - 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(CorsRule, self).__init__(**kwargs) - self.allowed_origins = kwargs.get('allowed_origins', None) - self.allowed_methods = kwargs.get('allowed_methods', None) - self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None) - self.exposed_headers = kwargs.get('exposed_headers', None) - self.allowed_headers = kwargs.get('allowed_headers', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/cors_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/cors_rule_py3.py deleted file mode 100644 index b88a7928cd1c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/cors_rule_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 CorsRule(Model): - """Specifies a CORS rule for the Blob service. - - All required parameters must be populated in order to send to Azure. - - :param allowed_origins: Required. Required if CorsRule element is present. - A list of origin domains that will be allowed via CORS, or "*" to allow - all domains - :type allowed_origins: list[str] - :param allowed_methods: Required. Required if CorsRule element is present. - A list of HTTP methods that are allowed to be executed by the origin. - :type allowed_methods: list[str] - :param max_age_in_seconds: Required. Required if CorsRule element is - present. The number of seconds that the client/browser should cache a - preflight response. - :type max_age_in_seconds: int - :param exposed_headers: Required. Required if CorsRule element is present. - A list of response headers to expose to CORS clients. - :type exposed_headers: list[str] - :param allowed_headers: Required. Required if CorsRule element is present. - A list of headers allowed to be part of the cross-origin request. - :type allowed_headers: list[str] - """ - - _validation = { - 'allowed_origins': {'required': True}, - 'allowed_methods': {'required': True}, - 'max_age_in_seconds': {'required': True}, - 'exposed_headers': {'required': True}, - 'allowed_headers': {'required': True}, - } - - _attribute_map = { - 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, - 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, - 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, - 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, - 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, - } - - def __init__(self, *, allowed_origins, allowed_methods, max_age_in_seconds: int, exposed_headers, allowed_headers, **kwargs) -> None: - super(CorsRule, self).__init__(**kwargs) - self.allowed_origins = allowed_origins - self.allowed_methods = allowed_methods - self.max_age_in_seconds = max_age_in_seconds - self.exposed_headers = exposed_headers - self.allowed_headers = allowed_headers diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/cors_rules.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/cors_rules.py deleted file mode 100644 index a12737c7e3ba..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/cors_rules.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 CorsRules(Model): - """Sets the CORS rules. You can include up to five CorsRule elements in the - request. . - - :param cors_rules: The List of CORS rules. You can include up to five - CorsRule elements in the request. - :type cors_rules: list[~azure.mgmt.storage.v2018_11_01.models.CorsRule] - """ - - _attribute_map = { - 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, - } - - def __init__(self, **kwargs): - super(CorsRules, self).__init__(**kwargs) - self.cors_rules = kwargs.get('cors_rules', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/cors_rules_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/cors_rules_py3.py deleted file mode 100644 index 0dffb0d983b8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/cors_rules_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 CorsRules(Model): - """Sets the CORS rules. You can include up to five CorsRule elements in the - request. . - - :param cors_rules: The List of CORS rules. You can include up to five - CorsRule elements in the request. - :type cors_rules: list[~azure.mgmt.storage.v2018_11_01.models.CorsRule] - """ - - _attribute_map = { - 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, - } - - def __init__(self, *, cors_rules=None, **kwargs) -> None: - super(CorsRules, self).__init__(**kwargs) - self.cors_rules = cors_rules diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/custom_domain.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/custom_domain.py deleted file mode 100644 index d5cc10da36cb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/custom_domain.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(CustomDomain, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/custom_domain_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/custom_domain_py3.py deleted file mode 100644 index 25dce0b57aee..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/custom_domain_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: - super(CustomDomain, self).__init__(**kwargs) - self.name = name - self.use_sub_domain_name = use_sub_domain_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/date_after_creation.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/date_after_creation.py deleted file mode 100644 index 41272568a7a6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/date_after_creation.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 DateAfterCreation(Model): - """Object to define the number of days after creation. - - All required parameters must be populated in order to send to Azure. - - :param days_after_creation_greater_than: Required. Integer value - indicating the age in days after creation - :type days_after_creation_greater_than: int - """ - - _validation = { - 'days_after_creation_greater_than': {'required': True, 'minimum': 0}, - } - - _attribute_map = { - 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(DateAfterCreation, self).__init__(**kwargs) - self.days_after_creation_greater_than = kwargs.get('days_after_creation_greater_than', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/date_after_creation_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/date_after_creation_py3.py deleted file mode 100644 index ad6001e55a4e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/date_after_creation_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 DateAfterCreation(Model): - """Object to define the number of days after creation. - - All required parameters must be populated in order to send to Azure. - - :param days_after_creation_greater_than: Required. Integer value - indicating the age in days after creation - :type days_after_creation_greater_than: int - """ - - _validation = { - 'days_after_creation_greater_than': {'required': True, 'minimum': 0}, - } - - _attribute_map = { - 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'int'}, - } - - def __init__(self, *, days_after_creation_greater_than: int, **kwargs) -> None: - super(DateAfterCreation, self).__init__(**kwargs) - self.days_after_creation_greater_than = days_after_creation_greater_than diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/date_after_modification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/date_after_modification.py deleted file mode 100644 index 772272ba044a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/date_after_modification.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 DateAfterModification(Model): - """Object to define the number of days after last modification. - - All required parameters must be populated in order to send to Azure. - - :param days_after_modification_greater_than: Required. Integer value - indicating the age in days after last modification - :type days_after_modification_greater_than: int - """ - - _validation = { - 'days_after_modification_greater_than': {'required': True, 'minimum': 0}, - } - - _attribute_map = { - 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(DateAfterModification, self).__init__(**kwargs) - self.days_after_modification_greater_than = kwargs.get('days_after_modification_greater_than', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/date_after_modification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/date_after_modification_py3.py deleted file mode 100644 index cd8433ba06fa..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/date_after_modification_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 DateAfterModification(Model): - """Object to define the number of days after last modification. - - All required parameters must be populated in order to send to Azure. - - :param days_after_modification_greater_than: Required. Integer value - indicating the age in days after last modification - :type days_after_modification_greater_than: int - """ - - _validation = { - 'days_after_modification_greater_than': {'required': True, 'minimum': 0}, - } - - _attribute_map = { - 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'int'}, - } - - def __init__(self, *, days_after_modification_greater_than: int, **kwargs) -> None: - super(DateAfterModification, self).__init__(**kwargs) - self.days_after_modification_greater_than = days_after_modification_greater_than diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/delete_retention_policy.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/delete_retention_policy.py deleted file mode 100644 index 1edc91c2320a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/delete_retention_policy.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 DeleteRetentionPolicy(Model): - """The blob service properties for soft delete. - - :param enabled: Indicates whether DeleteRetentionPolicy is enabled for the - Blob service. - :type enabled: bool - :param days: Indicates the number of days that the deleted blob should be - retained. The minimum specified value can be 1 and the maximum value can - be 365. - :type days: int - """ - - _validation = { - 'days': {'maximum': 365, 'minimum': 1}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'days': {'key': 'days', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(DeleteRetentionPolicy, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.days = kwargs.get('days', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/delete_retention_policy_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/delete_retention_policy_py3.py deleted file mode 100644 index 9fcc691aadad..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/delete_retention_policy_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 DeleteRetentionPolicy(Model): - """The blob service properties for soft delete. - - :param enabled: Indicates whether DeleteRetentionPolicy is enabled for the - Blob service. - :type enabled: bool - :param days: Indicates the number of days that the deleted blob should be - retained. The minimum specified value can be 1 and the maximum value can - be 365. - :type days: int - """ - - _validation = { - 'days': {'maximum': 365, 'minimum': 1}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'days': {'key': 'days', 'type': 'int'}, - } - - def __init__(self, *, enabled: bool=None, days: int=None, **kwargs) -> None: - super(DeleteRetentionPolicy, self).__init__(**kwargs) - self.enabled = enabled - self.days = days diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/dimension.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/dimension.py deleted file mode 100644 index 2398aa46e8f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/dimension.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Dimension, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/dimension_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/dimension_py3.py deleted file mode 100644 index af5b0aac3d23..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/dimension_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: - super(Dimension, self).__init__(**kwargs) - self.name = name - self.display_name = display_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption.py deleted file mode 100644 index 0f6e31105b16..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2018_11_01.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or ~azure.mgmt.storage.v2018_11_01.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2018_11_01.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, **kwargs): - super(Encryption, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.key_source = kwargs.get('key_source', "Microsoft.Storage") - self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_py3.py deleted file mode 100644 index 8153352d3220..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2018_11_01.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or ~azure.mgmt.storage.v2018_11_01.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2018_11_01.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: - super(Encryption, self).__init__(**kwargs) - self.services = services - self.key_source = key_source - self.key_vault_properties = key_vault_properties diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_service.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_service.py deleted file mode 100644 index 3a020c468f64..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_service.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(EncryptionService, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_service_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_service_py3.py deleted file mode 100644 index 0566050c6155..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_service_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, enabled: bool=None, **kwargs) -> None: - super(EncryptionService, self).__init__(**kwargs) - self.enabled = enabled - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_services.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_services.py deleted file mode 100644 index 5d931278b899..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_services.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, **kwargs): - super(EncryptionServices, self).__init__(**kwargs) - self.blob = kwargs.get('blob', None) - self.file = kwargs.get('file', None) - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_services_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_services_py3.py deleted file mode 100644 index df7354b5a1d2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/encryption_services_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2018_11_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, *, blob=None, file=None, **kwargs) -> None: - super(EncryptionServices, self).__init__(**kwargs) - self.blob = blob - self.file = file - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/endpoints.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/endpoints.py deleted file mode 100644 index 66b1c3459a5e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/endpoints.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, - table, web or dfs object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - :ivar web: Gets the web endpoint. - :vartype web: str - :ivar dfs: Gets the dfs endpoint. - :vartype dfs: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - 'web': {'readonly': True}, - 'dfs': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - 'web': {'key': 'web', 'type': 'str'}, - 'dfs': {'key': 'dfs', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None - self.web = None - self.dfs = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/endpoints_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/endpoints_py3.py deleted file mode 100644 index ced561acd85b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/endpoints_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, - table, web or dfs object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - :ivar web: Gets the web endpoint. - :vartype web: str - :ivar dfs: Gets the dfs endpoint. - :vartype dfs: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - 'web': {'readonly': True}, - 'dfs': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - 'web': {'key': 'web', 'type': 'str'}, - 'dfs': {'key': 'dfs', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None - self.web = None - self.dfs = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/geo_replication_stats.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/geo_replication_stats.py deleted file mode 100644 index b8096a467a6c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/geo_replication_stats.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 GeoReplicationStats(Model): - """Statistics related to replication for storage account's Blob, Table, Queue - and File services. It is only available when geo-redundant replication is - enabled for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar status: The status of the secondary location. Possible values are: - - Live: Indicates that the secondary location is active and operational. - - Bootstrap: Indicates initial synchronization from the primary location to - the secondary location is in progress.This typically occurs when - replication is first enabled. - Unavailable: Indicates that the secondary - location is temporarily unavailable. Possible values include: 'Live', - 'Bootstrap', 'Unavailable' - :vartype status: str or - ~azure.mgmt.storage.v2018_11_01.models.GeoReplicationStatus - :ivar last_sync_time: All primary writes preceding this UTC date/time - value are guaranteed to be available for read operations. Primary writes - following this point in time may or may not be available for reads. - Element may be default value if value of LastSyncTime is not available, - this can happen if secondary is offline or we are in bootstrap. - :vartype last_sync_time: datetime - :ivar can_failover: A boolean flag which indicates whether or not account - failover is supported for the account. - :vartype can_failover: bool - """ - - _validation = { - 'status': {'readonly': True}, - 'last_sync_time': {'readonly': True}, - 'can_failover': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, - 'can_failover': {'key': 'canFailover', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(GeoReplicationStats, self).__init__(**kwargs) - self.status = None - self.last_sync_time = None - self.can_failover = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/geo_replication_stats_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/geo_replication_stats_py3.py deleted file mode 100644 index 2a06ee263f4f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/geo_replication_stats_py3.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 GeoReplicationStats(Model): - """Statistics related to replication for storage account's Blob, Table, Queue - and File services. It is only available when geo-redundant replication is - enabled for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar status: The status of the secondary location. Possible values are: - - Live: Indicates that the secondary location is active and operational. - - Bootstrap: Indicates initial synchronization from the primary location to - the secondary location is in progress.This typically occurs when - replication is first enabled. - Unavailable: Indicates that the secondary - location is temporarily unavailable. Possible values include: 'Live', - 'Bootstrap', 'Unavailable' - :vartype status: str or - ~azure.mgmt.storage.v2018_11_01.models.GeoReplicationStatus - :ivar last_sync_time: All primary writes preceding this UTC date/time - value are guaranteed to be available for read operations. Primary writes - following this point in time may or may not be available for reads. - Element may be default value if value of LastSyncTime is not available, - this can happen if secondary is offline or we are in bootstrap. - :vartype last_sync_time: datetime - :ivar can_failover: A boolean flag which indicates whether or not account - failover is supported for the account. - :vartype can_failover: bool - """ - - _validation = { - 'status': {'readonly': True}, - 'last_sync_time': {'readonly': True}, - 'can_failover': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, - 'can_failover': {'key': 'canFailover', 'type': 'bool'}, - } - - def __init__(self, **kwargs) -> None: - super(GeoReplicationStats, self).__init__(**kwargs) - self.status = None - self.last_sync_time = None - self.can_failover = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/identity.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/identity.py deleted file mode 100644 index f526b986fc70..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/identity.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/identity_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/identity_py3.py deleted file mode 100644 index 22d25fdd85b7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/identity_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs) -> None: - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/immutability_policy.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/immutability_policy.py deleted file mode 100644 index d001526ad5bb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/immutability_policy.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class ImmutabilityPolicy(AzureEntityResource): - """The ImmutabilityPolicy property of a blob container, including Id, resource - name, resource type, Etag. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImmutabilityPolicy, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) - self.state = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/immutability_policy_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/immutability_policy_properties.py deleted file mode 100644 index e904bb13ff4b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/immutability_policy_properties.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 ImmutabilityPolicyProperties(Model): - """The properties of an ImmutabilityPolicy of a blob container. - - 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 immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyState - :ivar etag: ImmutabilityPolicy Etag. - :vartype etag: str - :ivar update_history: The ImmutabilityPolicy update history of the blob - container. - :vartype update_history: - list[~azure.mgmt.storage.v2018_11_01.models.UpdateHistoryProperty] - """ - - _validation = { - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - 'etag': {'readonly': True}, - 'update_history': {'readonly': True}, - } - - _attribute_map = { - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, - } - - def __init__(self, **kwargs): - super(ImmutabilityPolicyProperties, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) - self.state = None - self.etag = None - self.update_history = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/immutability_policy_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/immutability_policy_properties_py3.py deleted file mode 100644 index 3252415b44a9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/immutability_policy_properties_py3.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 ImmutabilityPolicyProperties(Model): - """The properties of an ImmutabilityPolicy of a blob container. - - 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 immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyState - :ivar etag: ImmutabilityPolicy Etag. - :vartype etag: str - :ivar update_history: The ImmutabilityPolicy update history of the blob - container. - :vartype update_history: - list[~azure.mgmt.storage.v2018_11_01.models.UpdateHistoryProperty] - """ - - _validation = { - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - 'etag': {'readonly': True}, - 'update_history': {'readonly': True}, - } - - _attribute_map = { - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, - } - - def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: - super(ImmutabilityPolicyProperties, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days - self.state = None - self.etag = None - self.update_history = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/immutability_policy_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/immutability_policy_py3.py deleted file mode 100644 index 36275f539592..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/immutability_policy_py3.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class ImmutabilityPolicy(AzureEntityResource): - """The ImmutabilityPolicy property of a blob container, including Id, resource - name, resource type, Etag. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: - super(ImmutabilityPolicy, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days - self.state = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/ip_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/ip_rule.py deleted file mode 100644 index a62fe1a1ad45..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/ip_rule.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_11_01.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.action = kwargs.get('action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/ip_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/ip_rule_py3.py deleted file mode 100644 index 28fe9583e685..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/ip_rule_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_11_01.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = ip_address_or_range - self.action = action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/key_vault_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/key_vault_properties.py deleted file mode 100644 index 44eaf379f6f2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/key_vault_properties.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - self.key_version = kwargs.get('key_version', None) - self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/key_vault_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/key_vault_properties_py3.py deleted file mode 100644 index 9e6350eec898..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/key_vault_properties_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = key_name - self.key_version = key_version - self.key_vault_uri = key_vault_uri diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/lease_container_request.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/lease_container_request.py deleted file mode 100644 index 246893817045..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/lease_container_request.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 LeaseContainerRequest(Model): - """Lease Container request schema. - - All required parameters must be populated in order to send to Azure. - - :param action: Required. Specifies the lease action. Can be one of the - available actions. Possible values include: 'Acquire', 'Renew', 'Change', - 'Release', 'Break' - :type action: str or ~azure.mgmt.storage.v2018_11_01.models.enum - :param lease_id: Identifies the lease. Can be specified in any valid GUID - string format. - :type lease_id: str - :param break_period: Optional. For a break action, proposed duration the - lease should continue before it is broken, in seconds, between 0 and 60. - :type break_period: int - :param lease_duration: Required for acquire. Specifies the duration of the - lease, in seconds, or negative one (-1) for a lease that never expires. - :type lease_duration: int - :param proposed_lease_id: Optional for acquire, required for change. - Proposed lease ID, in a GUID string format. - :type proposed_lease_id: str - """ - - _validation = { - 'action': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'break_period': {'key': 'breakPeriod', 'type': 'int'}, - 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, - 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LeaseContainerRequest, self).__init__(**kwargs) - self.action = kwargs.get('action', None) - self.lease_id = kwargs.get('lease_id', None) - self.break_period = kwargs.get('break_period', None) - self.lease_duration = kwargs.get('lease_duration', None) - self.proposed_lease_id = kwargs.get('proposed_lease_id', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/lease_container_request_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/lease_container_request_py3.py deleted file mode 100644 index 06f0d83d4740..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/lease_container_request_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 LeaseContainerRequest(Model): - """Lease Container request schema. - - All required parameters must be populated in order to send to Azure. - - :param action: Required. Specifies the lease action. Can be one of the - available actions. Possible values include: 'Acquire', 'Renew', 'Change', - 'Release', 'Break' - :type action: str or ~azure.mgmt.storage.v2018_11_01.models.enum - :param lease_id: Identifies the lease. Can be specified in any valid GUID - string format. - :type lease_id: str - :param break_period: Optional. For a break action, proposed duration the - lease should continue before it is broken, in seconds, between 0 and 60. - :type break_period: int - :param lease_duration: Required for acquire. Specifies the duration of the - lease, in seconds, or negative one (-1) for a lease that never expires. - :type lease_duration: int - :param proposed_lease_id: Optional for acquire, required for change. - Proposed lease ID, in a GUID string format. - :type proposed_lease_id: str - """ - - _validation = { - 'action': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'break_period': {'key': 'breakPeriod', 'type': 'int'}, - 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, - 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, - } - - def __init__(self, *, action, lease_id: str=None, break_period: int=None, lease_duration: int=None, proposed_lease_id: str=None, **kwargs) -> None: - super(LeaseContainerRequest, self).__init__(**kwargs) - self.action = action - self.lease_id = lease_id - self.break_period = break_period - self.lease_duration = lease_duration - self.proposed_lease_id = proposed_lease_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/lease_container_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/lease_container_response.py deleted file mode 100644 index 666f0e899f1e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/lease_container_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 LeaseContainerResponse(Model): - """Lease Container response schema. - - :param lease_id: Returned unique lease ID that must be included with any - request to delete the container, or to renew, change, or release the - lease. - :type lease_id: str - :param lease_time_seconds: Approximate time remaining in the lease period, - in seconds. - :type lease_time_seconds: str - """ - - _attribute_map = { - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LeaseContainerResponse, self).__init__(**kwargs) - self.lease_id = kwargs.get('lease_id', None) - self.lease_time_seconds = kwargs.get('lease_time_seconds', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/lease_container_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/lease_container_response_py3.py deleted file mode 100644 index fa87d930571d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/lease_container_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 LeaseContainerResponse(Model): - """Lease Container response schema. - - :param lease_id: Returned unique lease ID that must be included with any - request to delete the container, or to renew, change, or release the - lease. - :type lease_id: str - :param lease_time_seconds: Approximate time remaining in the lease period, - in seconds. - :type lease_time_seconds: str - """ - - _attribute_map = { - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, - } - - def __init__(self, *, lease_id: str=None, lease_time_seconds: str=None, **kwargs) -> None: - super(LeaseContainerResponse, self).__init__(**kwargs) - self.lease_id = lease_id - self.lease_time_seconds = lease_time_seconds diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/legal_hold.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/legal_hold.py deleted file mode 100644 index 4eb93df1d9fe..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/legal_hold.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 LegalHold(Model): - """The LegalHold property of a blob container. - - 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 has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: Required. Each tag should be 3 to 23 alphanumeric characters - and is normalized to lower case at SRP. - :type tags: list[str] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - 'tags': {'required': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(LegalHold, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = kwargs.get('tags', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/legal_hold_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/legal_hold_properties.py deleted file mode 100644 index e5290645a0e8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/legal_hold_properties.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 LegalHoldProperties(Model): - """The LegalHold property of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: The list of LegalHold tags of a blob container. - :type tags: list[~azure.mgmt.storage.v2018_11_01.models.TagProperty] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[TagProperty]'}, - } - - def __init__(self, **kwargs): - super(LegalHoldProperties, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = kwargs.get('tags', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/legal_hold_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/legal_hold_properties_py3.py deleted file mode 100644 index 53154887db78..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/legal_hold_properties_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 LegalHoldProperties(Model): - """The LegalHold property of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: The list of LegalHold tags of a blob container. - :type tags: list[~azure.mgmt.storage.v2018_11_01.models.TagProperty] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[TagProperty]'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(LegalHoldProperties, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = tags diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/legal_hold_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/legal_hold_py3.py deleted file mode 100644 index a4bc196cb604..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/legal_hold_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 LegalHold(Model): - """The LegalHold property of a blob container. - - 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 has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: Required. Each tag should be 3 to 23 alphanumeric characters - and is normalized to lower case at SRP. - :type tags: list[str] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - 'tags': {'required': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - } - - def __init__(self, *, tags, **kwargs) -> None: - super(LegalHold, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = tags diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_account_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_account_sas_response.py deleted file mode 100644 index a56e959a34bd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_account_sas_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_account_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_account_sas_response_py3.py deleted file mode 100644 index b8b9a314d9f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_account_sas_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_container_item.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_container_item.py deleted file mode 100644 index a3e440ec6712..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_container_item.py +++ /dev/null @@ -1,118 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class ListContainerItem(AzureEntityResource): - """The blob container properties be listed out. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_11_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_11_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_11_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_11_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_11_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(ListContainerItem, self).__init__(**kwargs) - self.public_access = kwargs.get('public_access', None) - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = kwargs.get('metadata', None) - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_container_item_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_container_item_py3.py deleted file mode 100644 index 3a42837b4d3d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_container_item_py3.py +++ /dev/null @@ -1,118 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class ListContainerItem(AzureEntityResource): - """The blob container properties be listed out. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_11_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2018_11_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2018_11_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2018_11_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2018_11_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: - super(ListContainerItem, self).__init__(**kwargs) - self.public_access = public_access - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = metadata - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_container_items.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_container_items.py deleted file mode 100644 index ecdfe1916baa..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_container_items.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ListContainerItems(Model): - """The list of blob containers. - - :param value: The list of blob containers. - :type value: - list[~azure.mgmt.storage.v2018_11_01.models.ListContainerItem] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ListContainerItem]'}, - } - - def __init__(self, **kwargs): - super(ListContainerItems, self).__init__(**kwargs) - self.value = kwargs.get('value', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_container_items_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_container_items_py3.py deleted file mode 100644 index 32b626f1c6ac..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_container_items_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ListContainerItems(Model): - """The list of blob containers. - - :param value: The list of blob containers. - :type value: - list[~azure.mgmt.storage.v2018_11_01.models.ListContainerItem] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ListContainerItem]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(ListContainerItems, self).__init__(**kwargs) - self.value = value diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_service_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_service_sas_response.py deleted file mode 100644 index d4ab160ae364..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_service_sas_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_service_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_service_sas_response_py3.py deleted file mode 100644 index 7c20617658df..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/list_service_sas_response_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy.py deleted file mode 100644 index c22f1dd2011b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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 ManagementPolicy(Resource): - """The Get Storage Account ManagementPolicies operation response. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar last_modified_time: Returns the date and time the ManagementPolicies - was last modified. - :vartype last_modified_time: datetime - :param policy: Required. The Storage Account ManagementPolicy, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicySchema - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'policy': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicy, self).__init__(**kwargs) - self.last_modified_time = None - self.policy = kwargs.get('policy', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_action.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_action.py deleted file mode 100644 index 47daef517d92..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_action.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ManagementPolicyAction(Model): - """Actions are applied to the filtered blobs when the execution condition is - met. - - :param base_blob: The management policy action for base blob - :type base_blob: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyBaseBlob - :param snapshot: The management policy action for snapshot - :type snapshot: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicySnapShot - """ - - _attribute_map = { - 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, - 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicyAction, self).__init__(**kwargs) - self.base_blob = kwargs.get('base_blob', None) - self.snapshot = kwargs.get('snapshot', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_action_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_action_py3.py deleted file mode 100644 index 336756ac3fea..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_action_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ManagementPolicyAction(Model): - """Actions are applied to the filtered blobs when the execution condition is - met. - - :param base_blob: The management policy action for base blob - :type base_blob: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyBaseBlob - :param snapshot: The management policy action for snapshot - :type snapshot: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicySnapShot - """ - - _attribute_map = { - 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, - 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, - } - - def __init__(self, *, base_blob=None, snapshot=None, **kwargs) -> None: - super(ManagementPolicyAction, self).__init__(**kwargs) - self.base_blob = base_blob - self.snapshot = snapshot diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_base_blob.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_base_blob.py deleted file mode 100644 index 654c61d4e0b8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_base_blob.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 ManagementPolicyBaseBlob(Model): - """Management policy action for base blob. - - :param tier_to_cool: The function to tier blobs to cool storage. Support - blobs currently at Hot tier - :type tier_to_cool: - ~azure.mgmt.storage.v2018_11_01.models.DateAfterModification - :param tier_to_archive: The function to tier blobs to archive storage. - Support blobs currently at Hot or Cool tier - :type tier_to_archive: - ~azure.mgmt.storage.v2018_11_01.models.DateAfterModification - :param delete: The function to delete the blob - :type delete: ~azure.mgmt.storage.v2018_11_01.models.DateAfterModification - """ - - _attribute_map = { - 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, - 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, - 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicyBaseBlob, self).__init__(**kwargs) - self.tier_to_cool = kwargs.get('tier_to_cool', None) - self.tier_to_archive = kwargs.get('tier_to_archive', None) - self.delete = kwargs.get('delete', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_base_blob_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_base_blob_py3.py deleted file mode 100644 index a0b75fd7bc33..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_base_blob_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 ManagementPolicyBaseBlob(Model): - """Management policy action for base blob. - - :param tier_to_cool: The function to tier blobs to cool storage. Support - blobs currently at Hot tier - :type tier_to_cool: - ~azure.mgmt.storage.v2018_11_01.models.DateAfterModification - :param tier_to_archive: The function to tier blobs to archive storage. - Support blobs currently at Hot or Cool tier - :type tier_to_archive: - ~azure.mgmt.storage.v2018_11_01.models.DateAfterModification - :param delete: The function to delete the blob - :type delete: ~azure.mgmt.storage.v2018_11_01.models.DateAfterModification - """ - - _attribute_map = { - 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, - 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, - 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, - } - - def __init__(self, *, tier_to_cool=None, tier_to_archive=None, delete=None, **kwargs) -> None: - super(ManagementPolicyBaseBlob, self).__init__(**kwargs) - self.tier_to_cool = tier_to_cool - self.tier_to_archive = tier_to_archive - self.delete = delete diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_definition.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_definition.py deleted file mode 100644 index 13b49bba5253..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_definition.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ManagementPolicyDefinition(Model): - """An object that defines the Lifecycle rule. Each definition is made up with - a filters set and an actions set. - - All required parameters must be populated in order to send to Azure. - - :param actions: Required. An object that defines the action set. - :type actions: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyAction - :param filters: An object that defines the filter set. - :type filters: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyFilter - """ - - _validation = { - 'actions': {'required': True}, - } - - _attribute_map = { - 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, - 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicyDefinition, self).__init__(**kwargs) - self.actions = kwargs.get('actions', None) - self.filters = kwargs.get('filters', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_definition_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_definition_py3.py deleted file mode 100644 index 82ad4df00979..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_definition_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ManagementPolicyDefinition(Model): - """An object that defines the Lifecycle rule. Each definition is made up with - a filters set and an actions set. - - All required parameters must be populated in order to send to Azure. - - :param actions: Required. An object that defines the action set. - :type actions: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyAction - :param filters: An object that defines the filter set. - :type filters: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyFilter - """ - - _validation = { - 'actions': {'required': True}, - } - - _attribute_map = { - 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, - 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, - } - - def __init__(self, *, actions, filters=None, **kwargs) -> None: - super(ManagementPolicyDefinition, self).__init__(**kwargs) - self.actions = actions - self.filters = filters diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_filter.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_filter.py deleted file mode 100644 index 29a7cadc9444..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_filter.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ManagementPolicyFilter(Model): - """Filters limit rule actions to a subset of blobs within the storage account. - If multiple filters are defined, a logical AND is performed on all filters. - . - - All required parameters must be populated in order to send to Azure. - - :param prefix_match: An array of strings for prefixes to be match. - :type prefix_match: list[str] - :param blob_types: Required. An array of predefined enum values. Only - blockBlob is supported. - :type blob_types: list[str] - """ - - _validation = { - 'blob_types': {'required': True}, - } - - _attribute_map = { - 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, - 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicyFilter, self).__init__(**kwargs) - self.prefix_match = kwargs.get('prefix_match', None) - self.blob_types = kwargs.get('blob_types', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_filter_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_filter_py3.py deleted file mode 100644 index 2bf8d03ca66f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_filter_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ManagementPolicyFilter(Model): - """Filters limit rule actions to a subset of blobs within the storage account. - If multiple filters are defined, a logical AND is performed on all filters. - . - - All required parameters must be populated in order to send to Azure. - - :param prefix_match: An array of strings for prefixes to be match. - :type prefix_match: list[str] - :param blob_types: Required. An array of predefined enum values. Only - blockBlob is supported. - :type blob_types: list[str] - """ - - _validation = { - 'blob_types': {'required': True}, - } - - _attribute_map = { - 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, - 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, - } - - def __init__(self, *, blob_types, prefix_match=None, **kwargs) -> None: - super(ManagementPolicyFilter, self).__init__(**kwargs) - self.prefix_match = prefix_match - self.blob_types = blob_types diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_py3.py deleted file mode 100644 index a166189ad1ca..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_py3.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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_py3 import Resource - - -class ManagementPolicy(Resource): - """The Get Storage Account ManagementPolicies operation response. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar last_modified_time: Returns the date and time the ManagementPolicies - was last modified. - :vartype last_modified_time: datetime - :param policy: Required. The Storage Account ManagementPolicy, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicySchema - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'policy': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, - } - - def __init__(self, *, policy, **kwargs) -> None: - super(ManagementPolicy, self).__init__(**kwargs) - self.last_modified_time = None - self.policy = policy diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_rule.py deleted file mode 100644 index 088484b19856..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_rule.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 ManagementPolicyRule(Model): - """An object that wraps the Lifecycle rule. Each rule is uniquely defined by - name. - - 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 enabled: Rule is enabled if set to true. - :type enabled: bool - :param name: Required. A rule name can contain any combination of alpha - numeric characters. Rule name is case-sensitive. It must be unique within - a policy. - :type name: str - :ivar type: Required. The valid value is Lifecycle. Default value: - "Lifecycle" . - :vartype type: str - :param definition: Required. An object that defines the Lifecycle rule. - :type definition: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyDefinition - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, - } - - type = "Lifecycle" - - def __init__(self, **kwargs): - super(ManagementPolicyRule, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.name = kwargs.get('name', None) - self.definition = kwargs.get('definition', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_rule_py3.py deleted file mode 100644 index 3466924dd3a9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_rule_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 ManagementPolicyRule(Model): - """An object that wraps the Lifecycle rule. Each rule is uniquely defined by - name. - - 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 enabled: Rule is enabled if set to true. - :type enabled: bool - :param name: Required. A rule name can contain any combination of alpha - numeric characters. Rule name is case-sensitive. It must be unique within - a policy. - :type name: str - :ivar type: Required. The valid value is Lifecycle. Default value: - "Lifecycle" . - :vartype type: str - :param definition: Required. An object that defines the Lifecycle rule. - :type definition: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyDefinition - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, - } - - type = "Lifecycle" - - def __init__(self, *, name: str, definition, enabled: bool=None, **kwargs) -> None: - super(ManagementPolicyRule, self).__init__(**kwargs) - self.enabled = enabled - self.name = name - self.definition = definition diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_schema.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_schema.py deleted file mode 100644 index f635000a38cd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_schema.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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 ManagementPolicySchema(Model): - """The Storage Account ManagementPolicies Rules. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - - All required parameters must be populated in order to send to Azure. - - :param rules: Required. The Storage Account ManagementPolicies Rules. See - more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type rules: - list[~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyRule] - """ - - _validation = { - 'rules': {'required': True}, - } - - _attribute_map = { - 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicySchema, self).__init__(**kwargs) - self.rules = kwargs.get('rules', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_schema_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_schema_py3.py deleted file mode 100644 index 05d5f7de477b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_schema_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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 ManagementPolicySchema(Model): - """The Storage Account ManagementPolicies Rules. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - - All required parameters must be populated in order to send to Azure. - - :param rules: Required. The Storage Account ManagementPolicies Rules. See - more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type rules: - list[~azure.mgmt.storage.v2018_11_01.models.ManagementPolicyRule] - """ - - _validation = { - 'rules': {'required': True}, - } - - _attribute_map = { - 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, - } - - def __init__(self, *, rules, **kwargs) -> None: - super(ManagementPolicySchema, self).__init__(**kwargs) - self.rules = rules diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_snap_shot.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_snap_shot.py deleted file mode 100644 index ff0fe7972ca7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_snap_shot.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 ManagementPolicySnapShot(Model): - """Management policy action for snapshot. - - :param delete: The function to delete the blob snapshot - :type delete: ~azure.mgmt.storage.v2018_11_01.models.DateAfterCreation - """ - - _attribute_map = { - 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicySnapShot, self).__init__(**kwargs) - self.delete = kwargs.get('delete', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_snap_shot_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_snap_shot_py3.py deleted file mode 100644 index 77f999bcb916..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/management_policy_snap_shot_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 ManagementPolicySnapShot(Model): - """Management policy action for snapshot. - - :param delete: The function to delete the blob snapshot - :type delete: ~azure.mgmt.storage.v2018_11_01.models.DateAfterCreation - """ - - _attribute_map = { - 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, - } - - def __init__(self, *, delete=None, **kwargs) -> None: - super(ManagementPolicySnapShot, self).__init__(**kwargs) - self.delete = delete diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/metric_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/metric_specification.py deleted file mode 100644 index e098fcd062e0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/metric_specification.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: list[~azure.mgmt.storage.v2018_11_01.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MetricSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.dimensions = kwargs.get('dimensions', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) - self.category = kwargs.get('category', None) - self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/metric_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/metric_specification_py3.py deleted file mode 100644 index efb5c10ec578..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/metric_specification_py3.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: list[~azure.mgmt.storage.v2018_11_01.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: - super(MetricSpecification, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.dimensions = dimensions - self.aggregation_type = aggregation_type - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/network_rule_set.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/network_rule_set.py deleted file mode 100644 index 8a8a047e6fce..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/network_rule_set.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2018_11_01.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2018_11_01.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: list[~azure.mgmt.storage.v2018_11_01.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2018_11_01.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = kwargs.get('bypass', "AzureServices") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) - self.default_action = kwargs.get('default_action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/network_rule_set_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/network_rule_set_py3.py deleted file mode 100644 index 066e419e0974..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/network_rule_set_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2018_11_01.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2018_11_01.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: list[~azure.mgmt.storage.v2018_11_01.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2018_11_01.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = bypass - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules - self.default_action = default_action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation.py deleted file mode 100644 index 5d383ee929ef..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~azure.mgmt.storage.v2018_11_01.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2018_11_01.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation_display.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation_display.py deleted file mode 100644 index 029cfa2a8304..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation_display.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of 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(OperationDisplay, 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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation_display_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation_display_py3.py deleted file mode 100644 index 318ba2236d3e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation_display_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of 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(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation_paged.py deleted file mode 100644 index 7c8486fec41f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation_py3.py deleted file mode 100644 index 41bf2e9d01eb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/operation_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~azure.mgmt.storage.v2018_11_01.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2018_11_01.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/proxy_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/proxy_resource.py deleted file mode 100644 index 0de8fb6bd420..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/proxy_resource.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 ProxyResource(Resource): - """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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/proxy_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/proxy_resource_py3.py deleted file mode 100644 index 2e8391f912d6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/proxy_resource_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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_py3 import Resource - - -class ProxyResource(Resource): - """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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/resource.py deleted file mode 100644 index 9333a2ac49ef..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/resource.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/resource_py3.py deleted file mode 100644 index 370e6c506581..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/resource_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/restriction.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/restriction.py deleted file mode 100644 index 7df1b4c2fbca..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/restriction.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2018_11_01.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = kwargs.get('reason_code', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/restriction_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/restriction_py3.py deleted file mode 100644 index cb0b5268db76..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/restriction_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2018_11_01.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, *, reason_code=None, **kwargs) -> None: - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = reason_code diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/service_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/service_sas_parameters.py deleted file mode 100644 index e9d17f216351..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/service_sas_parameters.py +++ /dev/null @@ -1,120 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2018_11_01.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_11_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_11_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = kwargs.get('canonicalized_resource', None) - self.resource = kwargs.get('resource', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.identifier = kwargs.get('identifier', None) - self.partition_key_start = kwargs.get('partition_key_start', None) - self.partition_key_end = kwargs.get('partition_key_end', None) - self.row_key_start = kwargs.get('row_key_start', None) - self.row_key_end = kwargs.get('row_key_end', None) - self.key_to_sign = kwargs.get('key_to_sign', None) - self.cache_control = kwargs.get('cache_control', None) - self.content_disposition = kwargs.get('content_disposition', None) - self.content_encoding = kwargs.get('content_encoding', None) - self.content_language = kwargs.get('content_language', None) - self.content_type = kwargs.get('content_type', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/service_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/service_sas_parameters_py3.py deleted file mode 100644 index 3d4153d05d52..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/service_sas_parameters_py3.py +++ /dev/null @@ -1,120 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2018_11_01.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2018_11_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2018_11_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, *, canonicalized_resource: str, resource=None, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/service_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/service_specification.py deleted file mode 100644 index c6c2b4158989..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/service_specification.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2018_11_01.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, **kwargs): - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/service_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/service_specification_py3.py deleted file mode 100644 index c6b966f02ca0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/service_specification_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2018_11_01.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku.py deleted file mode 100644 index 94f0f529af62..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the SKU name. Required for account - creation; optional for update. Note that in older versions, SKU name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', - 'Premium_ZRS' - :type name: str or ~azure.mgmt.storage.v2018_11_01.models.SkuName - :ivar tier: Gets the SKU tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2018_11_01.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', - 'BlockBlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified SKU, - including file encryption, network ACLs, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2018_11_01.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2018_11_01.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = kwargs.get('restrictions', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku_capability.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku_capability.py deleted file mode 100644 index 3f27b5e45feb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku_capability.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified SKU, including file encryption, - network ACLs, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified SKU, including file encryption, network ACLs, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku_capability_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku_capability_py3.py deleted file mode 100644 index 5bc3628f2173..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku_capability_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified SKU, including file encryption, - network ACLs, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified SKU, including file encryption, network ACLs, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku_paged.py deleted file mode 100644 index 7e55aaef69d8..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 SkuPaged(Paged): - """ - A paging container for iterating over a list of :class:`Sku ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Sku]'} - } - - def __init__(self, *args, **kwargs): - - super(SkuPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku_py3.py deleted file mode 100644 index c5d7159eccad..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/sku_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the SKU name. Required for account - creation; optional for update. Note that in older versions, SKU name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', - 'Premium_ZRS' - :type name: str or ~azure.mgmt.storage.v2018_11_01.models.SkuName - :ivar tier: Gets the SKU tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2018_11_01.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', - 'BlockBlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified SKU, - including file encryption, network ACLs, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2018_11_01.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2018_11_01.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'SkuName'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, *, name, restrictions=None, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = restrictions diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account.py deleted file mode 100644 index 18963a089c43..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account.py +++ /dev/null @@ -1,191 +0,0 @@ -# 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 .tracked_resource import TrackedResource - - -class StorageAccount(TrackedResource): - """The storage account. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2018_11_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_11_01.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2018_11_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2018_11_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2018_11_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2018_11_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2018_11_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2018_11_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2018_11_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2018_11_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2018_11_01.models.NetworkRuleSet - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. - :type is_hns_enabled: bool - :ivar geo_replication_stats: Geo Replication Stats - :vartype geo_replication_stats: - ~azure.mgmt.storage.v2018_11_01.models.GeoReplicationStats - :ivar failover_in_progress: If the failover is in progress, the value will - be true, otherwise, it will be null. - :vartype failover_in_progress: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'readonly': True}, - 'geo_replication_stats': {'readonly': True}, - 'failover_in_progress': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, - 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccount, self).__init__(**kwargs) - self.sku = None - self.kind = None - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) - self.network_rule_set = None - self.is_hns_enabled = kwargs.get('is_hns_enabled', None) - self.geo_replication_stats = None - self.failover_in_progress = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_check_name_availability_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_check_name_availability_parameters.py deleted file mode 100644 index dbe41bb2c6b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_check_name_availability_parameters.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, **kwargs): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_check_name_availability_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_check_name_availability_parameters_py3.py deleted file mode 100644 index 8d2b031e2284..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_check_name_availability_parameters_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, *, name: str, **kwargs) -> None: - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_create_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_create_parameters.py deleted file mode 100644 index 30dab530cd16..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_create_parameters.py +++ /dev/null @@ -1,102 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the SKU name. - :type sku: ~azure.mgmt.storage.v2018_11_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'StorageV2', 'BlobStorage', - 'FileStorage', 'BlockBlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_11_01.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2018_11_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2018_11_01.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_11_01.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_11_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. - :type is_hns_enabled: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) - self.is_hns_enabled = kwargs.get('is_hns_enabled', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_create_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_create_parameters_py3.py deleted file mode 100644 index 1f87d41668ca..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_create_parameters_py3.py +++ /dev/null @@ -1,102 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the SKU name. - :type sku: ~azure.mgmt.storage.v2018_11_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'StorageV2', 'BlobStorage', - 'FileStorage', 'BlockBlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_11_01.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2018_11_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2018_11_01.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_11_01.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_11_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. - :type is_hns_enabled: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None: - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.network_rule_set = network_rule_set - self.access_tier = access_tier - self.enable_azure_files_aad_integration = enable_azure_files_aad_integration - self.enable_https_traffic_only = enable_https_traffic_only - self.is_hns_enabled = is_hns_enabled diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_key.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_key.py deleted file mode 100644 index 8a4e14e4a9b4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_key.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2018_11_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs): - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_key_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_key_py3.py deleted file mode 100644 index 451bd80abab7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_key_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2018_11_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_list_keys_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_list_keys_result.py deleted file mode 100644 index c0f7223b7db4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_list_keys_result.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2018_11_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs): - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_list_keys_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_list_keys_result_py3.py deleted file mode 100644 index 7fdf1fcbc171..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_list_keys_result_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2018_11_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_paged.py deleted file mode 100644 index 853e0053b992..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 StorageAccountPaged(Paged): - """ - A paging container for iterating over a list of :class:`StorageAccount ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[StorageAccount]'} - } - - def __init__(self, *args, **kwargs): - - super(StorageAccountPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_py3.py deleted file mode 100644 index d026cb6fc66b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_py3.py +++ /dev/null @@ -1,191 +0,0 @@ -# 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 .tracked_resource_py3 import TrackedResource - - -class StorageAccount(TrackedResource): - """The storage account. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2018_11_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_11_01.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2018_11_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2018_11_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2018_11_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2018_11_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2018_11_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2018_11_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2018_11_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2018_11_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2018_11_01.models.NetworkRuleSet - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. - :type is_hns_enabled: bool - :ivar geo_replication_stats: Geo Replication Stats - :vartype geo_replication_stats: - ~azure.mgmt.storage.v2018_11_01.models.GeoReplicationStats - :ivar failover_in_progress: If the failover is in progress, the value will - be true, otherwise, it will be null. - :vartype failover_in_progress: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'readonly': True}, - 'geo_replication_stats': {'readonly': True}, - 'failover_in_progress': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, - 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, - } - - def __init__(self, *, location: str, tags=None, identity=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None: - super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) - self.sku = None - self.kind = None - self.identity = identity - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_azure_files_aad_integration = enable_azure_files_aad_integration - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = None - self.is_hns_enabled = is_hns_enabled - self.geo_replication_stats = None - self.failover_in_progress = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_regenerate_key_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_regenerate_key_parameters.py deleted file mode 100644 index 6dba2135fdc7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_regenerate_key_parameters.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_regenerate_key_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_regenerate_key_parameters_py3.py deleted file mode 100644 index 6e06a071eba3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_regenerate_key_parameters_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = key_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_update_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_update_parameters.py deleted file mode 100644 index 61893b558a4c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_update_parameters.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of - those SKU names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2018_11_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_11_01.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2018_11_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2018_11_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_11_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_11_01.models.NetworkRuleSet - :param kind: Optional. Indicates the type of storage account. Currently - only StorageV2 value supported by server. Possible values include: - 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - } - - def __init__(self, **kwargs): - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.kind = kwargs.get('kind', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_update_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_update_parameters_py3.py deleted file mode 100644 index 55b9e0e379e1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/storage_account_update_parameters_py3.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of - those SKU names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2018_11_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2018_11_01.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2018_11_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2018_11_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2018_11_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2018_11_01.models.NetworkRuleSet - :param kind: Optional. Indicates the type of storage account. Currently - only StorageV2 value supported by server. Possible values include: - 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - :type kind: str or ~azure.mgmt.storage.v2018_11_01.models.Kind - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'kind': {'key': 'kind', 'type': 'Kind'}, - } - - def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, network_rule_set=None, kind=None, **kwargs) -> None: - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = sku - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_azure_files_aad_integration = enable_azure_files_aad_integration - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = network_rule_set - self.kind = kind diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/tag_property.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/tag_property.py deleted file mode 100644 index 3b879061fd2b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/tag_property.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 TagProperty(Model): - """A tag of the LegalHold of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tag: The tag value. - :vartype tag: str - :ivar timestamp: Returns the date and time the tag was added. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who added the - tag. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who added the tag. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who added the tag. - :vartype upn: str - """ - - _validation = { - 'tag': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'tag': {'key': 'tag', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TagProperty, self).__init__(**kwargs) - self.tag = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/tag_property_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/tag_property_py3.py deleted file mode 100644 index 22aaf6cb82ba..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/tag_property_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 TagProperty(Model): - """A tag of the LegalHold of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tag: The tag value. - :vartype tag: str - :ivar timestamp: Returns the date and time the tag was added. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who added the - tag. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who added the tag. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who added the tag. - :vartype upn: str - """ - - _validation = { - 'tag': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'tag': {'key': 'tag', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(TagProperty, self).__init__(**kwargs) - self.tag = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/tracked_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/tracked_resource.py deleted file mode 100644 index 27ab94c7a8dd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/tracked_resource.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 TrackedResource(Resource): - """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs.get('location', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/tracked_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/tracked_resource_py3.py deleted file mode 100644 index b28cc1859448..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/tracked_resource_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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_py3 import Resource - - -class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/update_history_property.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/update_history_property.py deleted file mode 100644 index 790be614a340..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/update_history_property.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 UpdateHistoryProperty(Model): - """An update history of the ImmutabilityPolicy of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar update: The ImmutabilityPolicy update type of a blob container, - possible values include: put, lock and extend. Possible values include: - 'put', 'lock', 'extend' - :vartype update: str or - ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyUpdateType - :ivar immutability_period_since_creation_in_days: The immutability period - for the blobs in the container since the policy creation, in days. - :vartype immutability_period_since_creation_in_days: int - :ivar timestamp: Returns the date and time the ImmutabilityPolicy was - updated. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who updated the - ImmutabilityPolicy. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who updated the ImmutabilityPolicy. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who updated the - ImmutabilityPolicy. - :vartype upn: str - """ - - _validation = { - 'update': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'update': {'key': 'update', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UpdateHistoryProperty, self).__init__(**kwargs) - self.update = None - self.immutability_period_since_creation_in_days = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/update_history_property_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/update_history_property_py3.py deleted file mode 100644 index 20f375cbbde3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/update_history_property_py3.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 UpdateHistoryProperty(Model): - """An update history of the ImmutabilityPolicy of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar update: The ImmutabilityPolicy update type of a blob container, - possible values include: put, lock and extend. Possible values include: - 'put', 'lock', 'extend' - :vartype update: str or - ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyUpdateType - :ivar immutability_period_since_creation_in_days: The immutability period - for the blobs in the container since the policy creation, in days. - :vartype immutability_period_since_creation_in_days: int - :ivar timestamp: Returns the date and time the ImmutabilityPolicy was - updated. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who updated the - ImmutabilityPolicy. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who updated the ImmutabilityPolicy. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who updated the - ImmutabilityPolicy. - :vartype upn: str - """ - - _validation = { - 'update': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'update': {'key': 'update', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UpdateHistoryProperty, self).__init__(**kwargs) - self.update = None - self.immutability_period_since_creation_in_days = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage.py deleted file mode 100644 index 3429b6dc781f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2018_11_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2018_11_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs): - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage_name.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage_name.py deleted file mode 100644 index e4082bf52384..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage_name.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage_name_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage_name_py3.py deleted file mode 100644 index f519bb5072b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage_name_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage_paged.py deleted file mode 100644 index 45e4f67523b2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 UsagePaged(Paged): - """ - A paging container for iterating over a list of :class:`Usage ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Usage]'} - } - - def __init__(self, *args, **kwargs): - - super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage_py3.py deleted file mode 100644 index 3bf024d50d74..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/usage_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2018_11_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2018_11_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs) -> None: - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/virtual_network_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/virtual_network_rule.py deleted file mode 100644 index db4d16cf06aa..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/virtual_network_rule.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_11_01.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2018_11_01.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) - self.action = kwargs.get('action', "Allow") - self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/virtual_network_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/virtual_network_rule_py3.py deleted file mode 100644 index 5d6462e88369..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2018_11_01.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2018_11_01.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = virtual_network_resource_id - self.action = action - self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/__init__.py index 2e0271d17068..7bb554454062 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/__init__.py @@ -9,13 +9,13 @@ # regenerated. # -------------------------------------------------------------------------- -from .operations import Operations -from .skus_operations import SkusOperations -from .storage_accounts_operations import StorageAccountsOperations -from .usages_operations import UsagesOperations -from .management_policies_operations import ManagementPoliciesOperations -from .blob_services_operations import BlobServicesOperations -from .blob_containers_operations import BlobContainersOperations +from ._operations import Operations +from ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._usages_operations import UsagesOperations +from ._management_policies_operations import ManagementPoliciesOperations +from ._blob_services_operations import BlobServicesOperations +from ._blob_containers_operations import BlobContainersOperations __all__ = [ 'Operations', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_containers_operations.py new file mode 100644 index 000000000000..7e97b9c40e05 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_containers_operations.py @@ -0,0 +1,1120 @@ +# 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 BlobContainersOperations(object): + """BlobContainersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-11-01". + :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01" + self.immutability_policy_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists all containers and does not support a prefix like data plane. + Also SRP today does not return continuation token. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: ListContainerItems or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.ListContainerItems or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('ListContainerItems', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} + + def create( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Creates a new container under the specified account as described by + request body. The container resource includes metadata and properties + for that container. It does not include a list of the blobs contained + by the container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_11_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('BlobContainer', response) + if response.status_code == 201: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def update( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Updates container properties as specified in request body. Properties + not mentioned in the request will be unchanged. Update fails if the + specified container doesn't already exist. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2018_11_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def get( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Gets properties of a specified container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_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: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def delete( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Deletes specified container under its account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def set_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Sets legal hold tags. Setting the same tag results in an idempotent + operation. SetLegalHold follows an append pattern and does not clear + out the existing tags that are not specified in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.set_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} + + def clear_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Clears legal hold tags. Clearing the same or non-existent tag results + in an idempotent operation. ClearLegalHold clears out only the + specified tags in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.clear_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} + + def create_or_update_immutability_policy( + self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an unlocked immutability policy. ETag in If-Match is + honored if given but not required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.create_or_update_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def get_immutability_policy( + self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): + """Gets the existing immutability policy along with the corresponding ETag + in response headers and body. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def delete_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Aborts an unlocked immutability policy. The response of delete has + immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is + required for this operation. Deleting a locked immutability policy is + not allowed, only way is to delete the container after deleting all + blobs inside the container. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def lock_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Sets the ImmutabilityPolicy to Locked state. The only action allowed on + a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is + required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lock_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} + + def extend_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): + """Extends the immutabilityPeriodSinceCreationInDays of a locked + immutabilityPolicy. The only action allowed on a Locked policy will be + this action. ETag in If-Match is required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.extend_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} + + def lease( + self, resource_group_name, account_name, container_name, parameters=None, custom_headers=None, raw=False, **operation_config): + """The Lease Container operation establishes and manages a lock on a + container for delete operations. The lock duration can be 15 to 60 + seconds, or can be infinite. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param parameters: Lease Container request body. + :type parameters: + ~azure.mgmt.storage.v2018_11_01.models.LeaseContainerRequest + :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: LeaseContainerResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.LeaseContainerResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lease.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseContainerRequest') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LeaseContainerResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_services_operations.py new file mode 100644 index 000000000000..ed341a0ad863 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_blob_services_operations.py @@ -0,0 +1,185 @@ +# 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 BlobServicesOperations(object): + """BlobServicesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-11-01". + :ivar blob_services_name: The name of the blob Service within the specified storage account. Blob Service Name must be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01" + self.blob_services_name = "default" + + self.config = config + + def set_service_properties( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """Sets the properties of a storage account’s Blob service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Blob service, + including properties for Storage Analytics and CORS (Cross-Origin + Resource Sharing) rules. + :type parameters: + ~azure.mgmt.storage.v2018_11_01.models.BlobServiceProperties + :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: BlobServiceProperties or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.set_service_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'BlobServiceProperties') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('BlobServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} + + def get_service_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of a storage account’s Blob service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: BlobServiceProperties or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_service_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('BlobServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_management_policies_operations.py new file mode 100644 index 000000000000..24e3362d2a1e --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_management_policies_operations.py @@ -0,0 +1,242 @@ +# 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 ManagementPoliciesOperations(object): + """ManagementPoliciesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-11-01". + :ivar management_policy_name: The name of the Storage Account Management Policy. It should always be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01" + self.management_policy_name = "default" + + self.config = config + + def get( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the managementpolicy associated with the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: ManagementPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('ManagementPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} + + def create_or_update( + self, resource_group_name, account_name, policy, custom_headers=None, raw=False, **operation_config): + """Sets the managementpolicy to the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param policy: The Storage Account ManagementPolicy, in JSON format. + See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: + ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicySchema + :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: ManagementPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + properties = models.ManagementPolicy(policy=policy) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(properties, 'ManagementPolicy') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ManagementPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes the managementpolicy associated with the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_operations.py new file mode 100644 index 000000000000..bc96c8b4f179 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_operations.py @@ -0,0 +1,102 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-11-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Storage 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 Operation + :rtype: + ~azure.mgmt.storage.v2018_11_01.models.OperationPaged[~azure.mgmt.storage.v2018_11_01.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_skus_operations.py new file mode 100644 index 000000000000..bdaf0bf635ca --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_skus_operations.py @@ -0,0 +1,107 @@ +# 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 SkusOperations(object): + """SkusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-11-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the available SKUs supported by Microsoft.Storage for given + 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 Sku + :rtype: + ~azure.mgmt.storage.v2018_11_01.models.SkuPaged[~azure.mgmt.storage.v2018_11_01.models.Sku] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..636c033b05dd --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_storage_accounts_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 StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-11-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01" + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: The storage account name. + :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_11_01.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) + + # 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', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2018_11_01.models.StorageAccountCreateParameters + :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 StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2018_11_01.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2018_11_01.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param expand: May be used to expand the properties within account's + properties. By default, data is not included when fetching properties. + Currently we only support geoReplicationStats. Possible values + include: 'geoReplicationStats' + :type expand: str or + ~azure.mgmt.storage.v2018_11_01.models.StorageAccountExpand + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'StorageAccountExpand') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2018_11_01.models.StorageAccountUpdateParameters + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2018_11_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_11_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2018_11_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_11_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_11_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: The name of storage keys that want to be regenerated, + possible values are key1, key2. + :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2018_11_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} + + def list_account_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials + for the storage account. + :type parameters: + ~azure.mgmt.storage.v2018_11_01.models.AccountSasParameters + :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: ListAccountSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.ListAccountSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_account_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'AccountSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListAccountSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} + + def list_service_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS + credentials. + :type parameters: + ~azure.mgmt.storage.v2018_11_01.models.ServiceSasParameters + :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: ListServiceSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2018_11_01.models.ListServiceSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_service_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'ServiceSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListServiceSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} + + + def _failover_initial( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.failover.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, 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 failover( + self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Failover request can be triggered for a storage account in case of + availability issues. The failover occurs from the storage account's + primary cluster to secondary cluster for RA-GRS accounts. The secondary + cluster will become primary after failover. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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._failover_initial( + resource_group_name=resource_group_name, + account_name=account_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, lro_options={'final-state-via': 'location'}, **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) + failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} + + def revoke_user_delegation_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Revoke user delegation keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.revoke_user_delegation_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + revoke_user_delegation_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_usages_operations.py new file mode 100644 index 000000000000..75e671560583 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_usages_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class UsagesOperations(object): + """UsagesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2018-11-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01" + + self.config = config + + def list_by_location( + self, location, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources of the + location under the subscription. + + :param location: The location of the Azure Storage resource. + :type location: 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 Usage + :rtype: + ~azure.mgmt.storage.v2018_11_01.models.UsagePaged[~azure.mgmt.storage.v2018_11_01.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, '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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/blob_containers_operations.py deleted file mode 100644 index 3131f31863a2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/blob_containers_operations.py +++ /dev/null @@ -1,1130 +0,0 @@ -# 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 BlobContainersOperations(object): - """BlobContainersOperations 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 API version to use for this operation. Constant value: "2018-11-01". - :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01" - self.immutability_policy_name = "default" - - self.config = config - - def list( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists all containers and does not support a prefix like data plane. - Also SRP today does not return continuation token. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: ListContainerItems or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.ListContainerItems or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('ListContainerItems', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} - - def create( - self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): - """Creates a new container under the specified account as described by - request body. The container resource includes metadata and properties - for that container. It does not include a list of the blobs contained - by the container. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_11_01.models.PublicAccess - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: 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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobContainer or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) - - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(blob_container, 'BlobContainer') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('BlobContainer', response) - if response.status_code == 201: - deserialized = self._deserialize('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def update( - self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): - """Updates container properties as specified in request body. Properties - not mentioned in the request will be unchanged. Update fails if the - specified container doesn't already exist. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2018_11_01.models.PublicAccess - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: 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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobContainer or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(blob_container, 'BlobContainer') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def get( - self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): - """Gets properties of a specified container. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_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: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobContainer or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def delete( - self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): - """Deletes specified container under its account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def set_legal_hold( - self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): - """Sets legal hold tags. Setting the same tag results in an idempotent - operation. SetLegalHold follows an append pattern and does not clear - out the existing tags that are not specified in the request. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param tags: Each tag should be 3 to 23 alphanumeric characters and is - normalized to lower case at SRP. - :type tags: list[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: LegalHold or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.LegalHold or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - legal_hold = models.LegalHold(tags=tags) - - # Construct URL - url = self.set_legal_hold.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(legal_hold, 'LegalHold') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LegalHold', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} - - def clear_legal_hold( - self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): - """Clears legal hold tags. Clearing the same or non-existent tag results - in an idempotent operation. ClearLegalHold clears out only the - specified tags in the request. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param tags: Each tag should be 3 to 23 alphanumeric characters and is - normalized to lower case at SRP. - :type tags: list[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: LegalHold or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.LegalHold or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - legal_hold = models.LegalHold(tags=tags) - - # Construct URL - url = self.clear_legal_hold.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(legal_hold, 'LegalHold') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LegalHold', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} - - def create_or_update_immutability_policy( - self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates an unlocked immutability policy. ETag in If-Match is - honored if given but not required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param immutability_period_since_creation_in_days: The immutability - period for the blobs in the container since the policy creation, in - days. - :type immutability_period_since_creation_in_days: int - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = None - if immutability_period_since_creation_in_days is not None: - parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) - - # Construct URL - url = self.create_or_update_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') - else: - body_content = None - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def get_immutability_policy( - self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): - """Gets the existing immutability policy along with the corresponding ETag - in response headers and body. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def delete_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): - """Aborts an unlocked immutability policy. The response of delete has - immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is - required for this operation. Deleting a locked immutability policy is - not allowed, only way is to delete the container after deleting all - blobs inside the container. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def lock_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): - """Sets the ImmutabilityPolicy to Locked state. The only action allowed on - a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is - required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.lock_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} - - def extend_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): - """Extends the immutabilityPeriodSinceCreationInDays of a locked - immutabilityPolicy. The only action allowed on a Locked policy will be - this action. ETag in If-Match is required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: str - :param immutability_period_since_creation_in_days: The immutability - period for the blobs in the container since the policy creation, in - days. - :type immutability_period_since_creation_in_days: int - :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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = None - if immutability_period_since_creation_in_days is not None: - parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) - - # Construct URL - url = self.extend_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} - - def lease( - self, resource_group_name, account_name, container_name, parameters=None, custom_headers=None, raw=False, **operation_config): - """The Lease Container operation establishes and manages a lock on a - container for delete operations. The lock duration can be 15 to 60 - seconds, or can be infinite. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param parameters: Lease Container request body. - :type parameters: - ~azure.mgmt.storage.v2018_11_01.models.LeaseContainerRequest - :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: LeaseContainerResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.LeaseContainerResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.lease.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'LeaseContainerRequest') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LeaseContainerResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/blob_services_operations.py deleted file mode 100644 index 5a0c8a1ff6fd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/blob_services_operations.py +++ /dev/null @@ -1,185 +0,0 @@ -# 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 BlobServicesOperations(object): - """BlobServicesOperations 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 API version to use for this operation. Constant value: "2018-11-01". - :ivar blob_services_name: The name of the blob Service within the specified storage account. Blob Service Name must be 'default'. Constant value: "default". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01" - self.blob_services_name = "default" - - self.config = config - - def set_service_properties( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """Sets the properties of a storage account’s Blob service, including - properties for Storage Analytics and CORS (Cross-Origin Resource - Sharing) rules. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The properties of a storage account’s Blob service, - including properties for Storage Analytics and CORS (Cross-Origin - Resource Sharing) rules. - :type parameters: - ~azure.mgmt.storage.v2018_11_01.models.BlobServiceProperties - :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: BlobServiceProperties or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobServiceProperties - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.set_service_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'BlobServiceProperties') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('BlobServiceProperties', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} - - def get_service_properties( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Gets the properties of a storage account’s Blob service, including - properties for Storage Analytics and CORS (Cross-Origin Resource - Sharing) rules. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: BlobServiceProperties or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.BlobServiceProperties - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_service_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('BlobServiceProperties', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/management_policies_operations.py deleted file mode 100644 index 4749ecebf2d7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/management_policies_operations.py +++ /dev/null @@ -1,242 +0,0 @@ -# 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 ManagementPoliciesOperations(object): - """ManagementPoliciesOperations 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 API version to use for this operation. Constant value: "2018-11-01". - :ivar management_policy_name: The name of the Storage Account Management Policy. It should always be 'default'. Constant value: "default". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01" - self.management_policy_name = "default" - - self.config = config - - def get( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Gets the managementpolicy associated with the specified storage - account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: ManagementPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('ManagementPolicy', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} - - def create_or_update( - self, resource_group_name, account_name, policy, custom_headers=None, raw=False, **operation_config): - """Sets the managementpolicy to the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param policy: The Storage Account ManagementPolicy, in JSON format. - See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: - ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicySchema - :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: ManagementPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.ManagementPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - properties = models.ManagementPolicy(policy=policy) - - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(properties, 'ManagementPolicy') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ManagementPolicy', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes the managementpolicy associated with the specified storage - account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/operations.py deleted file mode 100644 index 0418320b9a2a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/operations.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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 API version to use for this operation. Constant value: "2018-11-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available Storage 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 Operation - :rtype: - ~azure.mgmt.storage.v2018_11_01.models.OperationPaged[~azure.mgmt.storage.v2018_11_01.models.Operation] - :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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.OperationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/skus_operations.py deleted file mode 100644 index a7d71da55fdc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/skus_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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 SkusOperations(object): - """SkusOperations 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 API version to use for this operation. Constant value: "2018-11-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists the available SKUs supported by Microsoft.Storage for given - 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 Sku - :rtype: - ~azure.mgmt.storage.v2018_11_01.models.SkuPaged[~azure.mgmt.storage.v2018_11_01.models.Sku] - :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', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.SkuPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/storage_accounts_operations.py deleted file mode 100644 index f33b8da9f839..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/storage_accounts_operations.py +++ /dev/null @@ -1,991 +0,0 @@ -# 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 StorageAccountsOperations(object): - """StorageAccountsOperations 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 API version to use for this operation. Constant value: "2018-11-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01" - - self.config = config - - def check_name_availability( - self, name, custom_headers=None, raw=False, **operation_config): - """Checks that the storage account name is valid and is not already in - use. - - :param name: The storage account name. - :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_11_01.models.CheckNameAvailabilityResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) - - # 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', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('CheckNameAvailabilityResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} - - - def _create_initial( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountCreateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Asynchronously creates a new storage account with the specified - parameters. If an account is already created and a subsequent create - request is issued with different properties, the account properties - will be updated. If an account is already created and a subsequent - create or update request is issued with the exact same set of - properties, the request will succeed. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the created account. - :type parameters: - ~azure.mgmt.storage.v2018_11_01.models.StorageAccountCreateParameters - :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 StorageAccount or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2018_11_01.models.StorageAccount] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2018_11_01.models.StorageAccount]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes a storage account in Microsoft Azure. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def get_properties( - self, resource_group_name, account_name, expand=None, custom_headers=None, raw=False, **operation_config): - """Returns the properties for the specified storage account including but - not limited to name, SKU name, location, and account status. The - ListKeys operation should be used to retrieve storage keys. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param expand: May be used to expand the properties within account's - properties. By default, data is not included when fetching properties. - Currently we only support geoReplicationStats. Possible values - include: 'geoReplicationStats' - :type expand: str or - ~azure.mgmt.storage.v2018_11_01.models.StorageAccountExpand - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'StorageAccountExpand') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def update( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """The update operation can be used to update the SKU, encryption, access - tier, or tags for a storage account. It can also be used to map the - account to a custom domain. Only one custom domain is supported per - storage account; the replacement/change of custom domain is not - supported. In order to replace an old custom domain, the old value must - be cleared/unregistered before a new value can be set. The update of - multiple properties is supported. This call does not change the storage - keys for the account. If you want to change the storage account keys, - use the regenerate keys operation. The location and name of the storage - account cannot be changed after creation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the updated account. - :type parameters: - ~azure.mgmt.storage.v2018_11_01.models.StorageAccountUpdateParameters - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the subscription. Note - that storage keys are not returned; use the ListKeys operation for - this. - - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2018_11_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_11_01.models.StorageAccount] - :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', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the given resource - group. Note that storage keys are not returned; use the ListKeys - operation for this. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2018_11_01.models.StorageAccountPaged[~azure.mgmt.storage.v2018_11_01.models.StorageAccount] - :raises: :class:`CloudError` - """ - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(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.Storage/storageAccounts'} - - def list_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_11_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} - - def regenerate_key( - self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerates one of the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param key_name: The name of storage keys that want to be regenerated, - possible values are key1, key2. - :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2018_11_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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_key1, 'StorageAccountRegenerateKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} - - def list_account_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List SAS credentials of a storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list SAS credentials - for the storage account. - :type parameters: - ~azure.mgmt.storage.v2018_11_01.models.AccountSasParameters - :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: ListAccountSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.ListAccountSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_account_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'AccountSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListAccountSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} - - def list_service_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List service SAS credentials of a specific resource. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list service SAS - credentials. - :type parameters: - ~azure.mgmt.storage.v2018_11_01.models.ServiceSasParameters - :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: ListServiceSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2018_11_01.models.ListServiceSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_service_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'ServiceSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListServiceSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} - - - def _failover_initial( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.failover.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, 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 failover( - self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Failover request can be triggered for a storage account in case of - availability issues. The failover occurs from the storage account's - primary cluster to secondary cluster for RA-GRS accounts. The secondary - cluster will become primary after failover. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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._failover_initial( - resource_group_name=resource_group_name, - account_name=account_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, lro_options={'final-state-via': 'location'}, **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) - failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} - - def revoke_user_delegation_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Revoke user delegation keys. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.revoke_user_delegation_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, 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 - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - revoke_user_delegation_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/usages_operations.py deleted file mode 100644 index a3c8ba22dbcd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/usages_operations.py +++ /dev/null @@ -1,106 +0,0 @@ -# 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 UsagesOperations(object): - """UsagesOperations 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 API version to use for this operation. Constant value: "2018-11-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2018-11-01" - - self.config = config - - def list_by_location( - self, location, custom_headers=None, raw=False, **operation_config): - """Gets the current usage count and the limit for the resources of the - location under the subscription. - - :param location: The location of the Azure Storage resource. - :type location: 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 Usage - :rtype: - ~azure.mgmt.storage.v2018_11_01.models.UsagePaged[~azure.mgmt.storage.v2018_11_01.models.Usage] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_location.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, '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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.UsagePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/storage_management_client.py deleted file mode 100644 index aadbfd8ad6c3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/storage_management_client.py +++ /dev/null @@ -1,111 +0,0 @@ -# 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.operations import Operations -from .operations.skus_operations import SkusOperations -from .operations.storage_accounts_operations import StorageAccountsOperations -from .operations.usages_operations import UsagesOperations -from .operations.management_policies_operations import ManagementPoliciesOperations -from .operations.blob_services_operations import BlobServicesOperations -from .operations.blob_containers_operations import BlobContainersOperations -from . import models - - -class StorageManagementClientConfiguration(AzureConfiguration): - """Configuration for StorageManagementClient - 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 ID of the target subscription. - :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(StorageManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class StorageManagementClient(SDKClient): - """The Azure Storage Management API. - - :ivar config: Configuration for client. - :vartype config: StorageManagementClientConfiguration - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.storage.v2018_11_01.operations.Operations - :ivar skus: Skus operations - :vartype skus: azure.mgmt.storage.v2018_11_01.operations.SkusOperations - :ivar storage_accounts: StorageAccounts operations - :vartype storage_accounts: azure.mgmt.storage.v2018_11_01.operations.StorageAccountsOperations - :ivar usages: Usages operations - :vartype usages: azure.mgmt.storage.v2018_11_01.operations.UsagesOperations - :ivar management_policies: ManagementPolicies operations - :vartype management_policies: azure.mgmt.storage.v2018_11_01.operations.ManagementPoliciesOperations - :ivar blob_services: BlobServices operations - :vartype blob_services: azure.mgmt.storage.v2018_11_01.operations.BlobServicesOperations - :ivar blob_containers: BlobContainers operations - :vartype blob_containers: azure.mgmt.storage.v2018_11_01.operations.BlobContainersOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - super(StorageManagementClient, self).__init__(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-11-01' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.skus = SkusOperations( - self._client, self.config, self._serialize, self._deserialize) - self.storage_accounts = StorageAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.usages = UsagesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.management_policies = ManagementPoliciesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.blob_services = BlobServicesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.blob_containers = BlobContainersOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/__init__.py index 0854715e0c10..da2c3f969e67 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .storage_management_client import StorageManagementClient -from .version import VERSION +from ._configuration import StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] -__all__ = ['StorageManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_configuration.py new file mode 100644 index 000000000000..57fa5132dc82 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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 ID of the target subscription. + :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(StorageManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_storage_management_client.py new file mode 100644 index 000000000000..94c3a1b0bdea --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_storage_management_client.py @@ -0,0 +1,79 @@ +# 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 ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import UsagesOperations +from .operations import ManagementPoliciesOperations +from .operations import BlobServicesOperations +from .operations import BlobContainersOperations +from . import models + + +class StorageManagementClient(SDKClient): + """The Azure Storage Management API. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2019_04_01.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2019_04_01.operations.SkusOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2019_04_01.operations.StorageAccountsOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.storage.v2019_04_01.operations.UsagesOperations + :ivar management_policies: ManagementPolicies operations + :vartype management_policies: azure.mgmt.storage.v2019_04_01.operations.ManagementPoliciesOperations + :ivar blob_services: BlobServices operations + :vartype blob_services: azure.mgmt.storage.v2019_04_01.operations.BlobServicesOperations + :ivar blob_containers: BlobContainers operations + :vartype blob_containers: azure.mgmt.storage.v2019_04_01.operations.BlobContainersOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, 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 = '2019-04-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.management_policies = ManagementPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_services = BlobServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py index 1e5d1a426aaf..68d5bcd5f9a7 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py @@ -10,136 +10,137 @@ # -------------------------------------------------------------------------- try: - from .operation_display_py3 import OperationDisplay - from .dimension_py3 import Dimension - from .metric_specification_py3 import MetricSpecification - from .service_specification_py3 import ServiceSpecification - from .operation_py3 import Operation - from .storage_account_check_name_availability_parameters_py3 import StorageAccountCheckNameAvailabilityParameters - from .sku_capability_py3 import SKUCapability - from .restriction_py3 import Restriction - from .sku_py3 import Sku - from .check_name_availability_result_py3 import CheckNameAvailabilityResult - from .custom_domain_py3 import CustomDomain - from .encryption_service_py3 import EncryptionService - from .encryption_services_py3 import EncryptionServices - from .key_vault_properties_py3 import KeyVaultProperties - from .encryption_py3 import Encryption - from .virtual_network_rule_py3 import VirtualNetworkRule - from .ip_rule_py3 import IPRule - from .network_rule_set_py3 import NetworkRuleSet - from .identity_py3 import Identity - from .storage_account_create_parameters_py3 import StorageAccountCreateParameters - from .endpoints_py3 import Endpoints - from .geo_replication_stats_py3 import GeoReplicationStats - from .storage_account_py3 import StorageAccount - from .storage_account_key_py3 import StorageAccountKey - from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters_py3 import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters - from .usage_name_py3 import UsageName - from .usage_py3 import Usage - from .account_sas_parameters_py3 import AccountSasParameters - from .list_account_sas_response_py3 import ListAccountSasResponse - from .service_sas_parameters_py3 import ServiceSasParameters - from .list_service_sas_response_py3 import ListServiceSasResponse - from .date_after_modification_py3 import DateAfterModification - from .management_policy_base_blob_py3 import ManagementPolicyBaseBlob - from .date_after_creation_py3 import DateAfterCreation - from .management_policy_snap_shot_py3 import ManagementPolicySnapShot - from .management_policy_action_py3 import ManagementPolicyAction - from .management_policy_filter_py3 import ManagementPolicyFilter - from .management_policy_definition_py3 import ManagementPolicyDefinition - from .management_policy_rule_py3 import ManagementPolicyRule - from .management_policy_schema_py3 import ManagementPolicySchema - from .management_policy_py3 import ManagementPolicy - from .proxy_resource_py3 import ProxyResource - from .tracked_resource_py3 import TrackedResource - from .azure_entity_resource_py3 import AzureEntityResource - from .resource_py3 import Resource - from .update_history_property_py3 import UpdateHistoryProperty - from .immutability_policy_properties_py3 import ImmutabilityPolicyProperties - from .tag_property_py3 import TagProperty - from .legal_hold_properties_py3 import LegalHoldProperties - from .blob_container_py3 import BlobContainer - from .immutability_policy_py3 import ImmutabilityPolicy - from .legal_hold_py3 import LegalHold - from .list_container_item_py3 import ListContainerItem - from .list_container_items_py3 import ListContainerItems - from .cors_rule_py3 import CorsRule - from .cors_rules_py3 import CorsRules - from .delete_retention_policy_py3 import DeleteRetentionPolicy - from .blob_service_properties_py3 import BlobServiceProperties - from .lease_container_request_py3 import LeaseContainerRequest - from .lease_container_response_py3 import LeaseContainerResponse + from ._models_py3 import AccountSasParameters + from ._models_py3 import AzureEntityResource + from ._models_py3 import AzureFilesIdentityBasedAuthentication + from ._models_py3 import BlobContainer + from ._models_py3 import BlobServiceProperties + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CorsRule + from ._models_py3 import CorsRules + from ._models_py3 import CustomDomain + from ._models_py3 import DateAfterCreation + from ._models_py3 import DateAfterModification + from ._models_py3 import DeleteRetentionPolicy + from ._models_py3 import Dimension + from ._models_py3 import Encryption + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import GeoReplicationStats + from ._models_py3 import Identity + from ._models_py3 import ImmutabilityPolicy + from ._models_py3 import ImmutabilityPolicyProperties + from ._models_py3 import IPRule + from ._models_py3 import KeyVaultProperties + from ._models_py3 import LeaseContainerRequest + from ._models_py3 import LeaseContainerResponse + from ._models_py3 import LegalHold + from ._models_py3 import LegalHoldProperties + from ._models_py3 import ListAccountSasResponse + from ._models_py3 import ListContainerItem + from ._models_py3 import ListServiceSasResponse + from ._models_py3 import ManagementPolicy + from ._models_py3 import ManagementPolicyAction + from ._models_py3 import ManagementPolicyBaseBlob + from ._models_py3 import ManagementPolicyDefinition + from ._models_py3 import ManagementPolicyFilter + from ._models_py3 import ManagementPolicyRule + from ._models_py3 import ManagementPolicySchema + from ._models_py3 import ManagementPolicySnapShot + from ._models_py3 import MetricSpecification + from ._models_py3 import NetworkRuleSet + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import Restriction + from ._models_py3 import ServiceSasParameters + from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SKUCapability + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import TagProperty + from ._models_py3 import TrackedResource + from ._models_py3 import UpdateHistoryProperty + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import VirtualNetworkRule except (SyntaxError, ImportError): - from .operation_display import OperationDisplay - from .dimension import Dimension - from .metric_specification import MetricSpecification - from .service_specification import ServiceSpecification - from .operation import Operation - from .storage_account_check_name_availability_parameters import StorageAccountCheckNameAvailabilityParameters - from .sku_capability import SKUCapability - from .restriction import Restriction - from .sku import Sku - from .check_name_availability_result import CheckNameAvailabilityResult - from .custom_domain import CustomDomain - from .encryption_service import EncryptionService - from .encryption_services import EncryptionServices - from .key_vault_properties import KeyVaultProperties - from .encryption import Encryption - from .virtual_network_rule import VirtualNetworkRule - from .ip_rule import IPRule - from .network_rule_set import NetworkRuleSet - from .identity import Identity - from .storage_account_create_parameters import StorageAccountCreateParameters - from .endpoints import Endpoints - from .geo_replication_stats import GeoReplicationStats - from .storage_account import StorageAccount - from .storage_account_key import StorageAccountKey - from .storage_account_list_keys_result import StorageAccountListKeysResult - from .storage_account_regenerate_key_parameters import StorageAccountRegenerateKeyParameters - from .storage_account_update_parameters import StorageAccountUpdateParameters - from .usage_name import UsageName - from .usage import Usage - from .account_sas_parameters import AccountSasParameters - from .list_account_sas_response import ListAccountSasResponse - from .service_sas_parameters import ServiceSasParameters - from .list_service_sas_response import ListServiceSasResponse - from .date_after_modification import DateAfterModification - from .management_policy_base_blob import ManagementPolicyBaseBlob - from .date_after_creation import DateAfterCreation - from .management_policy_snap_shot import ManagementPolicySnapShot - from .management_policy_action import ManagementPolicyAction - from .management_policy_filter import ManagementPolicyFilter - from .management_policy_definition import ManagementPolicyDefinition - from .management_policy_rule import ManagementPolicyRule - from .management_policy_schema import ManagementPolicySchema - from .management_policy import ManagementPolicy - from .proxy_resource import ProxyResource - from .tracked_resource import TrackedResource - from .azure_entity_resource import AzureEntityResource - from .resource import Resource - from .update_history_property import UpdateHistoryProperty - from .immutability_policy_properties import ImmutabilityPolicyProperties - from .tag_property import TagProperty - from .legal_hold_properties import LegalHoldProperties - from .blob_container import BlobContainer - from .immutability_policy import ImmutabilityPolicy - from .legal_hold import LegalHold - from .list_container_item import ListContainerItem - from .list_container_items import ListContainerItems - from .cors_rule import CorsRule - from .cors_rules import CorsRules - from .delete_retention_policy import DeleteRetentionPolicy - from .blob_service_properties import BlobServiceProperties - from .lease_container_request import LeaseContainerRequest - from .lease_container_response import LeaseContainerResponse -from .operation_paged import OperationPaged -from .sku_paged import SkuPaged -from .storage_account_paged import StorageAccountPaged -from .usage_paged import UsagePaged -from .storage_management_client_enums import ( + from ._models import AccountSasParameters + from ._models import AzureEntityResource + from ._models import AzureFilesIdentityBasedAuthentication + from ._models import BlobContainer + from ._models import BlobServiceProperties + from ._models import CheckNameAvailabilityResult + from ._models import CorsRule + from ._models import CorsRules + from ._models import CustomDomain + from ._models import DateAfterCreation + from ._models import DateAfterModification + from ._models import DeleteRetentionPolicy + from ._models import Dimension + from ._models import Encryption + from ._models import EncryptionService + from ._models import EncryptionServices + from ._models import Endpoints + from ._models import GeoReplicationStats + from ._models import Identity + from ._models import ImmutabilityPolicy + from ._models import ImmutabilityPolicyProperties + from ._models import IPRule + from ._models import KeyVaultProperties + from ._models import LeaseContainerRequest + from ._models import LeaseContainerResponse + from ._models import LegalHold + from ._models import LegalHoldProperties + from ._models import ListAccountSasResponse + from ._models import ListContainerItem + from ._models import ListServiceSasResponse + from ._models import ManagementPolicy + from ._models import ManagementPolicyAction + from ._models import ManagementPolicyBaseBlob + from ._models import ManagementPolicyDefinition + from ._models import ManagementPolicyFilter + from ._models import ManagementPolicyRule + from ._models import ManagementPolicySchema + from ._models import ManagementPolicySnapShot + from ._models import MetricSpecification + from ._models import NetworkRuleSet + from ._models import Operation + from ._models import OperationDisplay + from ._models import ProxyResource + from ._models import Resource + from ._models import Restriction + from ._models import ServiceSasParameters + from ._models import ServiceSpecification + from ._models import Sku + from ._models import SKUCapability + from ._models import StorageAccount + from ._models import StorageAccountCheckNameAvailabilityParameters + from ._models import StorageAccountCreateParameters + from ._models import StorageAccountKey + from ._models import StorageAccountListKeysResult + from ._models import StorageAccountRegenerateKeyParameters + from ._models import StorageAccountUpdateParameters + from ._models import TagProperty + from ._models import TrackedResource + from ._models import UpdateHistoryProperty + from ._models import Usage + from ._models import UsageName + from ._models import VirtualNetworkRule +from ._paged_models import ListContainerItemPaged +from ._paged_models import OperationPaged +from ._paged_models import SkuPaged +from ._paged_models import StorageAccountPaged +from ._paged_models import UsagePaged +from ._storage_management_client_enums import ( ReasonCode, SkuName, SkuTier, @@ -150,6 +151,7 @@ State, Bypass, DefaultAction, + DirectoryServiceOptions, AccessTier, GeoReplicationStatus, ProvisioningState, @@ -171,72 +173,73 @@ ) __all__ = [ - 'OperationDisplay', - 'Dimension', - 'MetricSpecification', - 'ServiceSpecification', - 'Operation', - 'StorageAccountCheckNameAvailabilityParameters', - 'SKUCapability', - 'Restriction', - 'Sku', + 'AccountSasParameters', + 'AzureEntityResource', + 'AzureFilesIdentityBasedAuthentication', + 'BlobContainer', + 'BlobServiceProperties', 'CheckNameAvailabilityResult', + 'CorsRule', + 'CorsRules', 'CustomDomain', + 'DateAfterCreation', + 'DateAfterModification', + 'DeleteRetentionPolicy', + 'Dimension', + 'Encryption', 'EncryptionService', 'EncryptionServices', - 'KeyVaultProperties', - 'Encryption', - 'VirtualNetworkRule', - 'IPRule', - 'NetworkRuleSet', - 'Identity', - 'StorageAccountCreateParameters', 'Endpoints', 'GeoReplicationStats', - 'StorageAccount', - 'StorageAccountKey', - 'StorageAccountListKeysResult', - 'StorageAccountRegenerateKeyParameters', - 'StorageAccountUpdateParameters', - 'UsageName', - 'Usage', - 'AccountSasParameters', + 'Identity', + 'ImmutabilityPolicy', + 'ImmutabilityPolicyProperties', + 'IPRule', + 'KeyVaultProperties', + 'LeaseContainerRequest', + 'LeaseContainerResponse', + 'LegalHold', + 'LegalHoldProperties', 'ListAccountSasResponse', - 'ServiceSasParameters', + 'ListContainerItem', 'ListServiceSasResponse', - 'DateAfterModification', - 'ManagementPolicyBaseBlob', - 'DateAfterCreation', - 'ManagementPolicySnapShot', + 'ManagementPolicy', 'ManagementPolicyAction', - 'ManagementPolicyFilter', + 'ManagementPolicyBaseBlob', 'ManagementPolicyDefinition', + 'ManagementPolicyFilter', 'ManagementPolicyRule', 'ManagementPolicySchema', - 'ManagementPolicy', + 'ManagementPolicySnapShot', + 'MetricSpecification', + 'NetworkRuleSet', + 'Operation', + 'OperationDisplay', 'ProxyResource', - 'TrackedResource', - 'AzureEntityResource', 'Resource', - 'UpdateHistoryProperty', - 'ImmutabilityPolicyProperties', + 'Restriction', + 'ServiceSasParameters', + 'ServiceSpecification', + 'Sku', + 'SKUCapability', + 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', + 'StorageAccountKey', + 'StorageAccountListKeysResult', + 'StorageAccountRegenerateKeyParameters', + 'StorageAccountUpdateParameters', 'TagProperty', - 'LegalHoldProperties', - 'BlobContainer', - 'ImmutabilityPolicy', - 'LegalHold', - 'ListContainerItem', - 'ListContainerItems', - 'CorsRule', - 'CorsRules', - 'DeleteRetentionPolicy', - 'BlobServiceProperties', - 'LeaseContainerRequest', - 'LeaseContainerResponse', + 'TrackedResource', + 'UpdateHistoryProperty', + 'Usage', + 'UsageName', + 'VirtualNetworkRule', 'OperationPaged', 'SkuPaged', 'StorageAccountPaged', 'UsagePaged', + 'ListContainerItemPaged', 'ReasonCode', 'SkuName', 'SkuTier', @@ -247,6 +250,7 @@ 'State', 'Bypass', 'DefaultAction', + 'DirectoryServiceOptions', 'AccessTier', 'GeoReplicationStatus', 'ProvisioningState', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py new file mode 100644 index 000000000000..8861ef04f4fe --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py @@ -0,0 +1,2650 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2019_04_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2019_04_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2019_04_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2019_04_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class AzureFilesIdentityBasedAuthentication(Model): + """Settings for Azure Files identity based authentication. + + All required parameters must be populated in order to send to Azure. + + :param directory_service_options: Required. Indicates the directory + service used. Possible values include: 'None', 'AADDS' + :type directory_service_options: str or + ~azure.mgmt.storage.v2019_04_01.models.DirectoryServiceOptions + """ + + _validation = { + 'directory_service_options': {'required': True}, + } + + _attribute_map = { + 'directory_service_options': {'key': 'directoryServiceOptions', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureFilesIdentityBasedAuthentication, self).__init__(**kwargs) + self.directory_service_options = kwargs.get('directory_service_options', None) + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2019_04_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2019_04_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2019_04_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2019_04_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2019_04_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BlobContainer, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param cors: Specifies CORS rules for the Blob service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2019_04_01.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the + default version to use for requests to the Blob service if an incoming + request’s version is not specified. Possible values include version + 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for soft + delete. + :type delete_retention_policy: + ~azure.mgmt.storage.v2019_04_01.models.DeleteRetentionPolicy + :param automatic_snapshot_policy_enabled: Automatic Snapshot is enabled if + set to true. + :type automatic_snapshot_policy_enabled: bool + """ + + _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'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BlobServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + self.default_service_version = kwargs.get('default_service_version', None) + self.delete_retention_policy = kwargs.get('delete_retention_policy', None) + self.automatic_snapshot_policy_enabled = kwargs.get('automatic_snapshot_policy_enabled', None) + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2019_04_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CorsRule(Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. + A list of origin domains that will be allowed via CORS, or "*" to allow + all domains + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. + A list of HTTP methods that are allowed to be executed by the origin. + :type allowed_methods: list[str] + :param max_age_in_seconds: Required. Required if CorsRule element is + present. The number of seconds that the client/browser should cache a + preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. + A list of response headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. + A list of headers allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = kwargs.get('allowed_origins', None) + self.allowed_methods = kwargs.get('allowed_methods', None) + self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None) + self.exposed_headers = kwargs.get('exposed_headers', None) + self.allowed_headers = kwargs.get('allowed_headers', None) + + +class CorsRules(Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the + request. . + + :param cors_rules: The List of CORS rules. You can include up to five + CorsRule elements in the request. + :type cors_rules: list[~azure.mgmt.storage.v2019_04_01.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__(self, **kwargs): + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = kwargs.get('cors_rules', None) + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class DateAfterCreation(Model): + """Object to define the number of days after creation. + + All required parameters must be populated in order to send to Azure. + + :param days_after_creation_greater_than: Required. Integer value + indicating the age in days after creation + :type days_after_creation_greater_than: int + """ + + _validation = { + 'days_after_creation_greater_than': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(DateAfterCreation, self).__init__(**kwargs) + self.days_after_creation_greater_than = kwargs.get('days_after_creation_greater_than', None) + + +class DateAfterModification(Model): + """Object to define the number of days after last modification. + + All required parameters must be populated in order to send to Azure. + + :param days_after_modification_greater_than: Required. Integer value + indicating the age in days after last modification + :type days_after_modification_greater_than: int + """ + + _validation = { + 'days_after_modification_greater_than': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(DateAfterModification, self).__init__(**kwargs) + self.days_after_modification_greater_than = kwargs.get('days_after_modification_greater_than', None) + + +class DeleteRetentionPolicy(Model): + """The blob service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled for the + Blob service. + :type enabled: bool + :param days: Indicates the number of days that the deleted blob should be + retained. The minimum specified value can be 1 and the maximum value can + be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.days = kwargs.get('days', None) + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2019_04_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2019_04_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2019_04_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class GeoReplicationStats(Model): + """Statistics related to replication for storage account's Blob, Table, Queue + and File services. It is only available when geo-redundant replication is + enabled for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of the secondary location. Possible values are: - + Live: Indicates that the secondary location is active and operational. - + Bootstrap: Indicates initial synchronization from the primary location to + the secondary location is in progress.This typically occurs when + replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: 'Live', + 'Bootstrap', 'Unavailable' + :vartype status: str or + ~azure.mgmt.storage.v2019_04_01.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time + value are guaranteed to be available for read operations. Primary writes + following this point in time may or may not be available for reads. + Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: datetime + :ivar can_failover: A boolean flag which indicates whether or not account + failover is supported for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + 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 immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2019_04_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.etag = None + self.update_history = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2019_04_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2019_04_01.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = kwargs.get('action', None) + self.lease_id = kwargs.get('lease_id', None) + self.break_period = kwargs.get('break_period', None) + self.lease_duration = kwargs.get('lease_duration', None) + self.proposed_lease_id = kwargs.get('proposed_lease_id', None) + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = kwargs.get('lease_id', None) + self.lease_time_seconds = kwargs.get('lease_time_seconds', None) + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + 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 has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2019_04_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, **kwargs): + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2019_04_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2019_04_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2019_04_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2019_04_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2019_04_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ManagementPolicy(Resource): + """The Get Storage Account ManagementPolicies operation response. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + :param policy: Required. The Storage Account ManagementPolicy, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'policy': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicy, self).__init__(**kwargs) + self.last_modified_time = None + self.policy = kwargs.get('policy', None) + + +class ManagementPolicyAction(Model): + """Actions are applied to the filtered blobs when the execution condition is + met. + + :param base_blob: The management policy action for base blob + :type base_blob: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyBaseBlob + :param snapshot: The management policy action for snapshot + :type snapshot: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicySnapShot + """ + + _attribute_map = { + 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, + 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyAction, self).__init__(**kwargs) + self.base_blob = kwargs.get('base_blob', None) + self.snapshot = kwargs.get('snapshot', None) + + +class ManagementPolicyBaseBlob(Model): + """Management policy action for base blob. + + :param tier_to_cool: The function to tier blobs to cool storage. Support + blobs currently at Hot tier + :type tier_to_cool: + ~azure.mgmt.storage.v2019_04_01.models.DateAfterModification + :param tier_to_archive: The function to tier blobs to archive storage. + Support blobs currently at Hot or Cool tier + :type tier_to_archive: + ~azure.mgmt.storage.v2019_04_01.models.DateAfterModification + :param delete: The function to delete the blob + :type delete: ~azure.mgmt.storage.v2019_04_01.models.DateAfterModification + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, + 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyBaseBlob, self).__init__(**kwargs) + self.tier_to_cool = kwargs.get('tier_to_cool', None) + self.tier_to_archive = kwargs.get('tier_to_archive', None) + self.delete = kwargs.get('delete', None) + + +class ManagementPolicyDefinition(Model): + """An object that defines the Lifecycle rule. Each definition is made up with + a filters set and an actions set. + + All required parameters must be populated in order to send to Azure. + + :param actions: Required. An object that defines the action set. + :type actions: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyAction + :param filters: An object that defines the filter set. + :type filters: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyFilter + """ + + _validation = { + 'actions': {'required': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, + 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyDefinition, self).__init__(**kwargs) + self.actions = kwargs.get('actions', None) + self.filters = kwargs.get('filters', None) + + +class ManagementPolicyFilter(Model): + """Filters limit rule actions to a subset of blobs within the storage account. + If multiple filters are defined, a logical AND is performed on all filters. + . + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for prefixes to be match. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Only + blockBlob is supported. + :type blob_types: list[str] + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyFilter, self).__init__(**kwargs) + self.prefix_match = kwargs.get('prefix_match', None) + self.blob_types = kwargs.get('blob_types', None) + + +class ManagementPolicyRule(Model): + """An object that wraps the Lifecycle rule. Each rule is uniquely defined by + name. + + 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 enabled: Rule is enabled if set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha + numeric characters. Rule name is case-sensitive. It must be unique within + a policy. + :type name: str + :ivar type: Required. The valid value is Lifecycle. Default value: + "Lifecycle" . + :vartype type: str + :param definition: Required. An object that defines the Lifecycle rule. + :type definition: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyDefinition + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, + } + + type = "Lifecycle" + + def __init__(self, **kwargs): + super(ManagementPolicyRule, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.name = kwargs.get('name', None) + self.definition = kwargs.get('definition', None) + + +class ManagementPolicySchema(Model): + """The Storage Account ManagementPolicies Rules. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + All required parameters must be populated in order to send to Azure. + + :param rules: Required. The Storage Account ManagementPolicies Rules. See + more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type rules: + list[~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicySchema, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + + +class ManagementPolicySnapShot(Model): + """Management policy action for snapshot. + + :param delete: The function to delete the blob snapshot + :type delete: ~azure.mgmt.storage.v2019_04_01.models.DateAfterCreation + """ + + _attribute_map = { + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicySnapShot, self).__init__(**kwargs) + self.delete = kwargs.get('delete', None) + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2019_04_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2019_04_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2019_04_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2019_04_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2019_04_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2019_04_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2019_04_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of 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(OperationDisplay, 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) + + +class ProxyResource(Resource): + """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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2019_04_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. + Possible values include: Blob (b), Container (c), File (f), Share (s). + Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2019_04_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2019_04_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2019_04_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2019_04_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the SKU name. Required for account + creation; optional for update. Note that in older versions, SKU name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' + :type name: str or ~azure.mgmt.storage.v2019_04_01.models.SkuName + :ivar tier: Gets the SKU tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2019_04_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified SKU, + including file encryption, network ACLs, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2019_04_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2019_04_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +class SKUCapability(Model): + """The capability information in the specified SKU, including file encryption, + network ACLs, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified SKU, including file encryption, network ACLs, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class StorageAccount(TrackedResource): + """The storage account. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2019_04_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2019_04_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2019_04_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2019_04_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2019_04_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2019_04_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2019_04_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2019_04_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2019_04_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2019_04_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2019_04_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats + :vartype geo_replication_stats: + ~azure.mgmt.storage.v2019_04_01.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will + be true, otherwise, it will be null. + :vartype failover_in_progress: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = None + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + self.geo_replication_stats = None + self.failover_in_progress = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU name. + :type sku: ~azure.mgmt.storage.v2019_04_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2019_04_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2019_04_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2019_04_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2019_04_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2019_04_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. The default value is true since API version + 2019-04-01. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2019_04_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2019_04_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of + those SKU names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2019_04_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2019_04_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2019_04_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2019_04_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2019_04_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2019_04_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.kind = kwargs.get('kind', None) + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2019_04_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2019_04_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2019_04_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2019_04_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py new file mode 100644 index 000000000000..42f4cb5b84f5 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py @@ -0,0 +1,2650 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2019_04_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2019_04_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2019_04_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2019_04_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class AzureFilesIdentityBasedAuthentication(Model): + """Settings for Azure Files identity based authentication. + + All required parameters must be populated in order to send to Azure. + + :param directory_service_options: Required. Indicates the directory + service used. Possible values include: 'None', 'AADDS' + :type directory_service_options: str or + ~azure.mgmt.storage.v2019_04_01.models.DirectoryServiceOptions + """ + + _validation = { + 'directory_service_options': {'required': True}, + } + + _attribute_map = { + 'directory_service_options': {'key': 'directoryServiceOptions', 'type': 'str'}, + } + + def __init__(self, *, directory_service_options, **kwargs) -> None: + super(AzureFilesIdentityBasedAuthentication, self).__init__(**kwargs) + self.directory_service_options = directory_service_options + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2019_04_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2019_04_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2019_04_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2019_04_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2019_04_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(BlobContainer, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param cors: Specifies CORS rules for the Blob service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2019_04_01.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the + default version to use for requests to the Blob service if an incoming + request’s version is not specified. Possible values include version + 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for soft + delete. + :type delete_retention_policy: + ~azure.mgmt.storage.v2019_04_01.models.DeleteRetentionPolicy + :param automatic_snapshot_policy_enabled: Automatic Snapshot is enabled if + set to true. + :type automatic_snapshot_policy_enabled: bool + """ + + _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'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, + } + + def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, automatic_snapshot_policy_enabled: bool=None, **kwargs) -> None: + super(BlobServiceProperties, self).__init__(**kwargs) + self.cors = cors + self.default_service_version = default_service_version + self.delete_retention_policy = delete_retention_policy + self.automatic_snapshot_policy_enabled = automatic_snapshot_policy_enabled + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2019_04_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CorsRule(Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. + A list of origin domains that will be allowed via CORS, or "*" to allow + all domains + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. + A list of HTTP methods that are allowed to be executed by the origin. + :type allowed_methods: list[str] + :param max_age_in_seconds: Required. Required if CorsRule element is + present. The number of seconds that the client/browser should cache a + preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. + A list of response headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. + A list of headers allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__(self, *, allowed_origins, allowed_methods, max_age_in_seconds: int, exposed_headers, allowed_headers, **kwargs) -> None: + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = allowed_origins + self.allowed_methods = allowed_methods + self.max_age_in_seconds = max_age_in_seconds + self.exposed_headers = exposed_headers + self.allowed_headers = allowed_headers + + +class CorsRules(Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the + request. . + + :param cors_rules: The List of CORS rules. You can include up to five + CorsRule elements in the request. + :type cors_rules: list[~azure.mgmt.storage.v2019_04_01.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__(self, *, cors_rules=None, **kwargs) -> None: + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = cors_rules + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class DateAfterCreation(Model): + """Object to define the number of days after creation. + + All required parameters must be populated in order to send to Azure. + + :param days_after_creation_greater_than: Required. Integer value + indicating the age in days after creation + :type days_after_creation_greater_than: int + """ + + _validation = { + 'days_after_creation_greater_than': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'int'}, + } + + def __init__(self, *, days_after_creation_greater_than: int, **kwargs) -> None: + super(DateAfterCreation, self).__init__(**kwargs) + self.days_after_creation_greater_than = days_after_creation_greater_than + + +class DateAfterModification(Model): + """Object to define the number of days after last modification. + + All required parameters must be populated in order to send to Azure. + + :param days_after_modification_greater_than: Required. Integer value + indicating the age in days after last modification + :type days_after_modification_greater_than: int + """ + + _validation = { + 'days_after_modification_greater_than': {'required': True, 'minimum': 0}, + } + + _attribute_map = { + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'int'}, + } + + def __init__(self, *, days_after_modification_greater_than: int, **kwargs) -> None: + super(DateAfterModification, self).__init__(**kwargs) + self.days_after_modification_greater_than = days_after_modification_greater_than + + +class DeleteRetentionPolicy(Model): + """The blob service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled for the + Blob service. + :type enabled: bool + :param days: Indicates the number of days that the deleted blob should be + retained. The minimum specified value can be 1 and the maximum value can + be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool=None, days: int=None, **kwargs) -> None: + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = enabled + self.days = days + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2019_04_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2019_04_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2019_04_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + + +class EncryptionServices(Model): + """A list of services that support encryption. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService + :ivar table: The encryption function of the table storage service. + :vartype table: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService + :ivar queue: The encryption function of the queue storage service. + :vartype queue: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService + """ + + _validation = { + 'table': {'readonly': True}, + 'queue': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = None + self.queue = None + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class GeoReplicationStats(Model): + """Statistics related to replication for storage account's Blob, Table, Queue + and File services. It is only available when geo-redundant replication is + enabled for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of the secondary location. Possible values are: - + Live: Indicates that the secondary location is active and operational. - + Bootstrap: Indicates initial synchronization from the primary location to + the secondary location is in progress.This typically occurs when + replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: 'Live', + 'Bootstrap', 'Unavailable' + :vartype status: str or + ~azure.mgmt.storage.v2019_04_01.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time + value are guaranteed to be available for read operations. Primary writes + following this point in time may or may not be available for reads. + Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: datetime + :ivar can_failover: A boolean flag which indicates whether or not account + failover is supported for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +class Identity(Model): + """Identity for the 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 principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + 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 immutability_period_since_creation_in_days: Required. The + immutability period for the blobs in the container since the policy + creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyState + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2019_04_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'required': True}, + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.etag = None + self.update_history = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2019_04_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2019_04_01.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, *, action, lease_id: str=None, break_period: int=None, lease_duration: int=None, proposed_lease_id: str=None, **kwargs) -> None: + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = action + self.lease_id = lease_id + self.break_period = break_period + self.lease_duration = lease_duration + self.proposed_lease_id = proposed_lease_id + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, *, lease_id: str=None, lease_time_seconds: str=None, **kwargs) -> None: + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = lease_id + self.lease_time_seconds = lease_time_seconds + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + 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 has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, *, tags, **kwargs) -> None: + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2019_04_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2019_04_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2019_04_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2019_04_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2019_04_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2019_04_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ManagementPolicy(Resource): + """The Get Storage Account ManagementPolicies operation response. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + :param policy: Required. The Storage Account ManagementPolicy, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'policy': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, + } + + def __init__(self, *, policy, **kwargs) -> None: + super(ManagementPolicy, self).__init__(**kwargs) + self.last_modified_time = None + self.policy = policy + + +class ManagementPolicyAction(Model): + """Actions are applied to the filtered blobs when the execution condition is + met. + + :param base_blob: The management policy action for base blob + :type base_blob: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyBaseBlob + :param snapshot: The management policy action for snapshot + :type snapshot: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicySnapShot + """ + + _attribute_map = { + 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, + 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, + } + + def __init__(self, *, base_blob=None, snapshot=None, **kwargs) -> None: + super(ManagementPolicyAction, self).__init__(**kwargs) + self.base_blob = base_blob + self.snapshot = snapshot + + +class ManagementPolicyBaseBlob(Model): + """Management policy action for base blob. + + :param tier_to_cool: The function to tier blobs to cool storage. Support + blobs currently at Hot tier + :type tier_to_cool: + ~azure.mgmt.storage.v2019_04_01.models.DateAfterModification + :param tier_to_archive: The function to tier blobs to archive storage. + Support blobs currently at Hot or Cool tier + :type tier_to_archive: + ~azure.mgmt.storage.v2019_04_01.models.DateAfterModification + :param delete: The function to delete the blob + :type delete: ~azure.mgmt.storage.v2019_04_01.models.DateAfterModification + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, + 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, + } + + def __init__(self, *, tier_to_cool=None, tier_to_archive=None, delete=None, **kwargs) -> None: + super(ManagementPolicyBaseBlob, self).__init__(**kwargs) + self.tier_to_cool = tier_to_cool + self.tier_to_archive = tier_to_archive + self.delete = delete + + +class ManagementPolicyDefinition(Model): + """An object that defines the Lifecycle rule. Each definition is made up with + a filters set and an actions set. + + All required parameters must be populated in order to send to Azure. + + :param actions: Required. An object that defines the action set. + :type actions: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyAction + :param filters: An object that defines the filter set. + :type filters: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyFilter + """ + + _validation = { + 'actions': {'required': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, + 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, + } + + def __init__(self, *, actions, filters=None, **kwargs) -> None: + super(ManagementPolicyDefinition, self).__init__(**kwargs) + self.actions = actions + self.filters = filters + + +class ManagementPolicyFilter(Model): + """Filters limit rule actions to a subset of blobs within the storage account. + If multiple filters are defined, a logical AND is performed on all filters. + . + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for prefixes to be match. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Only + blockBlob is supported. + :type blob_types: list[str] + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + } + + def __init__(self, *, blob_types, prefix_match=None, **kwargs) -> None: + super(ManagementPolicyFilter, self).__init__(**kwargs) + self.prefix_match = prefix_match + self.blob_types = blob_types + + +class ManagementPolicyRule(Model): + """An object that wraps the Lifecycle rule. Each rule is uniquely defined by + name. + + 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 enabled: Rule is enabled if set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha + numeric characters. Rule name is case-sensitive. It must be unique within + a policy. + :type name: str + :ivar type: Required. The valid value is Lifecycle. Default value: + "Lifecycle" . + :vartype type: str + :param definition: Required. An object that defines the Lifecycle rule. + :type definition: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyDefinition + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, + } + + type = "Lifecycle" + + def __init__(self, *, name: str, definition, enabled: bool=None, **kwargs) -> None: + super(ManagementPolicyRule, self).__init__(**kwargs) + self.enabled = enabled + self.name = name + self.definition = definition + + +class ManagementPolicySchema(Model): + """The Storage Account ManagementPolicies Rules. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + All required parameters must be populated in order to send to Azure. + + :param rules: Required. The Storage Account ManagementPolicies Rules. See + more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type rules: + list[~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, + } + + def __init__(self, *, rules, **kwargs) -> None: + super(ManagementPolicySchema, self).__init__(**kwargs) + self.rules = rules + + +class ManagementPolicySnapShot(Model): + """Management policy action for snapshot. + + :param delete: The function to delete the blob snapshot + :type delete: ~azure.mgmt.storage.v2019_04_01.models.DateAfterCreation + """ + + _attribute_map = { + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__(self, *, delete=None, **kwargs) -> None: + super(ManagementPolicySnapShot, self).__init__(**kwargs) + self.delete = delete + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2019_04_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2019_04_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2019_04_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2019_04_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2019_04_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2019_04_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2019_04_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of 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(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ProxyResource(Resource): + """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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :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) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2019_04_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. + Possible values include: Blob (b), Container (c), File (f), Share (s). + Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2019_04_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2019_04_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2019_04_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource=None, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2019_04_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Sku(Model): + """The SKU of the storage account. + + 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. Gets or sets the SKU name. Required for account + creation; optional for update. Note that in older versions, SKU name was + called accountType. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' + :type name: str or ~azure.mgmt.storage.v2019_04_01.models.SkuName + :ivar tier: Gets the SKU tier. This is based on the SKU name. Possible + values include: 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.storage.v2019_04_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified SKU, + including file encryption, network ACLs, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2019_04_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2019_04_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, restrictions=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions + + +class SKUCapability(Model): + """The capability information in the specified SKU, including file encryption, + network ACLs, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified SKU, including file encryption, network ACLs, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class StorageAccount(TrackedResource): + """The storage account. + + 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: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2019_04_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2019_04_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2019_04_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2019_04_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2019_04_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2019_04_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2019_04_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2019_04_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2019_04_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2019_04_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2019_04_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats + :vartype geo_replication_stats: + ~azure.mgmt.storage.v2019_04_01.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will + be true, otherwise, it will be null. + :vartype failover_in_progress: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, azure_files_identity_based_authentication=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None: + super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None + self.is_hns_enabled = is_hns_enabled + self.geo_replication_stats = None + self.failover_in_progress = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU name. + :type sku: ~azure.mgmt.storage.v2019_04_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2019_04_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2019_04_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. If + left unspecified the account encryption settings will remain the same. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2019_04_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2019_04_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2019_04_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. The default value is true since API version + 2019-04-01. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, azure_files_identity_based_authentication=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.is_hns_enabled = is_hns_enabled + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2019_04_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2019_04_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of + those SKU names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2019_04_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2019_04_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2019_04_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2019_04_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2019_04_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2019_04_01.models.NetworkRuleSet + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, azure_files_identity_based_authentication=None, enable_https_traffic_only: bool=None, network_rule_set=None, kind=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.kind = kind + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2019_04_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2019_04_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2019_04_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2019_04_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_paged_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_paged_models.py new file mode 100644 index 000000000000..753f43a46ea8 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_paged_models.py @@ -0,0 +1,79 @@ +# 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 OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class SkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`Sku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Sku]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuPaged, self).__init__(*args, **kwargs) +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) +class ListContainerItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`ListContainerItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ListContainerItem]'} + } + + def __init__(self, *args, **kwargs): + + super(ListContainerItemPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py new file mode 100644 index 000000000000..19ee1a4346d4 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py @@ -0,0 +1,220 @@ +# 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 ReasonCode(str, Enum): + + quota_id = "QuotaId" + not_available_for_subscription = "NotAvailableForSubscription" + + +class SkuName(str, Enum): + + standard_lrs = "Standard_LRS" + standard_grs = "Standard_GRS" + standard_ragrs = "Standard_RAGRS" + standard_zrs = "Standard_ZRS" + premium_lrs = "Premium_LRS" + premium_zrs = "Premium_ZRS" + standard_gzrs = "Standard_GZRS" + standard_ragzrs = "Standard_RAGZRS" + + +class SkuTier(str, Enum): + + standard = "Standard" + premium = "Premium" + + +class Kind(str, Enum): + + storage = "Storage" + storage_v2 = "StorageV2" + blob_storage = "BlobStorage" + file_storage = "FileStorage" + block_blob_storage = "BlockBlobStorage" + + +class Reason(str, Enum): + + account_name_invalid = "AccountNameInvalid" + already_exists = "AlreadyExists" + + +class KeySource(str, Enum): + + microsoft_storage = "Microsoft.Storage" + microsoft_keyvault = "Microsoft.Keyvault" + + +class Action(str, Enum): + + allow = "Allow" + + +class State(str, Enum): + + provisioning = "provisioning" + deprovisioning = "deprovisioning" + succeeded = "succeeded" + failed = "failed" + network_source_deleted = "networkSourceDeleted" + + +class Bypass(str, Enum): + + none = "None" + logging = "Logging" + metrics = "Metrics" + azure_services = "AzureServices" + + +class DefaultAction(str, Enum): + + allow = "Allow" + deny = "Deny" + + +class DirectoryServiceOptions(str, Enum): + + none = "None" + aadds = "AADDS" + + +class AccessTier(str, Enum): + + hot = "Hot" + cool = "Cool" + + +class GeoReplicationStatus(str, Enum): + + live = "Live" + bootstrap = "Bootstrap" + unavailable = "Unavailable" + + +class ProvisioningState(str, Enum): + + creating = "Creating" + resolving_dns = "ResolvingDNS" + succeeded = "Succeeded" + + +class AccountStatus(str, Enum): + + available = "available" + unavailable = "unavailable" + + +class KeyPermission(str, Enum): + + read = "Read" + full = "Full" + + +class UsageUnit(str, Enum): + + count = "Count" + bytes = "Bytes" + seconds = "Seconds" + percent = "Percent" + counts_per_second = "CountsPerSecond" + bytes_per_second = "BytesPerSecond" + + +class Services(str, Enum): + + b = "b" + q = "q" + t = "t" + f = "f" + + +class SignedResourceTypes(str, Enum): + + s = "s" + c = "c" + o = "o" + + +class Permissions(str, Enum): + + r = "r" + d = "d" + w = "w" + l = "l" + a = "a" + c = "c" + u = "u" + p = "p" + + +class HttpProtocol(str, Enum): + + httpshttp = "https,http" + https = "https" + + +class SignedResource(str, Enum): + + b = "b" + c = "c" + f = "f" + s = "s" + + +class PublicAccess(str, Enum): + + container = "Container" + blob = "Blob" + none = "None" + + +class LeaseStatus(str, Enum): + + locked = "Locked" + unlocked = "Unlocked" + + +class LeaseState(str, Enum): + + available = "Available" + leased = "Leased" + expired = "Expired" + breaking = "Breaking" + broken = "Broken" + + +class LeaseDuration(str, Enum): + + infinite = "Infinite" + fixed = "Fixed" + + +class ImmutabilityPolicyState(str, Enum): + + locked = "Locked" + unlocked = "Unlocked" + + +class ImmutabilityPolicyUpdateType(str, Enum): + + put = "put" + lock = "lock" + extend = "extend" + + +class StorageAccountExpand(str, Enum): + + geo_replication_stats = "geoReplicationStats" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/account_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/account_sas_parameters.py deleted file mode 100644 index c6fa8ca99de6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/account_sas_parameters.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2019_04_01.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2019_04_01.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2019_04_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2019_04_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AccountSasParameters, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.resource_types = kwargs.get('resource_types', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.key_to_sign = kwargs.get('key_to_sign', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/account_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/account_sas_parameters_py3.py deleted file mode 100644 index 78a15de6b534..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/account_sas_parameters_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 AccountSasParameters(Model): - """The parameters to list SAS credentials of a storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: Required. The signed services accessible with the account - SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). - Possible values include: 'b', 'q', 't', 'f' - :type services: str or ~azure.mgmt.storage.v2019_04_01.models.Services - :param resource_types: Required. The signed resource types that are - accessible with the account SAS. Service (s): Access to service-level - APIs; Container (c): Access to container-level APIs; Object (o): Access to - object-level APIs for blobs, queue messages, table entities, and files. - Possible values include: 's', 'c', 'o' - :type resource_types: str or - ~azure.mgmt.storage.v2019_04_01.models.SignedResourceTypes - :param permissions: Required. The signed permissions for the account SAS. - Possible values include: Read (r), Write (w), Delete (d), List (l), Add - (a), Create (c), Update (u) and Process (p). Possible values include: 'r', - 'd', 'w', 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2019_04_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2019_04_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: Required. The time at which the shared - access signature becomes invalid. - :type shared_access_expiry_time: datetime - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - """ - - _validation = { - 'services': {'required': True}, - 'resource_types': {'required': True}, - 'permissions': {'required': True}, - 'shared_access_expiry_time': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'signedServices', 'type': 'str'}, - 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - } - - def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: - super(AccountSasParameters, self).__init__(**kwargs) - self.services = services - self.resource_types = resource_types - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.key_to_sign = key_to_sign diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/azure_entity_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/azure_entity_resource.py deleted file mode 100644 index 3bffaab8d35b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/azure_entity_resource.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/azure_entity_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/azure_entity_resource_py3.py deleted file mode 100644 index d3f80d87498a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/azure_entity_resource_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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_py3 import Resource - - -class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(AzureEntityResource, self).__init__(**kwargs) - self.etag = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/blob_container.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/blob_container.py deleted file mode 100644 index 625b0c5d4aae..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/blob_container.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class BlobContainer(AzureEntityResource): - """Properties of the blob container, including Id, resource name, resource - type, Etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2019_04_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2019_04_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2019_04_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2019_04_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2019_04_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(BlobContainer, self).__init__(**kwargs) - self.public_access = kwargs.get('public_access', None) - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = kwargs.get('metadata', None) - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/blob_container_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/blob_container_py3.py deleted file mode 100644 index b18048af6a9f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/blob_container_py3.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class BlobContainer(AzureEntityResource): - """Properties of the blob container, including Id, resource name, resource - type, Etag. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2019_04_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2019_04_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2019_04_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2019_04_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2019_04_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: - super(BlobContainer, self).__init__(**kwargs) - self.public_access = public_access - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = metadata - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/blob_service_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/blob_service_properties.py deleted file mode 100644 index 1bba040b45f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/blob_service_properties.py +++ /dev/null @@ -1,69 +0,0 @@ -# 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 BlobServiceProperties(Resource): - """The properties of a storage account’s Blob service. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param cors: Specifies CORS rules for the Blob service. You can include up - to five CorsRule elements in the request. If no CorsRule elements are - included in the request body, all CORS rules will be deleted, and CORS - will be disabled for the Blob service. - :type cors: ~azure.mgmt.storage.v2019_04_01.models.CorsRules - :param default_service_version: DefaultServiceVersion indicates the - default version to use for requests to the Blob service if an incoming - request’s version is not specified. Possible values include version - 2008-10-27 and all more recent versions. - :type default_service_version: str - :param delete_retention_policy: The blob service properties for soft - delete. - :type delete_retention_policy: - ~azure.mgmt.storage.v2019_04_01.models.DeleteRetentionPolicy - :param automatic_snapshot_policy_enabled: Automatic Snapshot is enabled if - set to true. - :type automatic_snapshot_policy_enabled: bool - """ - - _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'}, - 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, - 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, - 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, - 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(BlobServiceProperties, self).__init__(**kwargs) - self.cors = kwargs.get('cors', None) - self.default_service_version = kwargs.get('default_service_version', None) - self.delete_retention_policy = kwargs.get('delete_retention_policy', None) - self.automatic_snapshot_policy_enabled = kwargs.get('automatic_snapshot_policy_enabled', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/blob_service_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/blob_service_properties_py3.py deleted file mode 100644 index adceafd8b2f7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/blob_service_properties_py3.py +++ /dev/null @@ -1,69 +0,0 @@ -# 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_py3 import Resource - - -class BlobServiceProperties(Resource): - """The properties of a storage account’s Blob service. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param cors: Specifies CORS rules for the Blob service. You can include up - to five CorsRule elements in the request. If no CorsRule elements are - included in the request body, all CORS rules will be deleted, and CORS - will be disabled for the Blob service. - :type cors: ~azure.mgmt.storage.v2019_04_01.models.CorsRules - :param default_service_version: DefaultServiceVersion indicates the - default version to use for requests to the Blob service if an incoming - request’s version is not specified. Possible values include version - 2008-10-27 and all more recent versions. - :type default_service_version: str - :param delete_retention_policy: The blob service properties for soft - delete. - :type delete_retention_policy: - ~azure.mgmt.storage.v2019_04_01.models.DeleteRetentionPolicy - :param automatic_snapshot_policy_enabled: Automatic Snapshot is enabled if - set to true. - :type automatic_snapshot_policy_enabled: bool - """ - - _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'}, - 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, - 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, - 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, - 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, - } - - def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, automatic_snapshot_policy_enabled: bool=None, **kwargs) -> None: - super(BlobServiceProperties, self).__init__(**kwargs) - self.cors = cors - self.default_service_version = default_service_version - self.delete_retention_policy = delete_retention_policy - self.automatic_snapshot_policy_enabled = automatic_snapshot_policy_enabled diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/check_name_availability_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/check_name_availability_result.py deleted file mode 100644 index 85e6b7c4a46b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/check_name_availability_result.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2019_04_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/check_name_availability_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/check_name_availability_result_py3.py deleted file mode 100644 index 7b755ae88993..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/check_name_availability_result_py3.py +++ /dev/null @@ -1,50 +0,0 @@ -# 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 CheckNameAvailabilityResult(Model): - """The CheckNameAvailability operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name_available: Gets a boolean value that indicates whether the name - is available for you to use. If true, the name is available. If false, the - name has already been taken or is invalid and cannot be used. - :vartype name_available: bool - :ivar reason: Gets the reason that a storage account name could not be - used. The Reason element is only returned if NameAvailable is false. - Possible values include: 'AccountNameInvalid', 'AlreadyExists' - :vartype reason: str or ~azure.mgmt.storage.v2019_04_01.models.Reason - :ivar message: Gets an error message explaining the Reason value in more - detail. - :vartype message: str - """ - - _validation = { - 'name_available': {'readonly': True}, - 'reason': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'Reason'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/cors_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/cors_rule.py deleted file mode 100644 index 0777423f048f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/cors_rule.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 CorsRule(Model): - """Specifies a CORS rule for the Blob service. - - All required parameters must be populated in order to send to Azure. - - :param allowed_origins: Required. Required if CorsRule element is present. - A list of origin domains that will be allowed via CORS, or "*" to allow - all domains - :type allowed_origins: list[str] - :param allowed_methods: Required. Required if CorsRule element is present. - A list of HTTP methods that are allowed to be executed by the origin. - :type allowed_methods: list[str] - :param max_age_in_seconds: Required. Required if CorsRule element is - present. The number of seconds that the client/browser should cache a - preflight response. - :type max_age_in_seconds: int - :param exposed_headers: Required. Required if CorsRule element is present. - A list of response headers to expose to CORS clients. - :type exposed_headers: list[str] - :param allowed_headers: Required. Required if CorsRule element is present. - A list of headers allowed to be part of the cross-origin request. - :type allowed_headers: list[str] - """ - - _validation = { - 'allowed_origins': {'required': True}, - 'allowed_methods': {'required': True}, - 'max_age_in_seconds': {'required': True}, - 'exposed_headers': {'required': True}, - 'allowed_headers': {'required': True}, - } - - _attribute_map = { - 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, - 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, - 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, - 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, - 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(CorsRule, self).__init__(**kwargs) - self.allowed_origins = kwargs.get('allowed_origins', None) - self.allowed_methods = kwargs.get('allowed_methods', None) - self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None) - self.exposed_headers = kwargs.get('exposed_headers', None) - self.allowed_headers = kwargs.get('allowed_headers', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/cors_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/cors_rule_py3.py deleted file mode 100644 index b88a7928cd1c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/cors_rule_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 CorsRule(Model): - """Specifies a CORS rule for the Blob service. - - All required parameters must be populated in order to send to Azure. - - :param allowed_origins: Required. Required if CorsRule element is present. - A list of origin domains that will be allowed via CORS, or "*" to allow - all domains - :type allowed_origins: list[str] - :param allowed_methods: Required. Required if CorsRule element is present. - A list of HTTP methods that are allowed to be executed by the origin. - :type allowed_methods: list[str] - :param max_age_in_seconds: Required. Required if CorsRule element is - present. The number of seconds that the client/browser should cache a - preflight response. - :type max_age_in_seconds: int - :param exposed_headers: Required. Required if CorsRule element is present. - A list of response headers to expose to CORS clients. - :type exposed_headers: list[str] - :param allowed_headers: Required. Required if CorsRule element is present. - A list of headers allowed to be part of the cross-origin request. - :type allowed_headers: list[str] - """ - - _validation = { - 'allowed_origins': {'required': True}, - 'allowed_methods': {'required': True}, - 'max_age_in_seconds': {'required': True}, - 'exposed_headers': {'required': True}, - 'allowed_headers': {'required': True}, - } - - _attribute_map = { - 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, - 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, - 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, - 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, - 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, - } - - def __init__(self, *, allowed_origins, allowed_methods, max_age_in_seconds: int, exposed_headers, allowed_headers, **kwargs) -> None: - super(CorsRule, self).__init__(**kwargs) - self.allowed_origins = allowed_origins - self.allowed_methods = allowed_methods - self.max_age_in_seconds = max_age_in_seconds - self.exposed_headers = exposed_headers - self.allowed_headers = allowed_headers diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/cors_rules.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/cors_rules.py deleted file mode 100644 index 531a5da028dc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/cors_rules.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 CorsRules(Model): - """Sets the CORS rules. You can include up to five CorsRule elements in the - request. . - - :param cors_rules: The List of CORS rules. You can include up to five - CorsRule elements in the request. - :type cors_rules: list[~azure.mgmt.storage.v2019_04_01.models.CorsRule] - """ - - _attribute_map = { - 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, - } - - def __init__(self, **kwargs): - super(CorsRules, self).__init__(**kwargs) - self.cors_rules = kwargs.get('cors_rules', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/cors_rules_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/cors_rules_py3.py deleted file mode 100644 index 76a311f7f399..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/cors_rules_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 CorsRules(Model): - """Sets the CORS rules. You can include up to five CorsRule elements in the - request. . - - :param cors_rules: The List of CORS rules. You can include up to five - CorsRule elements in the request. - :type cors_rules: list[~azure.mgmt.storage.v2019_04_01.models.CorsRule] - """ - - _attribute_map = { - 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, - } - - def __init__(self, *, cors_rules=None, **kwargs) -> None: - super(CorsRules, self).__init__(**kwargs) - self.cors_rules = cors_rules diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/custom_domain.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/custom_domain.py deleted file mode 100644 index d5cc10da36cb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/custom_domain.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(CustomDomain, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/custom_domain_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/custom_domain_py3.py deleted file mode 100644 index 25dce0b57aee..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/custom_domain_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 CustomDomain(Model): - """The custom domain assigned to this storage account. This can be set via - Update. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. Gets or sets the custom domain name assigned to the - storage account. Name is the CNAME source. - :type name: str - :param use_sub_domain_name: Indicates whether indirect CName validation is - enabled. Default value is false. This should only be set on updates. - :type use_sub_domain_name: bool - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, - } - - def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: - super(CustomDomain, self).__init__(**kwargs) - self.name = name - self.use_sub_domain_name = use_sub_domain_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/date_after_creation.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/date_after_creation.py deleted file mode 100644 index 41272568a7a6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/date_after_creation.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 DateAfterCreation(Model): - """Object to define the number of days after creation. - - All required parameters must be populated in order to send to Azure. - - :param days_after_creation_greater_than: Required. Integer value - indicating the age in days after creation - :type days_after_creation_greater_than: int - """ - - _validation = { - 'days_after_creation_greater_than': {'required': True, 'minimum': 0}, - } - - _attribute_map = { - 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(DateAfterCreation, self).__init__(**kwargs) - self.days_after_creation_greater_than = kwargs.get('days_after_creation_greater_than', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/date_after_creation_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/date_after_creation_py3.py deleted file mode 100644 index ad6001e55a4e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/date_after_creation_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 DateAfterCreation(Model): - """Object to define the number of days after creation. - - All required parameters must be populated in order to send to Azure. - - :param days_after_creation_greater_than: Required. Integer value - indicating the age in days after creation - :type days_after_creation_greater_than: int - """ - - _validation = { - 'days_after_creation_greater_than': {'required': True, 'minimum': 0}, - } - - _attribute_map = { - 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'int'}, - } - - def __init__(self, *, days_after_creation_greater_than: int, **kwargs) -> None: - super(DateAfterCreation, self).__init__(**kwargs) - self.days_after_creation_greater_than = days_after_creation_greater_than diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/date_after_modification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/date_after_modification.py deleted file mode 100644 index 772272ba044a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/date_after_modification.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 DateAfterModification(Model): - """Object to define the number of days after last modification. - - All required parameters must be populated in order to send to Azure. - - :param days_after_modification_greater_than: Required. Integer value - indicating the age in days after last modification - :type days_after_modification_greater_than: int - """ - - _validation = { - 'days_after_modification_greater_than': {'required': True, 'minimum': 0}, - } - - _attribute_map = { - 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(DateAfterModification, self).__init__(**kwargs) - self.days_after_modification_greater_than = kwargs.get('days_after_modification_greater_than', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/date_after_modification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/date_after_modification_py3.py deleted file mode 100644 index cd8433ba06fa..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/date_after_modification_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 DateAfterModification(Model): - """Object to define the number of days after last modification. - - All required parameters must be populated in order to send to Azure. - - :param days_after_modification_greater_than: Required. Integer value - indicating the age in days after last modification - :type days_after_modification_greater_than: int - """ - - _validation = { - 'days_after_modification_greater_than': {'required': True, 'minimum': 0}, - } - - _attribute_map = { - 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'int'}, - } - - def __init__(self, *, days_after_modification_greater_than: int, **kwargs) -> None: - super(DateAfterModification, self).__init__(**kwargs) - self.days_after_modification_greater_than = days_after_modification_greater_than diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/delete_retention_policy.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/delete_retention_policy.py deleted file mode 100644 index 1edc91c2320a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/delete_retention_policy.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 DeleteRetentionPolicy(Model): - """The blob service properties for soft delete. - - :param enabled: Indicates whether DeleteRetentionPolicy is enabled for the - Blob service. - :type enabled: bool - :param days: Indicates the number of days that the deleted blob should be - retained. The minimum specified value can be 1 and the maximum value can - be 365. - :type days: int - """ - - _validation = { - 'days': {'maximum': 365, 'minimum': 1}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'days': {'key': 'days', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(DeleteRetentionPolicy, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.days = kwargs.get('days', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/delete_retention_policy_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/delete_retention_policy_py3.py deleted file mode 100644 index 9fcc691aadad..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/delete_retention_policy_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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 DeleteRetentionPolicy(Model): - """The blob service properties for soft delete. - - :param enabled: Indicates whether DeleteRetentionPolicy is enabled for the - Blob service. - :type enabled: bool - :param days: Indicates the number of days that the deleted blob should be - retained. The minimum specified value can be 1 and the maximum value can - be 365. - :type days: int - """ - - _validation = { - 'days': {'maximum': 365, 'minimum': 1}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'days': {'key': 'days', 'type': 'int'}, - } - - def __init__(self, *, enabled: bool=None, days: int=None, **kwargs) -> None: - super(DeleteRetentionPolicy, self).__init__(**kwargs) - self.enabled = enabled - self.days = days diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/dimension.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/dimension.py deleted file mode 100644 index 2398aa46e8f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/dimension.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Dimension, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/dimension_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/dimension_py3.py deleted file mode 100644 index af5b0aac3d23..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/dimension_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 Dimension(Model): - """Dimension of blobs, possibly be blob type or access tier. - - :param name: Display name of dimension. - :type name: str - :param display_name: Display name of dimension. - :type display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: - super(Dimension, self).__init__(**kwargs) - self.name = name - self.display_name = display_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption.py deleted file mode 100644 index c21ec9be6297..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2019_04_01.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or ~azure.mgmt.storage.v2019_04_01.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2019_04_01.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, **kwargs): - super(Encryption, self).__init__(**kwargs) - self.services = kwargs.get('services', None) - self.key_source = kwargs.get('key_source', "Microsoft.Storage") - self.key_vault_properties = kwargs.get('key_vault_properties', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_py3.py deleted file mode 100644 index d0ad9fc70703..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_py3.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 Encryption(Model): - """The encryption settings on the storage account. - - All required parameters must be populated in order to send to Azure. - - :param services: List of services which support encryption. - :type services: ~azure.mgmt.storage.v2019_04_01.models.EncryptionServices - :param key_source: Required. The encryption keySource (provider). Possible - values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. - Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. - Default value: "Microsoft.Storage" . - :type key_source: str or ~azure.mgmt.storage.v2019_04_01.models.KeySource - :param key_vault_properties: Properties provided by key vault. - :type key_vault_properties: - ~azure.mgmt.storage.v2019_04_01.models.KeyVaultProperties - """ - - _validation = { - 'key_source': {'required': True}, - } - - _attribute_map = { - 'services': {'key': 'services', 'type': 'EncryptionServices'}, - 'key_source': {'key': 'keySource', 'type': 'str'}, - 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, - } - - def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: - super(Encryption, self).__init__(**kwargs) - self.services = services - self.key_source = key_source - self.key_vault_properties = key_vault_properties diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_service.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_service.py deleted file mode 100644 index 3a020c468f64..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_service.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(EncryptionService, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_service_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_service_py3.py deleted file mode 100644 index 0566050c6155..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_service_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 EncryptionService(Model): - """A service that allows server-side encryption to be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param enabled: A boolean indicating whether or not the service encrypts - the data as it is stored. - :type enabled: bool - :ivar last_enabled_time: Gets a rough estimate of the date/time when the - encryption was last enabled by the user. Only returned when encryption is - enabled. There might be some unencrypted blobs which were written after - this time, as it is just a rough estimate. - :vartype last_enabled_time: datetime - """ - - _validation = { - 'last_enabled_time': {'readonly': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, enabled: bool=None, **kwargs) -> None: - super(EncryptionService, self).__init__(**kwargs) - self.enabled = enabled - self.last_enabled_time = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_services.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_services.py deleted file mode 100644 index fb40fccb84c0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_services.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, **kwargs): - super(EncryptionServices, self).__init__(**kwargs) - self.blob = kwargs.get('blob', None) - self.file = kwargs.get('file', None) - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_services_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_services_py3.py deleted file mode 100644 index 2c2c74940ae7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/encryption_services_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 EncryptionServices(Model): - """A list of services that support encryption. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param blob: The encryption function of the blob storage service. - :type blob: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService - :param file: The encryption function of the file storage service. - :type file: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService - :ivar table: The encryption function of the table storage service. - :vartype table: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService - :ivar queue: The encryption function of the queue storage service. - :vartype queue: ~azure.mgmt.storage.v2019_04_01.models.EncryptionService - """ - - _validation = { - 'table': {'readonly': True}, - 'queue': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'EncryptionService'}, - 'file': {'key': 'file', 'type': 'EncryptionService'}, - 'table': {'key': 'table', 'type': 'EncryptionService'}, - 'queue': {'key': 'queue', 'type': 'EncryptionService'}, - } - - def __init__(self, *, blob=None, file=None, **kwargs) -> None: - super(EncryptionServices, self).__init__(**kwargs) - self.blob = blob - self.file = file - self.table = None - self.queue = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/endpoints.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/endpoints.py deleted file mode 100644 index 66b1c3459a5e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/endpoints.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, - table, web or dfs object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - :ivar web: Gets the web endpoint. - :vartype web: str - :ivar dfs: Gets the dfs endpoint. - :vartype dfs: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - 'web': {'readonly': True}, - 'dfs': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - 'web': {'key': 'web', 'type': 'str'}, - 'dfs': {'key': 'dfs', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None - self.web = None - self.dfs = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/endpoints_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/endpoints_py3.py deleted file mode 100644 index ced561acd85b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/endpoints_py3.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 Endpoints(Model): - """The URIs that are used to perform a retrieval of a public blob, queue, - table, web or dfs object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar blob: Gets the blob endpoint. - :vartype blob: str - :ivar queue: Gets the queue endpoint. - :vartype queue: str - :ivar table: Gets the table endpoint. - :vartype table: str - :ivar file: Gets the file endpoint. - :vartype file: str - :ivar web: Gets the web endpoint. - :vartype web: str - :ivar dfs: Gets the dfs endpoint. - :vartype dfs: str - """ - - _validation = { - 'blob': {'readonly': True}, - 'queue': {'readonly': True}, - 'table': {'readonly': True}, - 'file': {'readonly': True}, - 'web': {'readonly': True}, - 'dfs': {'readonly': True}, - } - - _attribute_map = { - 'blob': {'key': 'blob', 'type': 'str'}, - 'queue': {'key': 'queue', 'type': 'str'}, - 'table': {'key': 'table', 'type': 'str'}, - 'file': {'key': 'file', 'type': 'str'}, - 'web': {'key': 'web', 'type': 'str'}, - 'dfs': {'key': 'dfs', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(Endpoints, self).__init__(**kwargs) - self.blob = None - self.queue = None - self.table = None - self.file = None - self.web = None - self.dfs = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/geo_replication_stats.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/geo_replication_stats.py deleted file mode 100644 index d83d4f51cc22..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/geo_replication_stats.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 GeoReplicationStats(Model): - """Statistics related to replication for storage account's Blob, Table, Queue - and File services. It is only available when geo-redundant replication is - enabled for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar status: The status of the secondary location. Possible values are: - - Live: Indicates that the secondary location is active and operational. - - Bootstrap: Indicates initial synchronization from the primary location to - the secondary location is in progress.This typically occurs when - replication is first enabled. - Unavailable: Indicates that the secondary - location is temporarily unavailable. Possible values include: 'Live', - 'Bootstrap', 'Unavailable' - :vartype status: str or - ~azure.mgmt.storage.v2019_04_01.models.GeoReplicationStatus - :ivar last_sync_time: All primary writes preceding this UTC date/time - value are guaranteed to be available for read operations. Primary writes - following this point in time may or may not be available for reads. - Element may be default value if value of LastSyncTime is not available, - this can happen if secondary is offline or we are in bootstrap. - :vartype last_sync_time: datetime - :ivar can_failover: A boolean flag which indicates whether or not account - failover is supported for the account. - :vartype can_failover: bool - """ - - _validation = { - 'status': {'readonly': True}, - 'last_sync_time': {'readonly': True}, - 'can_failover': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, - 'can_failover': {'key': 'canFailover', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(GeoReplicationStats, self).__init__(**kwargs) - self.status = None - self.last_sync_time = None - self.can_failover = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/geo_replication_stats_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/geo_replication_stats_py3.py deleted file mode 100644 index 21f2de3459dc..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/geo_replication_stats_py3.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 GeoReplicationStats(Model): - """Statistics related to replication for storage account's Blob, Table, Queue - and File services. It is only available when geo-redundant replication is - enabled for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar status: The status of the secondary location. Possible values are: - - Live: Indicates that the secondary location is active and operational. - - Bootstrap: Indicates initial synchronization from the primary location to - the secondary location is in progress.This typically occurs when - replication is first enabled. - Unavailable: Indicates that the secondary - location is temporarily unavailable. Possible values include: 'Live', - 'Bootstrap', 'Unavailable' - :vartype status: str or - ~azure.mgmt.storage.v2019_04_01.models.GeoReplicationStatus - :ivar last_sync_time: All primary writes preceding this UTC date/time - value are guaranteed to be available for read operations. Primary writes - following this point in time may or may not be available for reads. - Element may be default value if value of LastSyncTime is not available, - this can happen if secondary is offline or we are in bootstrap. - :vartype last_sync_time: datetime - :ivar can_failover: A boolean flag which indicates whether or not account - failover is supported for the account. - :vartype can_failover: bool - """ - - _validation = { - 'status': {'readonly': True}, - 'last_sync_time': {'readonly': True}, - 'can_failover': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, - 'can_failover': {'key': 'canFailover', 'type': 'bool'}, - } - - def __init__(self, **kwargs) -> None: - super(GeoReplicationStats, self).__init__(**kwargs) - self.status = None - self.last_sync_time = None - self.can_failover = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/identity.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/identity.py deleted file mode 100644 index f526b986fc70..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/identity.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs): - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/identity_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/identity_py3.py deleted file mode 100644 index 22d25fdd85b7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/identity_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 Identity(Model): - """Identity for the 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 principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned" . - :vartype type: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "SystemAssigned" - - def __init__(self, **kwargs) -> None: - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy.py deleted file mode 100644 index fe61acd49726..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class ImmutabilityPolicy(AzureEntityResource): - """The ImmutabilityPolicy property of a blob container, including Id, resource - name, resource type, Etag. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ImmutabilityPolicy, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) - self.state = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy_properties.py deleted file mode 100644 index 85118f0e9a6a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy_properties.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 ImmutabilityPolicyProperties(Model): - """The properties of an ImmutabilityPolicy of a blob container. - - 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 immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyState - :ivar etag: ImmutabilityPolicy Etag. - :vartype etag: str - :ivar update_history: The ImmutabilityPolicy update history of the blob - container. - :vartype update_history: - list[~azure.mgmt.storage.v2019_04_01.models.UpdateHistoryProperty] - """ - - _validation = { - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - 'etag': {'readonly': True}, - 'update_history': {'readonly': True}, - } - - _attribute_map = { - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, - } - - def __init__(self, **kwargs): - super(ImmutabilityPolicyProperties, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) - self.state = None - self.etag = None - self.update_history = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy_properties_py3.py deleted file mode 100644 index feb15f507cfd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy_properties_py3.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 ImmutabilityPolicyProperties(Model): - """The properties of an ImmutabilityPolicy of a blob container. - - 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 immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyState - :ivar etag: ImmutabilityPolicy Etag. - :vartype etag: str - :ivar update_history: The ImmutabilityPolicy update history of the blob - container. - :vartype update_history: - list[~azure.mgmt.storage.v2019_04_01.models.UpdateHistoryProperty] - """ - - _validation = { - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - 'etag': {'readonly': True}, - 'update_history': {'readonly': True}, - } - - _attribute_map = { - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, - } - - def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: - super(ImmutabilityPolicyProperties, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days - self.state = None - self.etag = None - self.update_history = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy_py3.py deleted file mode 100644 index 1a92ce5b3ef4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/immutability_policy_py3.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class ImmutabilityPolicy(AzureEntityResource): - """The ImmutabilityPolicy property of a blob container, including Id, resource - name, resource type, Etag. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param immutability_period_since_creation_in_days: Required. The - immutability period for the blobs in the container since the policy - creation, in days. - :type immutability_period_since_creation_in_days: int - :ivar state: The ImmutabilityPolicy state of a blob container, possible - values include: Locked and Unlocked. Possible values include: 'Locked', - 'Unlocked' - :vartype state: str or - ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, *, immutability_period_since_creation_in_days: int, **kwargs) -> None: - super(ImmutabilityPolicy, self).__init__(**kwargs) - self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days - self.state = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/ip_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/ip_rule.py deleted file mode 100644 index 0cd55ac093b2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/ip_rule.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2019_04_01.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, **kwargs): - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.action = kwargs.get('action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/ip_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/ip_rule_py3.py deleted file mode 100644 index b3c4b39f4e1f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/ip_rule_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 IPRule(Model): - """IP rule with specific IP or IP range in CIDR format. - - All required parameters must be populated in order to send to Azure. - - :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR - format. Only IPV4 address is allowed. - :type ip_address_or_range: str - :param action: The action of IP ACL rule. Possible values include: - 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2019_04_01.models.Action - """ - - _validation = { - 'ip_address_or_range': {'required': True}, - } - - _attribute_map = { - 'ip_address_or_range': {'key': 'value', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - } - - def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: - super(IPRule, self).__init__(**kwargs) - self.ip_address_or_range = ip_address_or_range - self.action = action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/key_vault_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/key_vault_properties.py deleted file mode 100644 index 44eaf379f6f2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/key_vault_properties.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) - self.key_version = kwargs.get('key_version', None) - self.key_vault_uri = kwargs.get('key_vault_uri', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/key_vault_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/key_vault_properties_py3.py deleted file mode 100644 index 9e6350eec898..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/key_vault_properties_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 KeyVaultProperties(Model): - """Properties of key vault. - - :param key_name: The name of KeyVault key. - :type key_name: str - :param key_version: The version of KeyVault key. - :type key_version: str - :param key_vault_uri: The Uri of KeyVault. - :type key_vault_uri: str - """ - - _attribute_map = { - 'key_name': {'key': 'keyname', 'type': 'str'}, - 'key_version': {'key': 'keyversion', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, - } - - def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_name = key_name - self.key_version = key_version - self.key_vault_uri = key_vault_uri diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/lease_container_request.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/lease_container_request.py deleted file mode 100644 index 5ea2f5bd8129..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/lease_container_request.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 LeaseContainerRequest(Model): - """Lease Container request schema. - - All required parameters must be populated in order to send to Azure. - - :param action: Required. Specifies the lease action. Can be one of the - available actions. Possible values include: 'Acquire', 'Renew', 'Change', - 'Release', 'Break' - :type action: str or ~azure.mgmt.storage.v2019_04_01.models.enum - :param lease_id: Identifies the lease. Can be specified in any valid GUID - string format. - :type lease_id: str - :param break_period: Optional. For a break action, proposed duration the - lease should continue before it is broken, in seconds, between 0 and 60. - :type break_period: int - :param lease_duration: Required for acquire. Specifies the duration of the - lease, in seconds, or negative one (-1) for a lease that never expires. - :type lease_duration: int - :param proposed_lease_id: Optional for acquire, required for change. - Proposed lease ID, in a GUID string format. - :type proposed_lease_id: str - """ - - _validation = { - 'action': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'break_period': {'key': 'breakPeriod', 'type': 'int'}, - 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, - 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LeaseContainerRequest, self).__init__(**kwargs) - self.action = kwargs.get('action', None) - self.lease_id = kwargs.get('lease_id', None) - self.break_period = kwargs.get('break_period', None) - self.lease_duration = kwargs.get('lease_duration', None) - self.proposed_lease_id = kwargs.get('proposed_lease_id', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/lease_container_request_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/lease_container_request_py3.py deleted file mode 100644 index 95b2c23d6446..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/lease_container_request_py3.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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 LeaseContainerRequest(Model): - """Lease Container request schema. - - All required parameters must be populated in order to send to Azure. - - :param action: Required. Specifies the lease action. Can be one of the - available actions. Possible values include: 'Acquire', 'Renew', 'Change', - 'Release', 'Break' - :type action: str or ~azure.mgmt.storage.v2019_04_01.models.enum - :param lease_id: Identifies the lease. Can be specified in any valid GUID - string format. - :type lease_id: str - :param break_period: Optional. For a break action, proposed duration the - lease should continue before it is broken, in seconds, between 0 and 60. - :type break_period: int - :param lease_duration: Required for acquire. Specifies the duration of the - lease, in seconds, or negative one (-1) for a lease that never expires. - :type lease_duration: int - :param proposed_lease_id: Optional for acquire, required for change. - Proposed lease ID, in a GUID string format. - :type proposed_lease_id: str - """ - - _validation = { - 'action': {'required': True}, - } - - _attribute_map = { - 'action': {'key': 'action', 'type': 'str'}, - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'break_period': {'key': 'breakPeriod', 'type': 'int'}, - 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, - 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, - } - - def __init__(self, *, action, lease_id: str=None, break_period: int=None, lease_duration: int=None, proposed_lease_id: str=None, **kwargs) -> None: - super(LeaseContainerRequest, self).__init__(**kwargs) - self.action = action - self.lease_id = lease_id - self.break_period = break_period - self.lease_duration = lease_duration - self.proposed_lease_id = proposed_lease_id diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/lease_container_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/lease_container_response.py deleted file mode 100644 index 666f0e899f1e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/lease_container_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 LeaseContainerResponse(Model): - """Lease Container response schema. - - :param lease_id: Returned unique lease ID that must be included with any - request to delete the container, or to renew, change, or release the - lease. - :type lease_id: str - :param lease_time_seconds: Approximate time remaining in the lease period, - in seconds. - :type lease_time_seconds: str - """ - - _attribute_map = { - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(LeaseContainerResponse, self).__init__(**kwargs) - self.lease_id = kwargs.get('lease_id', None) - self.lease_time_seconds = kwargs.get('lease_time_seconds', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/lease_container_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/lease_container_response_py3.py deleted file mode 100644 index fa87d930571d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/lease_container_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 LeaseContainerResponse(Model): - """Lease Container response schema. - - :param lease_id: Returned unique lease ID that must be included with any - request to delete the container, or to renew, change, or release the - lease. - :type lease_id: str - :param lease_time_seconds: Approximate time remaining in the lease period, - in seconds. - :type lease_time_seconds: str - """ - - _attribute_map = { - 'lease_id': {'key': 'leaseId', 'type': 'str'}, - 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, - } - - def __init__(self, *, lease_id: str=None, lease_time_seconds: str=None, **kwargs) -> None: - super(LeaseContainerResponse, self).__init__(**kwargs) - self.lease_id = lease_id - self.lease_time_seconds = lease_time_seconds diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/legal_hold.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/legal_hold.py deleted file mode 100644 index 4eb93df1d9fe..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/legal_hold.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 LegalHold(Model): - """The LegalHold property of a blob container. - - 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 has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: Required. Each tag should be 3 to 23 alphanumeric characters - and is normalized to lower case at SRP. - :type tags: list[str] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - 'tags': {'required': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(LegalHold, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = kwargs.get('tags', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/legal_hold_properties.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/legal_hold_properties.py deleted file mode 100644 index 25c094cf5116..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/legal_hold_properties.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 LegalHoldProperties(Model): - """The LegalHold property of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: The list of LegalHold tags of a blob container. - :type tags: list[~azure.mgmt.storage.v2019_04_01.models.TagProperty] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[TagProperty]'}, - } - - def __init__(self, **kwargs): - super(LegalHoldProperties, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = kwargs.get('tags', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/legal_hold_properties_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/legal_hold_properties_py3.py deleted file mode 100644 index fb97a82969c3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/legal_hold_properties_py3.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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 LegalHoldProperties(Model): - """The LegalHold property of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: The list of LegalHold tags of a blob container. - :type tags: list[~azure.mgmt.storage.v2019_04_01.models.TagProperty] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[TagProperty]'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(LegalHoldProperties, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = tags diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/legal_hold_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/legal_hold_py3.py deleted file mode 100644 index a4bc196cb604..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/legal_hold_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 LegalHold(Model): - """The LegalHold property of a blob container. - - 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 has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :param tags: Required. Each tag should be 3 to 23 alphanumeric characters - and is normalized to lower case at SRP. - :type tags: list[str] - """ - - _validation = { - 'has_legal_hold': {'readonly': True}, - 'tags': {'required': True}, - } - - _attribute_map = { - 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, - 'tags': {'key': 'tags', 'type': '[str]'}, - } - - def __init__(self, *, tags, **kwargs) -> None: - super(LegalHold, self).__init__(**kwargs) - self.has_legal_hold = None - self.tags = tags diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_account_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_account_sas_response.py deleted file mode 100644 index a56e959a34bd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_account_sas_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_account_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_account_sas_response_py3.py deleted file mode 100644 index b8b9a314d9f6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_account_sas_response_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ListAccountSasResponse(Model): - """The List SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar account_sas_token: List SAS credentials of storage account. - :vartype account_sas_token: str - """ - - _validation = { - 'account_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListAccountSasResponse, self).__init__(**kwargs) - self.account_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_container_item.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_container_item.py deleted file mode 100644 index 08ab8e20bffb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_container_item.py +++ /dev/null @@ -1,118 +0,0 @@ -# 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 .azure_entity_resource import AzureEntityResource - - -class ListContainerItem(AzureEntityResource): - """The blob container properties be listed out. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2019_04_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2019_04_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2019_04_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2019_04_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2019_04_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(ListContainerItem, self).__init__(**kwargs) - self.public_access = kwargs.get('public_access', None) - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = kwargs.get('metadata', None) - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_container_item_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_container_item_py3.py deleted file mode 100644 index 9c4864dc7694..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_container_item_py3.py +++ /dev/null @@ -1,118 +0,0 @@ -# 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 .azure_entity_resource_py3 import AzureEntityResource - - -class ListContainerItem(AzureEntityResource): - """The blob container properties be listed out. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar etag: Resource Etag. - :vartype etag: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2019_04_01.models.PublicAccess - :ivar last_modified_time: Returns the date and time the container was last - modified. - :vartype last_modified_time: datetime - :ivar lease_status: The lease status of the container. Possible values - include: 'Locked', 'Unlocked' - :vartype lease_status: str or - ~azure.mgmt.storage.v2019_04_01.models.LeaseStatus - :ivar lease_state: Lease state of the container. Possible values include: - 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' - :vartype lease_state: str or - ~azure.mgmt.storage.v2019_04_01.models.LeaseState - :ivar lease_duration: Specifies whether the lease on a container is of - infinite or fixed duration, only when the container is leased. Possible - values include: 'Infinite', 'Fixed' - :vartype lease_duration: str or - ~azure.mgmt.storage.v2019_04_01.models.LeaseDuration - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: dict[str, str] - :ivar immutability_policy: The ImmutabilityPolicy property of the - container. - :vartype immutability_policy: - ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyProperties - :ivar legal_hold: The LegalHold property of the container. - :vartype legal_hold: - ~azure.mgmt.storage.v2019_04_01.models.LegalHoldProperties - :ivar has_legal_hold: The hasLegalHold public property is set to true by - SRP if there are at least one existing tag. The hasLegalHold public - property is set to false by SRP if all existing legal hold tags are - cleared out. There can be a maximum of 1000 blob containers with - hasLegalHold=true for a given account. - :vartype has_legal_hold: bool - :ivar has_immutability_policy: The hasImmutabilityPolicy public property - is set to true by SRP if ImmutabilityPolicy has been created for this - container. The hasImmutabilityPolicy public property is set to false by - SRP if ImmutabilityPolicy has not been created for this container. - :vartype has_immutability_policy: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'lease_status': {'readonly': True}, - 'lease_state': {'readonly': True}, - 'lease_duration': {'readonly': True}, - 'immutability_policy': {'readonly': True}, - 'legal_hold': {'readonly': True}, - 'has_legal_hold': {'readonly': True}, - 'has_immutability_policy': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, - 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, - 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, - 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, - 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, - 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, - 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, - 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, - } - - def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: - super(ListContainerItem, self).__init__(**kwargs) - self.public_access = public_access - self.last_modified_time = None - self.lease_status = None - self.lease_state = None - self.lease_duration = None - self.metadata = metadata - self.immutability_policy = None - self.legal_hold = None - self.has_legal_hold = None - self.has_immutability_policy = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_container_items.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_container_items.py deleted file mode 100644 index 4e3cf5184ed6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_container_items.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ListContainerItems(Model): - """The list of blob containers. - - :param value: The list of blob containers. - :type value: - list[~azure.mgmt.storage.v2019_04_01.models.ListContainerItem] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ListContainerItem]'}, - } - - def __init__(self, **kwargs): - super(ListContainerItems, self).__init__(**kwargs) - self.value = kwargs.get('value', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_container_items_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_container_items_py3.py deleted file mode 100644 index 50bdde68bf2e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_container_items_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ListContainerItems(Model): - """The list of blob containers. - - :param value: The list of blob containers. - :type value: - list[~azure.mgmt.storage.v2019_04_01.models.ListContainerItem] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ListContainerItem]'}, - } - - def __init__(self, *, value=None, **kwargs) -> None: - super(ListContainerItems, self).__init__(**kwargs) - self.value = value diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_service_sas_response.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_service_sas_response.py deleted file mode 100644 index d4ab160ae364..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_service_sas_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_service_sas_response_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_service_sas_response_py3.py deleted file mode 100644 index 7c20617658df..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/list_service_sas_response_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 ListServiceSasResponse(Model): - """The List service SAS credentials operation response. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar service_sas_token: List service SAS credentials of specific - resource. - :vartype service_sas_token: str - """ - - _validation = { - 'service_sas_token': {'readonly': True}, - } - - _attribute_map = { - 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ListServiceSasResponse, self).__init__(**kwargs) - self.service_sas_token = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy.py deleted file mode 100644 index 14467856180b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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 ManagementPolicy(Resource): - """The Get Storage Account ManagementPolicies operation response. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar last_modified_time: Returns the date and time the ManagementPolicies - was last modified. - :vartype last_modified_time: datetime - :param policy: Required. The Storage Account ManagementPolicy, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicySchema - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'policy': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicy, self).__init__(**kwargs) - self.last_modified_time = None - self.policy = kwargs.get('policy', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_action.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_action.py deleted file mode 100644 index 2f2b7f6f0079..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_action.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ManagementPolicyAction(Model): - """Actions are applied to the filtered blobs when the execution condition is - met. - - :param base_blob: The management policy action for base blob - :type base_blob: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyBaseBlob - :param snapshot: The management policy action for snapshot - :type snapshot: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicySnapShot - """ - - _attribute_map = { - 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, - 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicyAction, self).__init__(**kwargs) - self.base_blob = kwargs.get('base_blob', None) - self.snapshot = kwargs.get('snapshot', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_action_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_action_py3.py deleted file mode 100644 index 914dc669ce68..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_action_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 ManagementPolicyAction(Model): - """Actions are applied to the filtered blobs when the execution condition is - met. - - :param base_blob: The management policy action for base blob - :type base_blob: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyBaseBlob - :param snapshot: The management policy action for snapshot - :type snapshot: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicySnapShot - """ - - _attribute_map = { - 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, - 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, - } - - def __init__(self, *, base_blob=None, snapshot=None, **kwargs) -> None: - super(ManagementPolicyAction, self).__init__(**kwargs) - self.base_blob = base_blob - self.snapshot = snapshot diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_base_blob.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_base_blob.py deleted file mode 100644 index 57f2e67c95d5..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_base_blob.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 ManagementPolicyBaseBlob(Model): - """Management policy action for base blob. - - :param tier_to_cool: The function to tier blobs to cool storage. Support - blobs currently at Hot tier - :type tier_to_cool: - ~azure.mgmt.storage.v2019_04_01.models.DateAfterModification - :param tier_to_archive: The function to tier blobs to archive storage. - Support blobs currently at Hot or Cool tier - :type tier_to_archive: - ~azure.mgmt.storage.v2019_04_01.models.DateAfterModification - :param delete: The function to delete the blob - :type delete: ~azure.mgmt.storage.v2019_04_01.models.DateAfterModification - """ - - _attribute_map = { - 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, - 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, - 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicyBaseBlob, self).__init__(**kwargs) - self.tier_to_cool = kwargs.get('tier_to_cool', None) - self.tier_to_archive = kwargs.get('tier_to_archive', None) - self.delete = kwargs.get('delete', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_base_blob_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_base_blob_py3.py deleted file mode 100644 index c6ae1278e942..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_base_blob_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 ManagementPolicyBaseBlob(Model): - """Management policy action for base blob. - - :param tier_to_cool: The function to tier blobs to cool storage. Support - blobs currently at Hot tier - :type tier_to_cool: - ~azure.mgmt.storage.v2019_04_01.models.DateAfterModification - :param tier_to_archive: The function to tier blobs to archive storage. - Support blobs currently at Hot or Cool tier - :type tier_to_archive: - ~azure.mgmt.storage.v2019_04_01.models.DateAfterModification - :param delete: The function to delete the blob - :type delete: ~azure.mgmt.storage.v2019_04_01.models.DateAfterModification - """ - - _attribute_map = { - 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, - 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, - 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, - } - - def __init__(self, *, tier_to_cool=None, tier_to_archive=None, delete=None, **kwargs) -> None: - super(ManagementPolicyBaseBlob, self).__init__(**kwargs) - self.tier_to_cool = tier_to_cool - self.tier_to_archive = tier_to_archive - self.delete = delete diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_definition.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_definition.py deleted file mode 100644 index c544479dde2a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_definition.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ManagementPolicyDefinition(Model): - """An object that defines the Lifecycle rule. Each definition is made up with - a filters set and an actions set. - - All required parameters must be populated in order to send to Azure. - - :param actions: Required. An object that defines the action set. - :type actions: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyAction - :param filters: An object that defines the filter set. - :type filters: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyFilter - """ - - _validation = { - 'actions': {'required': True}, - } - - _attribute_map = { - 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, - 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicyDefinition, self).__init__(**kwargs) - self.actions = kwargs.get('actions', None) - self.filters = kwargs.get('filters', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_definition_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_definition_py3.py deleted file mode 100644 index 5b272d094b83..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_definition_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ManagementPolicyDefinition(Model): - """An object that defines the Lifecycle rule. Each definition is made up with - a filters set and an actions set. - - All required parameters must be populated in order to send to Azure. - - :param actions: Required. An object that defines the action set. - :type actions: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyAction - :param filters: An object that defines the filter set. - :type filters: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyFilter - """ - - _validation = { - 'actions': {'required': True}, - } - - _attribute_map = { - 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, - 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, - } - - def __init__(self, *, actions, filters=None, **kwargs) -> None: - super(ManagementPolicyDefinition, self).__init__(**kwargs) - self.actions = actions - self.filters = filters diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_filter.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_filter.py deleted file mode 100644 index 29a7cadc9444..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_filter.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ManagementPolicyFilter(Model): - """Filters limit rule actions to a subset of blobs within the storage account. - If multiple filters are defined, a logical AND is performed on all filters. - . - - All required parameters must be populated in order to send to Azure. - - :param prefix_match: An array of strings for prefixes to be match. - :type prefix_match: list[str] - :param blob_types: Required. An array of predefined enum values. Only - blockBlob is supported. - :type blob_types: list[str] - """ - - _validation = { - 'blob_types': {'required': True}, - } - - _attribute_map = { - 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, - 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicyFilter, self).__init__(**kwargs) - self.prefix_match = kwargs.get('prefix_match', None) - self.blob_types = kwargs.get('blob_types', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_filter_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_filter_py3.py deleted file mode 100644 index 2bf8d03ca66f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_filter_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 ManagementPolicyFilter(Model): - """Filters limit rule actions to a subset of blobs within the storage account. - If multiple filters are defined, a logical AND is performed on all filters. - . - - All required parameters must be populated in order to send to Azure. - - :param prefix_match: An array of strings for prefixes to be match. - :type prefix_match: list[str] - :param blob_types: Required. An array of predefined enum values. Only - blockBlob is supported. - :type blob_types: list[str] - """ - - _validation = { - 'blob_types': {'required': True}, - } - - _attribute_map = { - 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, - 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, - } - - def __init__(self, *, blob_types, prefix_match=None, **kwargs) -> None: - super(ManagementPolicyFilter, self).__init__(**kwargs) - self.prefix_match = prefix_match - self.blob_types = blob_types diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_py3.py deleted file mode 100644 index 03d52823c735..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_py3.py +++ /dev/null @@ -1,60 +0,0 @@ -# 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_py3 import Resource - - -class ManagementPolicy(Resource): - """The Get Storage Account ManagementPolicies operation response. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :ivar last_modified_time: Returns the date and time the ManagementPolicies - was last modified. - :vartype last_modified_time: datetime - :param policy: Required. The Storage Account ManagementPolicy, in JSON - format. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicySchema - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'policy': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, - } - - def __init__(self, *, policy, **kwargs) -> None: - super(ManagementPolicy, self).__init__(**kwargs) - self.last_modified_time = None - self.policy = policy diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_rule.py deleted file mode 100644 index 5398557cd68d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_rule.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 ManagementPolicyRule(Model): - """An object that wraps the Lifecycle rule. Each rule is uniquely defined by - name. - - 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 enabled: Rule is enabled if set to true. - :type enabled: bool - :param name: Required. A rule name can contain any combination of alpha - numeric characters. Rule name is case-sensitive. It must be unique within - a policy. - :type name: str - :ivar type: Required. The valid value is Lifecycle. Default value: - "Lifecycle" . - :vartype type: str - :param definition: Required. An object that defines the Lifecycle rule. - :type definition: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyDefinition - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, - } - - type = "Lifecycle" - - def __init__(self, **kwargs): - super(ManagementPolicyRule, self).__init__(**kwargs) - self.enabled = kwargs.get('enabled', None) - self.name = kwargs.get('name', None) - self.definition = kwargs.get('definition', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_rule_py3.py deleted file mode 100644 index 9072352d1563..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_rule_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 ManagementPolicyRule(Model): - """An object that wraps the Lifecycle rule. Each rule is uniquely defined by - name. - - 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 enabled: Rule is enabled if set to true. - :type enabled: bool - :param name: Required. A rule name can contain any combination of alpha - numeric characters. Rule name is case-sensitive. It must be unique within - a policy. - :type name: str - :ivar type: Required. The valid value is Lifecycle. Default value: - "Lifecycle" . - :vartype type: str - :param definition: Required. An object that defines the Lifecycle rule. - :type definition: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyDefinition - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - 'definition': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, - } - - type = "Lifecycle" - - def __init__(self, *, name: str, definition, enabled: bool=None, **kwargs) -> None: - super(ManagementPolicyRule, self).__init__(**kwargs) - self.enabled = enabled - self.name = name - self.definition = definition diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_schema.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_schema.py deleted file mode 100644 index 266e8915b5f3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_schema.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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 ManagementPolicySchema(Model): - """The Storage Account ManagementPolicies Rules. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - - All required parameters must be populated in order to send to Azure. - - :param rules: Required. The Storage Account ManagementPolicies Rules. See - more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type rules: - list[~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyRule] - """ - - _validation = { - 'rules': {'required': True}, - } - - _attribute_map = { - 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicySchema, self).__init__(**kwargs) - self.rules = kwargs.get('rules', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_schema_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_schema_py3.py deleted file mode 100644 index 87022a91e270..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_schema_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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 ManagementPolicySchema(Model): - """The Storage Account ManagementPolicies Rules. See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - - All required parameters must be populated in order to send to Azure. - - :param rules: Required. The Storage Account ManagementPolicies Rules. See - more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type rules: - list[~azure.mgmt.storage.v2019_04_01.models.ManagementPolicyRule] - """ - - _validation = { - 'rules': {'required': True}, - } - - _attribute_map = { - 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, - } - - def __init__(self, *, rules, **kwargs) -> None: - super(ManagementPolicySchema, self).__init__(**kwargs) - self.rules = rules diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_snap_shot.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_snap_shot.py deleted file mode 100644 index aaddccb5f2c7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_snap_shot.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 ManagementPolicySnapShot(Model): - """Management policy action for snapshot. - - :param delete: The function to delete the blob snapshot - :type delete: ~azure.mgmt.storage.v2019_04_01.models.DateAfterCreation - """ - - _attribute_map = { - 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, - } - - def __init__(self, **kwargs): - super(ManagementPolicySnapShot, self).__init__(**kwargs) - self.delete = kwargs.get('delete', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_snap_shot_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_snap_shot_py3.py deleted file mode 100644 index e953fe148865..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/management_policy_snap_shot_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# 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 ManagementPolicySnapShot(Model): - """Management policy action for snapshot. - - :param delete: The function to delete the blob snapshot - :type delete: ~azure.mgmt.storage.v2019_04_01.models.DateAfterCreation - """ - - _attribute_map = { - 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, - } - - def __init__(self, *, delete=None, **kwargs) -> None: - super(ManagementPolicySnapShot, self).__init__(**kwargs) - self.delete = delete diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/metric_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/metric_specification.py deleted file mode 100644 index 2ae5c9354f35..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/metric_specification.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: list[~azure.mgmt.storage.v2019_04_01.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MetricSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.display_description = kwargs.get('display_description', None) - self.unit = kwargs.get('unit', None) - self.dimensions = kwargs.get('dimensions', None) - self.aggregation_type = kwargs.get('aggregation_type', None) - self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) - self.category = kwargs.get('category', None) - self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/metric_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/metric_specification_py3.py deleted file mode 100644 index 345601a824c4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/metric_specification_py3.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 MetricSpecification(Model): - """Metric specification of operation. - - :param name: Name of metric specification. - :type name: str - :param display_name: Display name of metric specification. - :type display_name: str - :param display_description: Display description of metric specification. - :type display_description: str - :param unit: Unit could be Bytes or Count. - :type unit: str - :param dimensions: Dimensions of blobs, including blob type and access - tier. - :type dimensions: list[~azure.mgmt.storage.v2019_04_01.models.Dimension] - :param aggregation_type: Aggregation type could be Average. - :type aggregation_type: str - :param fill_gap_with_zero: The property to decide fill gap with zero or - not. - :type fill_gap_with_zero: bool - :param category: The category this metric specification belong to, could - be Capacity. - :type category: str - :param resource_id_dimension_name_override: Account Resource Id. - :type resource_id_dimension_name_override: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, - 'category': {'key': 'category', 'type': 'str'}, - 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, - } - - def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: - super(MetricSpecification, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.dimensions = dimensions - self.aggregation_type = aggregation_type - self.fill_gap_with_zero = fill_gap_with_zero - self.category = category - self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/network_rule_set.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/network_rule_set.py deleted file mode 100644 index c924af1bbf8f..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/network_rule_set.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2019_04_01.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2019_04_01.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: list[~azure.mgmt.storage.v2019_04_01.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2019_04_01.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, **kwargs): - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = kwargs.get('bypass', "AzureServices") - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.ip_rules = kwargs.get('ip_rules', None) - self.default_action = kwargs.get('default_action', "Allow") diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/network_rule_set_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/network_rule_set_py3.py deleted file mode 100644 index 38d573a031f4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/network_rule_set_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 NetworkRuleSet(Model): - """Network rule set. - - All required parameters must be populated in order to send to Azure. - - :param bypass: Specifies whether traffic is bypassed for - Logging/Metrics/AzureServices. Possible values are any combination of - Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None - to bypass none of those traffics. Possible values include: 'None', - 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . - :type bypass: str or ~azure.mgmt.storage.v2019_04_01.models.Bypass - :param virtual_network_rules: Sets the virtual network rules - :type virtual_network_rules: - list[~azure.mgmt.storage.v2019_04_01.models.VirtualNetworkRule] - :param ip_rules: Sets the IP ACL rules - :type ip_rules: list[~azure.mgmt.storage.v2019_04_01.models.IPRule] - :param default_action: Required. Specifies the default action of allow or - deny when no other rules match. Possible values include: 'Allow', 'Deny'. - Default value: "Allow" . - :type default_action: str or - ~azure.mgmt.storage.v2019_04_01.models.DefaultAction - """ - - _validation = { - 'default_action': {'required': True}, - } - - _attribute_map = { - 'bypass': {'key': 'bypass', 'type': 'str'}, - 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, - 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, - } - - def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: - super(NetworkRuleSet, self).__init__(**kwargs) - self.bypass = bypass - self.virtual_network_rules = virtual_network_rules - self.ip_rules = ip_rules - self.default_action = default_action diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation.py deleted file mode 100644 index 49bef4318cd6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~azure.mgmt.storage.v2019_04_01.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2019_04_01.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.service_specification = kwargs.get('service_specification', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation_display.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation_display.py deleted file mode 100644 index 029cfa2a8304..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation_display.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of 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(OperationDisplay, 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/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation_display_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation_display_py3.py deleted file mode 100644 index 318ba2236d3e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation_display_py3.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 OperationDisplay(Model): - """Display metadata associated with the operation. - - :param provider: Service provider: Microsoft Storage. - :type provider: str - :param resource: Resource on which the operation is performed etc. - :type resource: str - :param operation: Type of operation: get, read, delete, etc. - :type operation: str - :param description: Description of 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(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation_paged.py deleted file mode 100644 index 7e327f116faa..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation_py3.py deleted file mode 100644 index 9f976d75daa2..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/operation_py3.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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 Operation(Model): - """Storage REST API operation definition. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: Display metadata associated with the operation. - :type display: ~azure.mgmt.storage.v2019_04_01.models.OperationDisplay - :param origin: The origin of operations. - :type origin: str - :param service_specification: One property of operation, include metric - specifications. - :type service_specification: - ~azure.mgmt.storage.v2019_04_01.models.ServiceSpecification - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/proxy_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/proxy_resource.py deleted file mode 100644 index 0de8fb6bd420..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/proxy_resource.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 ProxyResource(Resource): - """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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/proxy_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/proxy_resource_py3.py deleted file mode 100644 index 2e8391f912d6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/proxy_resource_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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_py3 import Resource - - -class ProxyResource(Resource): - """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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/resource.py deleted file mode 100644 index 9333a2ac49ef..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/resource.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/resource_py3.py deleted file mode 100644 index 370e6c506581..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/resource_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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): - """Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :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(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/restriction.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/restriction.py deleted file mode 100644 index e40e1c1f94aa..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/restriction.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2019_04_01.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = kwargs.get('reason_code', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/restriction_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/restriction_py3.py deleted file mode 100644 index e0c2d9a67fee..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/restriction_py3.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 Restriction(Model): - """The restriction because of which SKU cannot be used. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar type: The type of restrictions. As of now only possible value for - this is location. - :vartype type: str - :ivar values: The value of restrictions. If the restriction type is set to - location. This would be different locations where the SKU is restricted. - :vartype values: list[str] - :param reason_code: The reason for the restriction. As of now this can be - "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU - has requiredQuotas parameter as the subscription does not belong to that - quota. The "NotAvailableForSubscription" is related to capacity at DC. - Possible values include: 'QuotaId', 'NotAvailableForSubscription' - :type reason_code: str or - ~azure.mgmt.storage.v2019_04_01.models.ReasonCode - """ - - _validation = { - 'type': {'readonly': True}, - 'values': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'values': {'key': 'values', 'type': '[str]'}, - 'reason_code': {'key': 'reasonCode', 'type': 'str'}, - } - - def __init__(self, *, reason_code=None, **kwargs) -> None: - super(Restriction, self).__init__(**kwargs) - self.type = None - self.values = None - self.reason_code = reason_code diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/service_sas_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/service_sas_parameters.py deleted file mode 100644 index 4cd3899f628c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/service_sas_parameters.py +++ /dev/null @@ -1,120 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2019_04_01.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2019_04_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2019_04_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = kwargs.get('canonicalized_resource', None) - self.resource = kwargs.get('resource', None) - self.permissions = kwargs.get('permissions', None) - self.ip_address_or_range = kwargs.get('ip_address_or_range', None) - self.protocols = kwargs.get('protocols', None) - self.shared_access_start_time = kwargs.get('shared_access_start_time', None) - self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) - self.identifier = kwargs.get('identifier', None) - self.partition_key_start = kwargs.get('partition_key_start', None) - self.partition_key_end = kwargs.get('partition_key_end', None) - self.row_key_start = kwargs.get('row_key_start', None) - self.row_key_end = kwargs.get('row_key_end', None) - self.key_to_sign = kwargs.get('key_to_sign', None) - self.cache_control = kwargs.get('cache_control', None) - self.content_disposition = kwargs.get('content_disposition', None) - self.content_encoding = kwargs.get('content_encoding', None) - self.content_language = kwargs.get('content_language', None) - self.content_type = kwargs.get('content_type', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/service_sas_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/service_sas_parameters_py3.py deleted file mode 100644 index a24081816f62..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/service_sas_parameters_py3.py +++ /dev/null @@ -1,120 +0,0 @@ -# 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 ServiceSasParameters(Model): - """The parameters to list service SAS credentials of a specific resource. - - All required parameters must be populated in order to send to Azure. - - :param canonicalized_resource: Required. The canonical path to the signed - resource. - :type canonicalized_resource: str - :param resource: The signed services accessible with the service SAS. - Possible values include: Blob (b), Container (c), File (f), Share (s). - Possible values include: 'b', 'c', 'f', 's' - :type resource: str or - ~azure.mgmt.storage.v2019_04_01.models.SignedResource - :param permissions: The signed permissions for the service SAS. Possible - values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create - (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', - 'l', 'a', 'c', 'u', 'p' - :type permissions: str or - ~azure.mgmt.storage.v2019_04_01.models.Permissions - :param ip_address_or_range: An IP address or a range of IP addresses from - which to accept requests. - :type ip_address_or_range: str - :param protocols: The protocol permitted for a request made with the - account SAS. Possible values include: 'https,http', 'https' - :type protocols: str or - ~azure.mgmt.storage.v2019_04_01.models.HttpProtocol - :param shared_access_start_time: The time at which the SAS becomes valid. - :type shared_access_start_time: datetime - :param shared_access_expiry_time: The time at which the shared access - signature becomes invalid. - :type shared_access_expiry_time: datetime - :param identifier: A unique value up to 64 characters in length that - correlates to an access policy specified for the container, queue, or - table. - :type identifier: str - :param partition_key_start: The start of partition key. - :type partition_key_start: str - :param partition_key_end: The end of partition key. - :type partition_key_end: str - :param row_key_start: The start of row key. - :type row_key_start: str - :param row_key_end: The end of row key. - :type row_key_end: str - :param key_to_sign: The key to sign the account SAS token with. - :type key_to_sign: str - :param cache_control: The response header override for cache control. - :type cache_control: str - :param content_disposition: The response header override for content - disposition. - :type content_disposition: str - :param content_encoding: The response header override for content - encoding. - :type content_encoding: str - :param content_language: The response header override for content - language. - :type content_language: str - :param content_type: The response header override for content type. - :type content_type: str - """ - - _validation = { - 'canonicalized_resource': {'required': True}, - 'identifier': {'max_length': 64}, - } - - _attribute_map = { - 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, - 'resource': {'key': 'signedResource', 'type': 'str'}, - 'permissions': {'key': 'signedPermission', 'type': 'str'}, - 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, - 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, - 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, - 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, - 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, - 'partition_key_start': {'key': 'startPk', 'type': 'str'}, - 'partition_key_end': {'key': 'endPk', 'type': 'str'}, - 'row_key_start': {'key': 'startRk', 'type': 'str'}, - 'row_key_end': {'key': 'endRk', 'type': 'str'}, - 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, - 'cache_control': {'key': 'rscc', 'type': 'str'}, - 'content_disposition': {'key': 'rscd', 'type': 'str'}, - 'content_encoding': {'key': 'rsce', 'type': 'str'}, - 'content_language': {'key': 'rscl', 'type': 'str'}, - 'content_type': {'key': 'rsct', 'type': 'str'}, - } - - def __init__(self, *, canonicalized_resource: str, resource=None, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: - super(ServiceSasParameters, self).__init__(**kwargs) - self.canonicalized_resource = canonicalized_resource - self.resource = resource - self.permissions = permissions - self.ip_address_or_range = ip_address_or_range - self.protocols = protocols - self.shared_access_start_time = shared_access_start_time - self.shared_access_expiry_time = shared_access_expiry_time - self.identifier = identifier - self.partition_key_start = partition_key_start - self.partition_key_end = partition_key_end - self.row_key_start = row_key_start - self.row_key_end = row_key_end - self.key_to_sign = key_to_sign - self.cache_control = cache_control - self.content_disposition = content_disposition - self.content_encoding = content_encoding - self.content_language = content_language - self.content_type = content_type diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/service_specification.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/service_specification.py deleted file mode 100644 index db089e502063..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/service_specification.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2019_04_01.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, **kwargs): - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/service_specification_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/service_specification_py3.py deleted file mode 100644 index b502df3f482e..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/service_specification_py3.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 ServiceSpecification(Model): - """One property of operation, include metric specifications. - - :param metric_specifications: Metric specifications of operation. - :type metric_specifications: - list[~azure.mgmt.storage.v2019_04_01.models.MetricSpecification] - """ - - _attribute_map = { - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, - } - - def __init__(self, *, metric_specifications=None, **kwargs) -> None: - super(ServiceSpecification, self).__init__(**kwargs) - self.metric_specifications = metric_specifications diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku.py deleted file mode 100644 index e471912d1bf9..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the SKU name. Required for account - creation; optional for update. Note that in older versions, SKU name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', - 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' - :type name: str or ~azure.mgmt.storage.v2019_04_01.models.SkuName - :ivar tier: Gets the SKU tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2019_04_01.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', - 'BlockBlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified SKU, - including file encryption, network ACLs, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2019_04_01.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2019_04_01.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = kwargs.get('restrictions', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku_capability.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku_capability.py deleted file mode 100644 index 3f27b5e45feb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku_capability.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified SKU, including file encryption, - network ACLs, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified SKU, including file encryption, network ACLs, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku_capability_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku_capability_py3.py deleted file mode 100644 index 5bc3628f2173..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku_capability_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 SKUCapability(Model): - """The capability information in the specified SKU, including file encryption, - network ACLs, change notification, etc. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of capability, The capability information in the - specified SKU, including file encryption, network ACLs, change - notification, etc. - :vartype name: str - :ivar value: A string value to indicate states of given capability. - Possibly 'true' or 'false'. - :vartype value: str - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(SKUCapability, self).__init__(**kwargs) - self.name = None - self.value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku_paged.py deleted file mode 100644 index 58fa2aef6602..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 SkuPaged(Paged): - """ - A paging container for iterating over a list of :class:`Sku ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Sku]'} - } - - def __init__(self, *args, **kwargs): - - super(SkuPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku_py3.py deleted file mode 100644 index bfcde8b058db..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/sku_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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 the storage account. - - 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. Gets or sets the SKU name. Required for account - creation; optional for update. Note that in older versions, SKU name was - called accountType. Possible values include: 'Standard_LRS', - 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', - 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' - :type name: str or ~azure.mgmt.storage.v2019_04_01.models.SkuName - :ivar tier: Gets the SKU tier. This is based on the SKU name. Possible - values include: 'Standard', 'Premium' - :vartype tier: str or ~azure.mgmt.storage.v2019_04_01.models.SkuTier - :ivar resource_type: The type of the resource, usually it is - 'storageAccounts'. - :vartype resource_type: str - :ivar kind: Indicates the type of storage account. Possible values - include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', - 'BlockBlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind - :ivar locations: The set of locations that the SKU is available. This will - be supported and registered Azure Geo Regions (e.g. West US, East US, - Southeast Asia, etc.). - :vartype locations: list[str] - :ivar capabilities: The capability information in the specified SKU, - including file encryption, network ACLs, change notification, etc. - :vartype capabilities: - list[~azure.mgmt.storage.v2019_04_01.models.SKUCapability] - :param restrictions: The restrictions because of which SKU cannot be used. - This is empty if there are no restrictions. - :type restrictions: - list[~azure.mgmt.storage.v2019_04_01.models.Restriction] - """ - - _validation = { - 'name': {'required': True}, - 'tier': {'readonly': True}, - 'resource_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'locations': {'readonly': True}, - 'capabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'SkuTier'}, - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, - 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, - } - - def __init__(self, *, name, restrictions=None, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = None - self.resource_type = None - self.kind = None - self.locations = None - self.capabilities = None - self.restrictions = restrictions diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account.py deleted file mode 100644 index d5edf738fe79..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account.py +++ /dev/null @@ -1,191 +0,0 @@ -# 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 .tracked_resource import TrackedResource - - -class StorageAccount(TrackedResource): - """The storage account. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2019_04_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2019_04_01.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2019_04_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2019_04_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2019_04_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2019_04_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2019_04_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2019_04_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2019_04_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2019_04_01.models.NetworkRuleSet - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. - :type is_hns_enabled: bool - :ivar geo_replication_stats: Geo Replication Stats - :vartype geo_replication_stats: - ~azure.mgmt.storage.v2019_04_01.models.GeoReplicationStats - :ivar failover_in_progress: If the failover is in progress, the value will - be true, otherwise, it will be null. - :vartype failover_in_progress: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'readonly': True}, - 'geo_replication_stats': {'readonly': True}, - 'failover_in_progress': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, - 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccount, self).__init__(**kwargs) - self.sku = None - self.kind = None - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) - self.network_rule_set = None - self.is_hns_enabled = kwargs.get('is_hns_enabled', None) - self.geo_replication_stats = None - self.failover_in_progress = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_check_name_availability_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_check_name_availability_parameters.py deleted file mode 100644 index dbe41bb2c6b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_check_name_availability_parameters.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, **kwargs): - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = kwargs.get('name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_check_name_availability_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_check_name_availability_parameters_py3.py deleted file mode 100644 index 8d2b031e2284..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_check_name_availability_parameters_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# 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 StorageAccountCheckNameAvailabilityParameters(Model): - """The parameters used to check the availability of the storage account name. - - 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 storage account name. - :type name: str - :ivar type: Required. The type of resource, - Microsoft.Storage/storageAccounts. Default value: - "Microsoft.Storage/storageAccounts" . - :vartype type: str - """ - - _validation = { - 'name': {'required': True}, - 'type': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - type = "Microsoft.Storage/storageAccounts" - - def __init__(self, *, name: str, **kwargs) -> None: - super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) - self.name = name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_create_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_create_parameters.py deleted file mode 100644 index 57752259a5eb..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_create_parameters.py +++ /dev/null @@ -1,102 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the SKU name. - :type sku: ~azure.mgmt.storage.v2019_04_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'StorageV2', 'BlobStorage', - 'FileStorage', 'BlockBlobStorage' - :type kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2019_04_01.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2019_04_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2019_04_01.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2019_04_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. - :type is_hns_enabled: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.kind = kwargs.get('kind', None) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) - self.is_hns_enabled = kwargs.get('is_hns_enabled', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_create_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_create_parameters_py3.py deleted file mode 100644 index 628fa15f9f02..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_create_parameters_py3.py +++ /dev/null @@ -1,102 +0,0 @@ -# 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 StorageAccountCreateParameters(Model): - """The parameters used when creating a storage account. - - All required parameters must be populated in order to send to Azure. - - :param sku: Required. Required. Gets or sets the SKU name. - :type sku: ~azure.mgmt.storage.v2019_04_01.models.Sku - :param kind: Required. Required. Indicates the type of storage account. - Possible values include: 'Storage', 'StorageV2', 'BlobStorage', - 'FileStorage', 'BlockBlobStorage' - :type kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind - :param location: Required. Required. Gets or sets the location of the - resource. This will be one of the supported and registered Azure Geo - Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a - resource cannot be changed once it is created, but if an identical geo - region is specified on update, the request will succeed. - :type location: str - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used for viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key with a length no greater than 128 - characters and a value with a length no greater than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2019_04_01.models.Identity - :param custom_domain: User domain assigned to the storage account. Name is - the CNAME source. Only one custom domain is supported per storage account - at this time. To clear the existing custom domain, use an empty string for - the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2019_04_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. If - left unspecified the account encryption settings will remain the same. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2019_04_01.models.NetworkRuleSet - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2019_04_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. - :type is_hns_enabled: bool - """ - - _validation = { - 'sku': {'required': True}, - 'kind': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - } - - def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None: - super(StorageAccountCreateParameters, self).__init__(**kwargs) - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.network_rule_set = network_rule_set - self.access_tier = access_tier - self.enable_azure_files_aad_integration = enable_azure_files_aad_integration - self.enable_https_traffic_only = enable_https_traffic_only - self.is_hns_enabled = is_hns_enabled diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_key.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_key.py deleted file mode 100644 index 49f9686d1503..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_key.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2019_04_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs): - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_key_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_key_py3.py deleted file mode 100644 index 2921ef20e6f0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_key_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 StorageAccountKey(Model): - """An access key for the storage account. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar key_name: Name of the key. - :vartype key_name: str - :ivar value: Base 64-encoded value of the key. - :vartype value: str - :ivar permissions: Permissions for the key -- read-only or full - permissions. Possible values include: 'Read', 'Full' - :vartype permissions: str or - ~azure.mgmt.storage.v2019_04_01.models.KeyPermission - """ - - _validation = { - 'key_name': {'readonly': True}, - 'value': {'readonly': True}, - 'permissions': {'readonly': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountKey, self).__init__(**kwargs) - self.key_name = None - self.value = None - self.permissions = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_list_keys_result.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_list_keys_result.py deleted file mode 100644 index 4af86cff5269..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_list_keys_result.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2019_04_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs): - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_list_keys_result_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_list_keys_result_py3.py deleted file mode 100644 index cce456a23b00..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_list_keys_result_py3.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 StorageAccountListKeysResult(Model): - """The response from the ListKeys operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar keys: Gets the list of storage account keys and their properties for - the specified storage account. - :vartype keys: - list[~azure.mgmt.storage.v2019_04_01.models.StorageAccountKey] - """ - - _validation = { - 'keys': {'readonly': True}, - } - - _attribute_map = { - 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, - } - - def __init__(self, **kwargs) -> None: - super(StorageAccountListKeysResult, self).__init__(**kwargs) - self.keys = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_paged.py deleted file mode 100644 index 71b6bf2be9a3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 StorageAccountPaged(Paged): - """ - A paging container for iterating over a list of :class:`StorageAccount ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[StorageAccount]'} - } - - def __init__(self, *args, **kwargs): - - super(StorageAccountPaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_py3.py deleted file mode 100644 index 1e714e68e25c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_py3.py +++ /dev/null @@ -1,191 +0,0 @@ -# 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 .tracked_resource_py3 import TrackedResource - - -class StorageAccount(TrackedResource): - """The storage account. - - 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar sku: Gets the SKU. - :vartype sku: ~azure.mgmt.storage.v2019_04_01.models.Sku - :ivar kind: Gets the Kind. Possible values include: 'Storage', - 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - :vartype kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2019_04_01.models.Identity - :ivar provisioning_state: Gets the status of the storage account at the - time the operation was called. Possible values include: 'Creating', - 'ResolvingDNS', 'Succeeded' - :vartype provisioning_state: str or - ~azure.mgmt.storage.v2019_04_01.models.ProvisioningState - :ivar primary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object. Note that Standard_ZRS - and Premium_LRS accounts only return the blob endpoint. - :vartype primary_endpoints: - ~azure.mgmt.storage.v2019_04_01.models.Endpoints - :ivar primary_location: Gets the location of the primary data center for - the storage account. - :vartype primary_location: str - :ivar status_of_primary: Gets the status indicating whether the primary - location of the storage account is available or unavailable. Possible - values include: 'available', 'unavailable' - :vartype status_of_primary: str or - ~azure.mgmt.storage.v2019_04_01.models.AccountStatus - :ivar last_geo_failover_time: Gets the timestamp of the most recent - instance of a failover to the secondary location. Only the most recent - timestamp is retained. This element is not returned if there has never - been a failover instance. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype last_geo_failover_time: datetime - :ivar secondary_location: Gets the location of the geo-replicated - secondary for the storage account. Only available if the accountType is - Standard_GRS or Standard_RAGRS. - :vartype secondary_location: str - :ivar status_of_secondary: Gets the status indicating whether the - secondary location of the storage account is available or unavailable. - Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible - values include: 'available', 'unavailable' - :vartype status_of_secondary: str or - ~azure.mgmt.storage.v2019_04_01.models.AccountStatus - :ivar creation_time: Gets the creation date and time of the storage - account in UTC. - :vartype creation_time: datetime - :ivar custom_domain: Gets the custom domain the user assigned to this - storage account. - :vartype custom_domain: - ~azure.mgmt.storage.v2019_04_01.models.CustomDomain - :ivar secondary_endpoints: Gets the URLs that are used to perform a - retrieval of a public blob, queue, or table object from the secondary - location of the storage account. Only available if the SKU name is - Standard_RAGRS. - :vartype secondary_endpoints: - ~azure.mgmt.storage.v2019_04_01.models.Endpoints - :ivar encryption: Gets the encryption settings on the account. If - unspecified, the account is unencrypted. - :vartype encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption - :ivar access_tier: Required for storage accounts where kind = BlobStorage. - The access tier used for billing. Possible values include: 'Hot', 'Cool' - :vartype access_tier: str or - ~azure.mgmt.storage.v2019_04_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :ivar network_rule_set: Network rule set - :vartype network_rule_set: - ~azure.mgmt.storage.v2019_04_01.models.NetworkRuleSet - :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to - true. - :type is_hns_enabled: bool - :ivar geo_replication_stats: Geo Replication Stats - :vartype geo_replication_stats: - ~azure.mgmt.storage.v2019_04_01.models.GeoReplicationStats - :ivar failover_in_progress: If the failover is in progress, the value will - be true, otherwise, it will be null. - :vartype failover_in_progress: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'sku': {'readonly': True}, - 'kind': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'primary_endpoints': {'readonly': True}, - 'primary_location': {'readonly': True}, - 'status_of_primary': {'readonly': True}, - 'last_geo_failover_time': {'readonly': True}, - 'secondary_location': {'readonly': True}, - 'status_of_secondary': {'readonly': True}, - 'creation_time': {'readonly': True}, - 'custom_domain': {'readonly': True}, - 'secondary_endpoints': {'readonly': True}, - 'encryption': {'readonly': True}, - 'access_tier': {'readonly': True}, - 'network_rule_set': {'readonly': True}, - 'geo_replication_stats': {'readonly': True}, - 'failover_in_progress': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, - 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, - 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, - 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, - 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, - 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, - 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, - 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, - 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, - } - - def __init__(self, *, location: str, tags=None, identity=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, **kwargs) -> None: - super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) - self.sku = None - self.kind = None - self.identity = identity - self.provisioning_state = None - self.primary_endpoints = None - self.primary_location = None - self.status_of_primary = None - self.last_geo_failover_time = None - self.secondary_location = None - self.status_of_secondary = None - self.creation_time = None - self.custom_domain = None - self.secondary_endpoints = None - self.encryption = None - self.access_tier = None - self.enable_azure_files_aad_integration = enable_azure_files_aad_integration - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = None - self.is_hns_enabled = is_hns_enabled - self.geo_replication_stats = None - self.failover_in_progress = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_regenerate_key_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_regenerate_key_parameters.py deleted file mode 100644 index 6dba2135fdc7..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_regenerate_key_parameters.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = kwargs.get('key_name', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_regenerate_key_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_regenerate_key_parameters_py3.py deleted file mode 100644 index 6e06a071eba3..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_regenerate_key_parameters_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 StorageAccountRegenerateKeyParameters(Model): - """The parameters used to regenerate the storage account key. - - All required parameters must be populated in order to send to Azure. - - :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. - :type key_name: str - """ - - _validation = { - 'key_name': {'required': True}, - } - - _attribute_map = { - 'key_name': {'key': 'keyName', 'type': 'str'}, - } - - def __init__(self, *, key_name: str, **kwargs) -> None: - super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_name = key_name diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_update_parameters.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_update_parameters.py deleted file mode 100644 index f42593e50e7c..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_update_parameters.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of - those SKU names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2019_04_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2019_04_01.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2019_04_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2019_04_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2019_04_01.models.NetworkRuleSet - :param kind: Optional. Indicates the type of storage account. Currently - only StorageV2 value supported by server. Possible values include: - 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - :type kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) - self.custom_domain = kwargs.get('custom_domain', None) - self.encryption = kwargs.get('encryption', None) - self.access_tier = kwargs.get('access_tier', None) - self.enable_azure_files_aad_integration = kwargs.get('enable_azure_files_aad_integration', None) - self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) - self.network_rule_set = kwargs.get('network_rule_set', None) - self.kind = kwargs.get('kind', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_update_parameters_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_update_parameters_py3.py deleted file mode 100644 index 95e7e3b0c723..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_account_update_parameters_py3.py +++ /dev/null @@ -1,83 +0,0 @@ -# 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 StorageAccountUpdateParameters(Model): - """The parameters that can be provided when updating the storage account - properties. - - :param sku: Gets or sets the SKU name. Note that the SKU name cannot be - updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of - those SKU names be updated to any other value. - :type sku: ~azure.mgmt.storage.v2019_04_01.models.Sku - :param tags: Gets or sets a list of key value pairs that describe the - resource. These tags can be used in viewing and grouping this resource - (across resource groups). A maximum of 15 tags can be provided for a - resource. Each tag must have a key no greater in length than 128 - characters and a value no greater in length than 256 characters. - :type tags: dict[str, str] - :param identity: The identity of the resource. - :type identity: ~azure.mgmt.storage.v2019_04_01.models.Identity - :param custom_domain: Custom domain assigned to the storage account by the - user. Name is the CNAME source. Only one custom domain is supported per - storage account at this time. To clear the existing custom domain, use an - empty string for the custom domain name property. - :type custom_domain: ~azure.mgmt.storage.v2019_04_01.models.CustomDomain - :param encryption: Provides the encryption settings on the account. The - default setting is unencrypted. - :type encryption: ~azure.mgmt.storage.v2019_04_01.models.Encryption - :param access_tier: Required for storage accounts where kind = - BlobStorage. The access tier used for billing. Possible values include: - 'Hot', 'Cool' - :type access_tier: str or - ~azure.mgmt.storage.v2019_04_01.models.AccessTier - :param enable_azure_files_aad_integration: Enables Azure Files AAD - Integration for SMB if sets to true. - :type enable_azure_files_aad_integration: bool - :param enable_https_traffic_only: Allows https traffic only to storage - service if sets to true. - :type enable_https_traffic_only: bool - :param network_rule_set: Network rule set - :type network_rule_set: - ~azure.mgmt.storage.v2019_04_01.models.NetworkRuleSet - :param kind: Optional. Indicates the type of storage account. Currently - only StorageV2 value supported by server. Possible values include: - 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' - :type kind: str or ~azure.mgmt.storage.v2019_04_01.models.Kind - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, - 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, - 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, - 'enable_azure_files_aad_integration': {'key': 'properties.azureFilesAadIntegration', 'type': 'bool'}, - 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, - 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, enable_azure_files_aad_integration: bool=None, enable_https_traffic_only: bool=None, network_rule_set=None, kind=None, **kwargs) -> None: - super(StorageAccountUpdateParameters, self).__init__(**kwargs) - self.sku = sku - self.tags = tags - self.identity = identity - self.custom_domain = custom_domain - self.encryption = encryption - self.access_tier = access_tier - self.enable_azure_files_aad_integration = enable_azure_files_aad_integration - self.enable_https_traffic_only = enable_https_traffic_only - self.network_rule_set = network_rule_set - self.kind = kind diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_management_client_enums.py deleted file mode 100644 index 91863e771145..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/storage_management_client_enums.py +++ /dev/null @@ -1,214 +0,0 @@ -# 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 ReasonCode(str, Enum): - - quota_id = "QuotaId" - not_available_for_subscription = "NotAvailableForSubscription" - - -class SkuName(str, Enum): - - standard_lrs = "Standard_LRS" - standard_grs = "Standard_GRS" - standard_ragrs = "Standard_RAGRS" - standard_zrs = "Standard_ZRS" - premium_lrs = "Premium_LRS" - premium_zrs = "Premium_ZRS" - standard_gzrs = "Standard_GZRS" - standard_ragzrs = "Standard_RAGZRS" - - -class SkuTier(str, Enum): - - standard = "Standard" - premium = "Premium" - - -class Kind(str, Enum): - - storage = "Storage" - storage_v2 = "StorageV2" - blob_storage = "BlobStorage" - file_storage = "FileStorage" - block_blob_storage = "BlockBlobStorage" - - -class Reason(str, Enum): - - account_name_invalid = "AccountNameInvalid" - already_exists = "AlreadyExists" - - -class KeySource(str, Enum): - - microsoft_storage = "Microsoft.Storage" - microsoft_keyvault = "Microsoft.Keyvault" - - -class Action(str, Enum): - - allow = "Allow" - - -class State(str, Enum): - - provisioning = "provisioning" - deprovisioning = "deprovisioning" - succeeded = "succeeded" - failed = "failed" - network_source_deleted = "networkSourceDeleted" - - -class Bypass(str, Enum): - - none = "None" - logging = "Logging" - metrics = "Metrics" - azure_services = "AzureServices" - - -class DefaultAction(str, Enum): - - allow = "Allow" - deny = "Deny" - - -class AccessTier(str, Enum): - - hot = "Hot" - cool = "Cool" - - -class GeoReplicationStatus(str, Enum): - - live = "Live" - bootstrap = "Bootstrap" - unavailable = "Unavailable" - - -class ProvisioningState(str, Enum): - - creating = "Creating" - resolving_dns = "ResolvingDNS" - succeeded = "Succeeded" - - -class AccountStatus(str, Enum): - - available = "available" - unavailable = "unavailable" - - -class KeyPermission(str, Enum): - - read = "Read" - full = "Full" - - -class UsageUnit(str, Enum): - - count = "Count" - bytes = "Bytes" - seconds = "Seconds" - percent = "Percent" - counts_per_second = "CountsPerSecond" - bytes_per_second = "BytesPerSecond" - - -class Services(str, Enum): - - b = "b" - q = "q" - t = "t" - f = "f" - - -class SignedResourceTypes(str, Enum): - - s = "s" - c = "c" - o = "o" - - -class Permissions(str, Enum): - - r = "r" - d = "d" - w = "w" - l = "l" - a = "a" - c = "c" - u = "u" - p = "p" - - -class HttpProtocol(str, Enum): - - httpshttp = "https,http" - https = "https" - - -class SignedResource(str, Enum): - - b = "b" - c = "c" - f = "f" - s = "s" - - -class PublicAccess(str, Enum): - - container = "Container" - blob = "Blob" - none = "None" - - -class LeaseStatus(str, Enum): - - locked = "Locked" - unlocked = "Unlocked" - - -class LeaseState(str, Enum): - - available = "Available" - leased = "Leased" - expired = "Expired" - breaking = "Breaking" - broken = "Broken" - - -class LeaseDuration(str, Enum): - - infinite = "Infinite" - fixed = "Fixed" - - -class ImmutabilityPolicyState(str, Enum): - - locked = "Locked" - unlocked = "Unlocked" - - -class ImmutabilityPolicyUpdateType(str, Enum): - - put = "put" - lock = "lock" - extend = "extend" - - -class StorageAccountExpand(str, Enum): - - geo_replication_stats = "geoReplicationStats" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/tag_property.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/tag_property.py deleted file mode 100644 index 3b879061fd2b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/tag_property.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 TagProperty(Model): - """A tag of the LegalHold of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tag: The tag value. - :vartype tag: str - :ivar timestamp: Returns the date and time the tag was added. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who added the - tag. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who added the tag. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who added the tag. - :vartype upn: str - """ - - _validation = { - 'tag': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'tag': {'key': 'tag', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TagProperty, self).__init__(**kwargs) - self.tag = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/tag_property_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/tag_property_py3.py deleted file mode 100644 index 22aaf6cb82ba..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/tag_property_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# 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 TagProperty(Model): - """A tag of the LegalHold of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar tag: The tag value. - :vartype tag: str - :ivar timestamp: Returns the date and time the tag was added. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who added the - tag. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who added the tag. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who added the tag. - :vartype upn: str - """ - - _validation = { - 'tag': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'tag': {'key': 'tag', 'type': 'str'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(TagProperty, self).__init__(**kwargs) - self.tag = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/tracked_resource.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/tracked_resource.py deleted file mode 100644 index 27ab94c7a8dd..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/tracked_resource.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 TrackedResource(Resource): - """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs.get('location', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/tracked_resource_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/tracked_resource_py3.py deleted file mode 100644 index b28cc1859448..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/tracked_resource_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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_py3 import Resource - - -class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: 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'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/update_history_property.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/update_history_property.py deleted file mode 100644 index b118e50b6ef0..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/update_history_property.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 UpdateHistoryProperty(Model): - """An update history of the ImmutabilityPolicy of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar update: The ImmutabilityPolicy update type of a blob container, - possible values include: put, lock and extend. Possible values include: - 'put', 'lock', 'extend' - :vartype update: str or - ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyUpdateType - :ivar immutability_period_since_creation_in_days: The immutability period - for the blobs in the container since the policy creation, in days. - :vartype immutability_period_since_creation_in_days: int - :ivar timestamp: Returns the date and time the ImmutabilityPolicy was - updated. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who updated the - ImmutabilityPolicy. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who updated the ImmutabilityPolicy. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who updated the - ImmutabilityPolicy. - :vartype upn: str - """ - - _validation = { - 'update': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'update': {'key': 'update', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UpdateHistoryProperty, self).__init__(**kwargs) - self.update = None - self.immutability_period_since_creation_in_days = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/update_history_property_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/update_history_property_py3.py deleted file mode 100644 index ee38de98973d..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/update_history_property_py3.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 UpdateHistoryProperty(Model): - """An update history of the ImmutabilityPolicy of a blob container. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar update: The ImmutabilityPolicy update type of a blob container, - possible values include: put, lock and extend. Possible values include: - 'put', 'lock', 'extend' - :vartype update: str or - ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicyUpdateType - :ivar immutability_period_since_creation_in_days: The immutability period - for the blobs in the container since the policy creation, in days. - :vartype immutability_period_since_creation_in_days: int - :ivar timestamp: Returns the date and time the ImmutabilityPolicy was - updated. - :vartype timestamp: datetime - :ivar object_identifier: Returns the Object ID of the user who updated the - ImmutabilityPolicy. - :vartype object_identifier: str - :ivar tenant_id: Returns the Tenant ID that issued the token for the user - who updated the ImmutabilityPolicy. - :vartype tenant_id: str - :ivar upn: Returns the User Principal Name of the user who updated the - ImmutabilityPolicy. - :vartype upn: str - """ - - _validation = { - 'update': {'readonly': True}, - 'immutability_period_since_creation_in_days': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'object_identifier': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'upn': {'readonly': True}, - } - - _attribute_map = { - 'update': {'key': 'update', 'type': 'str'}, - 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'upn': {'key': 'upn', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UpdateHistoryProperty, self).__init__(**kwargs) - self.update = None - self.immutability_period_since_creation_in_days = None - self.timestamp = None - self.object_identifier = None - self.tenant_id = None - self.upn = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage.py deleted file mode 100644 index 0dfcde28431a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2019_04_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2019_04_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs): - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage_name.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage_name.py deleted file mode 100644 index e4082bf52384..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage_name.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage_name_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage_name_py3.py deleted file mode 100644 index f519bb5072b1..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage_name_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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 UsageName(Model): - """The usage names that can be used; currently limited to StorageAccount. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: Gets a string describing the resource name. - :vartype value: str - :ivar localized_value: Gets a localized string describing the resource - name. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(UsageName, self).__init__(**kwargs) - self.value = None - self.localized_value = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage_paged.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage_paged.py deleted file mode 100644 index e45bf8914d6a..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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 UsagePaged(Paged): - """ - A paging container for iterating over a list of :class:`Usage ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Usage]'} - } - - def __init__(self, *args, **kwargs): - - super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage_py3.py deleted file mode 100644 index aa75e481427b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/usage_py3.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 Usage(Model): - """Describes Storage Resource Usage. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar unit: Gets the unit of measurement. Possible values include: - 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', - 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.storage.v2019_04_01.models.UsageUnit - :ivar current_value: Gets the current count of the allocated resources in - the subscription. - :vartype current_value: int - :ivar limit: Gets the maximum count of the resources that can be allocated - in the subscription. - :vartype limit: int - :ivar name: Gets the name of the type of usage. - :vartype name: ~azure.mgmt.storage.v2019_04_01.models.UsageName - """ - - _validation = { - 'unit': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - } - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'UsageUnit'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__(self, **kwargs) -> None: - super(Usage, self).__init__(**kwargs) - self.unit = None - self.current_value = None - self.limit = None - self.name = None diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/virtual_network_rule.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/virtual_network_rule.py deleted file mode 100644 index 717d50be9317..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/virtual_network_rule.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2019_04_01.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2019_04_01.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, **kwargs): - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) - self.action = kwargs.get('action', "Allow") - self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/virtual_network_rule_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/virtual_network_rule_py3.py deleted file mode 100644 index 4bbc306c0a53..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/virtual_network_rule_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 VirtualNetworkRule(Model): - """Virtual Network rule. - - All required parameters must be populated in order to send to Azure. - - :param virtual_network_resource_id: Required. Resource ID of a subnet, for - example: - /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - :type virtual_network_resource_id: str - :param action: The action of virtual network rule. Possible values - include: 'Allow'. Default value: "Allow" . - :type action: str or ~azure.mgmt.storage.v2019_04_01.models.Action - :param state: Gets the state of virtual network rule. Possible values - include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', - 'networkSourceDeleted' - :type state: str or ~azure.mgmt.storage.v2019_04_01.models.State - """ - - _validation = { - 'virtual_network_resource_id': {'required': True}, - } - - _attribute_map = { - 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, - 'action': {'key': 'action', 'type': 'Action'}, - 'state': {'key': 'state', 'type': 'State'}, - } - - def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(**kwargs) - self.virtual_network_resource_id = virtual_network_resource_id - self.action = action - self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/__init__.py index 2e0271d17068..7bb554454062 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/__init__.py @@ -9,13 +9,13 @@ # regenerated. # -------------------------------------------------------------------------- -from .operations import Operations -from .skus_operations import SkusOperations -from .storage_accounts_operations import StorageAccountsOperations -from .usages_operations import UsagesOperations -from .management_policies_operations import ManagementPoliciesOperations -from .blob_services_operations import BlobServicesOperations -from .blob_containers_operations import BlobContainersOperations +from ._operations import Operations +from ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._usages_operations import UsagesOperations +from ._management_policies_operations import ManagementPoliciesOperations +from ._blob_services_operations import BlobServicesOperations +from ._blob_containers_operations import BlobContainersOperations __all__ = [ 'Operations', diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_containers_operations.py new file mode 100644 index 000000000000..9efaa3347244 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_containers_operations.py @@ -0,0 +1,1146 @@ +# 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 BlobContainersOperations(object): + """BlobContainersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2019-04-01". + :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + self.immutability_policy_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, skip_token=None, maxpagesize=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists all containers and does not support a prefix like data plane. + Also SRP today does not return continuation token. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param skip_token: Optional. Continuation token for the list + operation. + :type skip_token: str + :param maxpagesize: Optional. Specified maximum number of containers + that can be included in the list. + :type maxpagesize: str + :param filter: Optional. When specified, only container names starting + with the filter will be listed. + :type filter: 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 ListContainerItem + :rtype: + ~azure.mgmt.storage.v2019_04_01.models.ListContainerItemPaged[~azure.mgmt.storage.v2019_04_01.models.ListContainerItem] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.ListContainerItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} + + def create( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Creates a new container under the specified account as described by + request body. The container resource includes metadata and properties + for that container. It does not include a list of the blobs contained + by the container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2019_04_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('BlobContainer', response) + if response.status_code == 201: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def update( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Updates container properties as specified in request body. Properties + not mentioned in the request will be unchanged. Update fails if the + specified container doesn't already exist. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2019_04_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(blob_container, 'BlobContainer') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def get( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Gets properties of a specified container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_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: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def delete( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Deletes specified container under its account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def set_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Sets legal hold tags. Setting the same tag results in an idempotent + operation. SetLegalHold follows an append pattern and does not clear + out the existing tags that are not specified in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.set_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} + + def clear_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Clears legal hold tags. Clearing the same or non-existent tag results + in an idempotent operation. ClearLegalHold clears out only the + specified tags in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.clear_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} + + def create_or_update_immutability_policy( + self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an unlocked immutability policy. ETag in If-Match is + honored if given but not required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.create_or_update_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def get_immutability_policy( + self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): + """Gets the existing immutability policy along with the corresponding ETag + in response headers and body. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def delete_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Aborts an unlocked immutability policy. The response of delete has + immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is + required for this operation. Deleting a locked immutability policy is + not allowed, only way is to delete the container after deleting all + blobs inside the container. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def lock_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Sets the ImmutabilityPolicy to Locked state. The only action allowed on + a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is + required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lock_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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, header_parameters) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} + + def extend_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): + """Extends the immutabilityPeriodSinceCreationInDays of a locked + immutabilityPolicy. The only action allowed on a Locked policy will be + this action. ETag in If-Match is required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) + + # Construct URL + url = self.extend_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} + + def lease( + self, resource_group_name, account_name, container_name, parameters=None, custom_headers=None, raw=False, **operation_config): + """The Lease Container operation establishes and manages a lock on a + container for delete operations. The lock duration can be 15 to 60 + seconds, or can be infinite. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param parameters: Lease Container request body. + :type parameters: + ~azure.mgmt.storage.v2019_04_01.models.LeaseContainerRequest + :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: LeaseContainerResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.LeaseContainerResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lease.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseContainerRequest') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('LeaseContainerResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_services_operations.py new file mode 100644 index 000000000000..f4da4bd3f6f8 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_blob_services_operations.py @@ -0,0 +1,185 @@ +# 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 BlobServicesOperations(object): + """BlobServicesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2019-04-01". + :ivar blob_services_name: The name of the blob Service within the specified storage account. Blob Service Name must be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + self.blob_services_name = "default" + + self.config = config + + def set_service_properties( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """Sets the properties of a storage account’s Blob service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Blob service, + including properties for Storage Analytics and CORS (Cross-Origin + Resource Sharing) rules. + :type parameters: + ~azure.mgmt.storage.v2019_04_01.models.BlobServiceProperties + :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: BlobServiceProperties or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.set_service_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'BlobServiceProperties') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('BlobServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} + + def get_service_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of a storage account’s Blob service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: BlobServiceProperties or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_service_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('BlobServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_management_policies_operations.py new file mode 100644 index 000000000000..167b9ac29f2c --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_management_policies_operations.py @@ -0,0 +1,242 @@ +# 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 ManagementPoliciesOperations(object): + """ManagementPoliciesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2019-04-01". + :ivar management_policy_name: The name of the Storage Account Management Policy. It should always be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + self.management_policy_name = "default" + + self.config = config + + def get( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the managementpolicy associated with the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: ManagementPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('ManagementPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} + + def create_or_update( + self, resource_group_name, account_name, policy, custom_headers=None, raw=False, **operation_config): + """Sets the managementpolicy to the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param policy: The Storage Account ManagementPolicy, in JSON format. + See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: + ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicySchema + :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: ManagementPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + properties = models.ManagementPolicy(policy=policy) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(properties, 'ManagementPolicy') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ManagementPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes the managementpolicy associated with the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_operations.py new file mode 100644 index 000000000000..2aae0f997b55 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_operations.py @@ -0,0 +1,102 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Storage 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 Operation + :rtype: + ~azure.mgmt.storage.v2019_04_01.models.OperationPaged[~azure.mgmt.storage.v2019_04_01.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_skus_operations.py new file mode 100644 index 000000000000..6fbea1b2d268 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_skus_operations.py @@ -0,0 +1,107 @@ +# 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 SkusOperations(object): + """SkusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the available SKUs supported by Microsoft.Storage for given + 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 Sku + :rtype: + ~azure.mgmt.storage.v2019_04_01.models.SkuPaged[~azure.mgmt.storage.v2019_04_01.models.Sku] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..0ec6ee010534 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_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 StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: The storage account name. + :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2019_04_01.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) + + # 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', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2019_04_01.models.StorageAccountCreateParameters + :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 StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2019_04_01.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2019_04_01.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param expand: May be used to expand the properties within account's + properties. By default, data is not included when fetching properties. + Currently we only support geoReplicationStats. Possible values + include: 'geoReplicationStats' + :type expand: str or + ~azure.mgmt.storage.v2019_04_01.models.StorageAccountExpand + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'StorageAccountExpand') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2019_04_01.models.StorageAccountUpdateParameters + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2019_04_01.models.StorageAccountPaged[~azure.mgmt.storage.v2019_04_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2019_04_01.models.StorageAccountPaged[~azure.mgmt.storage.v2019_04_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2019_04_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: The name of storage keys that want to be regenerated, + possible values are key1, key2. + :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2019_04_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} + + def list_account_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials + for the storage account. + :type parameters: + ~azure.mgmt.storage.v2019_04_01.models.AccountSasParameters + :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: ListAccountSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.ListAccountSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_account_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'AccountSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListAccountSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} + + def list_service_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS + credentials. + :type parameters: + ~azure.mgmt.storage.v2019_04_01.models.ServiceSasParameters + :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: ListServiceSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_04_01.models.ListServiceSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_service_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(parameters, 'ServiceSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ListServiceSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} + + + def _failover_initial( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.failover.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, 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 failover( + self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Failover request can be triggered for a storage account in case of + availability issues. The failover occurs from the storage account's + primary cluster to secondary cluster for RA-GRS accounts. The secondary + cluster will become primary after failover. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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._failover_initial( + resource_group_name=resource_group_name, + account_name=account_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, lro_options={'final-state-via': 'location'}, **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) + failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} + + def revoke_user_delegation_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Revoke user delegation keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.revoke_user_delegation_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + revoke_user_delegation_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_usages_operations.py new file mode 100644 index 000000000000..0d0a3cae7151 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_usages_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class UsagesOperations(object): + """UsagesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list_by_location( + self, location, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources of the + location under the subscription. + + :param location: The location of the Azure Storage resource. + :type location: 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 Usage + :rtype: + ~azure.mgmt.storage.v2019_04_01.models.UsagePaged[~azure.mgmt.storage.v2019_04_01.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, '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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/blob_containers_operations.py deleted file mode 100644 index b9dbfebe1ce4..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/blob_containers_operations.py +++ /dev/null @@ -1,1130 +0,0 @@ -# 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 BlobContainersOperations(object): - """BlobContainersOperations 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 API version to use for this operation. Constant value: "2019-04-01". - :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01" - self.immutability_policy_name = "default" - - self.config = config - - def list( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists all containers and does not support a prefix like data plane. - Also SRP today does not return continuation token. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: ListContainerItems or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.ListContainerItems or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('ListContainerItems', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} - - def create( - self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): - """Creates a new container under the specified account as described by - request body. The container resource includes metadata and properties - for that container. It does not include a list of the blobs contained - by the container. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2019_04_01.models.PublicAccess - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: 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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobContainer or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) - - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(blob_container, 'BlobContainer') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('BlobContainer', response) - if response.status_code == 201: - deserialized = self._deserialize('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def update( - self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): - """Updates container properties as specified in request body. Properties - not mentioned in the request will be unchanged. Update fails if the - specified container doesn't already exist. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param public_access: Specifies whether data in the container may be - accessed publicly and the level of access. Possible values include: - 'Container', 'Blob', 'None' - :type public_access: str or - ~azure.mgmt.storage.v2019_04_01.models.PublicAccess - :param metadata: A name-value pair to associate with the container as - metadata. - :type metadata: 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 - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobContainer or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(blob_container, 'BlobContainer') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def get( - self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): - """Gets properties of a specified container. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_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: BlobContainer or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobContainer or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('BlobContainer', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def delete( - self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): - """Deletes specified container under its account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} - - def set_legal_hold( - self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): - """Sets legal hold tags. Setting the same tag results in an idempotent - operation. SetLegalHold follows an append pattern and does not clear - out the existing tags that are not specified in the request. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param tags: Each tag should be 3 to 23 alphanumeric characters and is - normalized to lower case at SRP. - :type tags: list[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: LegalHold or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.LegalHold or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - legal_hold = models.LegalHold(tags=tags) - - # Construct URL - url = self.set_legal_hold.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(legal_hold, 'LegalHold') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LegalHold', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} - - def clear_legal_hold( - self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): - """Clears legal hold tags. Clearing the same or non-existent tag results - in an idempotent operation. ClearLegalHold clears out only the - specified tags in the request. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param tags: Each tag should be 3 to 23 alphanumeric characters and is - normalized to lower case at SRP. - :type tags: list[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: LegalHold or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.LegalHold or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - legal_hold = models.LegalHold(tags=tags) - - # Construct URL - url = self.clear_legal_hold.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(legal_hold, 'LegalHold') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LegalHold', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} - - def create_or_update_immutability_policy( - self, resource_group_name, account_name, container_name, immutability_period_since_creation_in_days, if_match=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates an unlocked immutability policy. ETag in If-Match is - honored if given but not required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param immutability_period_since_creation_in_days: The immutability - period for the blobs in the container since the policy creation, in - days. - :type immutability_period_since_creation_in_days: int - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = None - if immutability_period_since_creation_in_days is not None: - parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) - - # Construct URL - url = self.create_or_update_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') - else: - body_content = None - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def get_immutability_policy( - self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): - """Gets the existing immutability policy along with the corresponding ETag - in response headers and body. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def delete_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): - """Aborts an unlocked immutability policy. The response of delete has - immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is - required for this operation. Deleting a locked immutability policy is - not allowed, only way is to delete the container after deleting all - blobs inside the container. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} - - def lock_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): - """Sets the ImmutabilityPolicy to Locked state. The only action allowed on - a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is - required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.lock_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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, header_parameters) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} - - def extend_immutability_policy( - self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days, custom_headers=None, raw=False, **operation_config): - """Extends the immutabilityPeriodSinceCreationInDays of a locked - immutabilityPolicy. The only action allowed on a Locked policy will be - this action. ETag in If-Match is required for this operation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param if_match: The entity state (ETag) version of the immutability - policy to update. A value of "*" can be used to apply the operation - only if the immutability policy already exists. If omitted, this - operation will always be applied. - :type if_match: str - :param immutability_period_since_creation_in_days: The immutability - period for the blobs in the container since the policy creation, in - days. - :type immutability_period_since_creation_in_days: int - :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: ImmutabilityPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.ImmutabilityPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = None - if immutability_period_since_creation_in_days is not None: - parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days) - - # Construct URL - url = self.extend_immutability_policy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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) - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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 - header_dict = {} - - if response.status_code == 200: - deserialized = self._deserialize('ImmutabilityPolicy', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} - - def lease( - self, resource_group_name, account_name, container_name, parameters=None, custom_headers=None, raw=False, **operation_config): - """The Lease Container operation establishes and manages a lock on a - container for delete operations. The lock duration can be 15 to 60 - seconds, or can be infinite. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param container_name: The name of the blob container within the - specified storage account. Blob container names must be between 3 and - 63 characters in length and use numbers, lower-case letters and dash - (-) only. Every dash (-) character must be immediately preceded and - followed by a letter or number. - :type container_name: str - :param parameters: Lease Container request body. - :type parameters: - ~azure.mgmt.storage.v2019_04_01.models.LeaseContainerRequest - :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: LeaseContainerResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.LeaseContainerResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.lease.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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 - if parameters is not None: - body_content = self._serialize.body(parameters, 'LeaseContainerRequest') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('LeaseContainerResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/blob_services_operations.py deleted file mode 100644 index f55eca4800d6..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/blob_services_operations.py +++ /dev/null @@ -1,185 +0,0 @@ -# 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 BlobServicesOperations(object): - """BlobServicesOperations 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 API version to use for this operation. Constant value: "2019-04-01". - :ivar blob_services_name: The name of the blob Service within the specified storage account. Blob Service Name must be 'default'. Constant value: "default". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01" - self.blob_services_name = "default" - - self.config = config - - def set_service_properties( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """Sets the properties of a storage account’s Blob service, including - properties for Storage Analytics and CORS (Cross-Origin Resource - Sharing) rules. . - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The properties of a storage account’s Blob service, - including properties for Storage Analytics and CORS (Cross-Origin - Resource Sharing) rules. - :type parameters: - ~azure.mgmt.storage.v2019_04_01.models.BlobServiceProperties - :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: BlobServiceProperties or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobServiceProperties - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.set_service_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'BlobServiceProperties') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('BlobServiceProperties', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} - - def get_service_properties( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Gets the properties of a storage account’s Blob service, including - properties for Storage Analytics and CORS (Cross-Origin Resource - Sharing) rules. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: BlobServiceProperties or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.BlobServiceProperties - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_service_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('BlobServiceProperties', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/management_policies_operations.py deleted file mode 100644 index 667a1b660958..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/management_policies_operations.py +++ /dev/null @@ -1,242 +0,0 @@ -# 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 ManagementPoliciesOperations(object): - """ManagementPoliciesOperations 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 API version to use for this operation. Constant value: "2019-04-01". - :ivar management_policy_name: The name of the Storage Account Management Policy. It should always be 'default'. Constant value: "default". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01" - self.management_policy_name = "default" - - self.config = config - - def get( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Gets the managementpolicy associated with the specified storage - account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: ManagementPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('ManagementPolicy', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} - - def create_or_update( - self, resource_group_name, account_name, policy, custom_headers=None, raw=False, **operation_config): - """Sets the managementpolicy to the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param policy: The Storage Account ManagementPolicy, in JSON format. - See more details in: - https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: - ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicySchema - :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: ManagementPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.ManagementPolicy or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - properties = models.ManagementPolicy(policy=policy) - - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(properties, 'ManagementPolicy') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ManagementPolicy', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes the managementpolicy associated with the specified storage - account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_name, '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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/operations.py deleted file mode 100644 index 6ec629032033..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/operations.py +++ /dev/null @@ -1,98 +0,0 @@ -# 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 API version to use for this operation. Constant value: "2019-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available Storage 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 Operation - :rtype: - ~azure.mgmt.storage.v2019_04_01.models.OperationPaged[~azure.mgmt.storage.v2019_04_01.models.Operation] - :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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.OperationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Storage/operations'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/skus_operations.py deleted file mode 100644 index f33d57c8c62b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/skus_operations.py +++ /dev/null @@ -1,103 +0,0 @@ -# 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 SkusOperations(object): - """SkusOperations 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 API version to use for this operation. Constant value: "2019-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists the available SKUs supported by Microsoft.Storage for given - 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 Sku - :rtype: - ~azure.mgmt.storage.v2019_04_01.models.SkuPaged[~azure.mgmt.storage.v2019_04_01.models.Sku] - :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', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.SkuPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SkuPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/storage_accounts_operations.py deleted file mode 100644 index 3230db0a8b2b..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/storage_accounts_operations.py +++ /dev/null @@ -1,991 +0,0 @@ -# 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 StorageAccountsOperations(object): - """StorageAccountsOperations 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 API version to use for this operation. Constant value: "2019-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01" - - self.config = config - - def check_name_availability( - self, name, custom_headers=None, raw=False, **operation_config): - """Checks that the storage account name is valid and is not already in - use. - - :param name: The storage account name. - :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: CheckNameAvailabilityResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2019_04_01.models.CheckNameAvailabilityResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) - - # 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', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('CheckNameAvailabilityResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} - - - def _create_initial( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountCreateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Asynchronously creates a new storage account with the specified - parameters. If an account is already created and a subsequent create - request is issued with different properties, the account properties - will be updated. If an account is already created and a subsequent - create or update request is issued with the exact same set of - properties, the request will succeed. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the created account. - :type parameters: - ~azure.mgmt.storage.v2019_04_01.models.StorageAccountCreateParameters - :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 StorageAccount or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2019_04_01.models.StorageAccount] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2019_04_01.models.StorageAccount]] - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('StorageAccount', 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.Storage/storageAccounts/{accountName}'} - - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes a storage account in Microsoft Azure. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def get_properties( - self, resource_group_name, account_name, expand=None, custom_headers=None, raw=False, **operation_config): - """Returns the properties for the specified storage account including but - not limited to name, SKU name, location, and account status. The - ListKeys operation should be used to retrieve storage keys. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param expand: May be used to expand the properties within account's - properties. By default, data is not included when fetching properties. - Currently we only support geoReplicationStats. Possible values - include: 'geoReplicationStats' - :type expand: str or - ~azure.mgmt.storage.v2019_04_01.models.StorageAccountExpand - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_properties.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'StorageAccountExpand') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def update( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """The update operation can be used to update the SKU, encryption, access - tier, or tags for a storage account. It can also be used to map the - account to a custom domain. Only one custom domain is supported per - storage account; the replacement/change of custom domain is not - supported. In order to replace an old custom domain, the old value must - be cleared/unregistered before a new value can be set. The update of - multiple properties is supported. This call does not change the storage - keys for the account. If you want to change the storage account keys, - use the regenerate keys operation. The location and name of the storage - account cannot be changed after creation. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide for the updated account. - :type parameters: - ~azure.mgmt.storage.v2019_04_01.models.StorageAccountUpdateParameters - :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: StorageAccount or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.StorageAccount or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'StorageAccountUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccount', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the subscription. Note - that storage keys are not returned; use the ListKeys operation for - this. - - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2019_04_01.models.StorageAccountPaged[~azure.mgmt.storage.v2019_04_01.models.StorageAccount] - :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', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists all the storage accounts available under the given resource - group. Note that storage keys are not returned; use the ListKeys - operation for this. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :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 StorageAccount - :rtype: - ~azure.mgmt.storage.v2019_04_01.models.StorageAccountPaged[~azure.mgmt.storage.v2019_04_01.models.StorageAccount] - :raises: :class:`CloudError` - """ - 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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.StorageAccountPaged(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.Storage/storageAccounts'} - - def list_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2019_04_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} - - def regenerate_key( - self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerates one of the access keys for the specified storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param key_name: The name of storage keys that want to be regenerated, - possible values are key1, key2. - :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true - :rtype: - ~azure.mgmt.storage.v2019_04_01.models.StorageAccountListKeysResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) - - # Construct URL - url = self.regenerate_key.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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_key1, 'StorageAccountRegenerateKeyParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('StorageAccountListKeysResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} - - def list_account_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List SAS credentials of a storage account. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list SAS credentials - for the storage account. - :type parameters: - ~azure.mgmt.storage.v2019_04_01.models.AccountSasParameters - :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: ListAccountSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.ListAccountSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_account_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'AccountSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListAccountSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} - - def list_service_sas( - self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): - """List service SAS credentials of a specific resource. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_name: str - :param parameters: The parameters to provide to list service SAS - credentials. - :type parameters: - ~azure.mgmt.storage.v2019_04_01.models.ServiceSasParameters - :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: ListServiceSasResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.storage.v2019_04_01.models.ListServiceSasResponse - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_service_sas.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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(parameters, 'ServiceSasParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, 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('ListServiceSasResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} - - - def _failover_initial( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.failover.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, 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 failover( - self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Failover request can be triggered for a storage account in case of - availability issues. The failover occurs from the storage account's - primary cluster to secondary cluster for RA-GRS accounts. The secondary - cluster will become primary after failover. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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._failover_initial( - resource_group_name=resource_group_name, - account_name=account_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, lro_options={'final-state-via': 'location'}, **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) - failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} - - def revoke_user_delegation_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Revoke user delegation keys. - - :param resource_group_name: The name of the resource group within the - user's subscription. The name is case insensitive. - :type resource_group_name: str - :param account_name: The name of the storage account within the - specified resource group. Storage account names must be between 3 and - 24 characters in length and use numbers and lower-case letters only. - :type account_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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.revoke_user_delegation_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - 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', min_length=1) - - # Construct headers - header_parameters = {} - 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, header_parameters) - response = self._client.send(request, 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 - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - revoke_user_delegation_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/usages_operations.py deleted file mode 100644 index ce8e27976551..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/usages_operations.py +++ /dev/null @@ -1,106 +0,0 @@ -# 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 UsagesOperations(object): - """UsagesOperations 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 API version to use for this operation. Constant value: "2019-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-04-01" - - self.config = config - - def list_by_location( - self, location, custom_headers=None, raw=False, **operation_config): - """Gets the current usage count and the limit for the resources of the - location under the subscription. - - :param location: The location of the Azure Storage resource. - :type location: 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 Usage - :rtype: - ~azure.mgmt.storage.v2019_04_01.models.UsagePaged[~azure.mgmt.storage.v2019_04_01.models.Usage] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_location.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, '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', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - 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, header_parameters) - response = self._client.send(request, 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.UsagePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/storage_management_client.py deleted file mode 100644 index 5832795dd281..000000000000 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/storage_management_client.py +++ /dev/null @@ -1,111 +0,0 @@ -# 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.operations import Operations -from .operations.skus_operations import SkusOperations -from .operations.storage_accounts_operations import StorageAccountsOperations -from .operations.usages_operations import UsagesOperations -from .operations.management_policies_operations import ManagementPoliciesOperations -from .operations.blob_services_operations import BlobServicesOperations -from .operations.blob_containers_operations import BlobContainersOperations -from . import models - - -class StorageManagementClientConfiguration(AzureConfiguration): - """Configuration for StorageManagementClient - 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 ID of the target subscription. - :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(StorageManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-storage/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class StorageManagementClient(SDKClient): - """The Azure Storage Management API. - - :ivar config: Configuration for client. - :vartype config: StorageManagementClientConfiguration - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.storage.v2019_04_01.operations.Operations - :ivar skus: Skus operations - :vartype skus: azure.mgmt.storage.v2019_04_01.operations.SkusOperations - :ivar storage_accounts: StorageAccounts operations - :vartype storage_accounts: azure.mgmt.storage.v2019_04_01.operations.StorageAccountsOperations - :ivar usages: Usages operations - :vartype usages: azure.mgmt.storage.v2019_04_01.operations.UsagesOperations - :ivar management_policies: ManagementPolicies operations - :vartype management_policies: azure.mgmt.storage.v2019_04_01.operations.ManagementPoliciesOperations - :ivar blob_services: BlobServices operations - :vartype blob_services: azure.mgmt.storage.v2019_04_01.operations.BlobServicesOperations - :ivar blob_containers: BlobContainers operations - :vartype blob_containers: azure.mgmt.storage.v2019_04_01.operations.BlobContainersOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) - super(StorageManagementClient, 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 = '2019-04-01' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.skus = SkusOperations( - self._client, self.config, self._serialize, self._deserialize) - self.storage_accounts = StorageAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.usages = UsagesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.management_policies = ManagementPoliciesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.blob_services = BlobServicesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.blob_containers = BlobContainersOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/version.py index c3bf8a0d56e4..5a310ec590fb 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "3.3.0" +VERSION = "4.0.0" diff --git a/sdk/storage/azure-mgmt-storage/dev_requirements.txt b/sdk/storage/azure-mgmt-storage/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/storage/azure-mgmt-storage/dev_requirements.txt +++ b/sdk/storage/azure-mgmt-storage/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/sdk/template/azure-template/dev_requirements.txt b/sdk/template/azure-template/dev_requirements.txt index 8ffd9e3035d1..f6457a93d5e8 100644 --- a/sdk/template/azure-template/dev_requirements.txt +++ b/sdk/template/azure-template/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools \ No newline at end of file +-e ../../../tools/azure-sdk-tools \ No newline at end of file diff --git a/sdk/template/azure-template/sdk_packaging.toml b/sdk/template/azure-template/sdk_packaging.toml index 3552517db4bf..0d4f9aa5f7d1 100644 --- a/sdk/template/azure-template/sdk_packaging.toml +++ b/sdk/template/azure-template/sdk_packaging.toml @@ -1,9 +1,9 @@ [packaging] -auto_update = true +auto_update = false package_name = "azure-template" package_pprint_name = "Template Package" is_stable = false is_arm = false # Package owners should uncomment and set this doc id. -# package_doc_id = "" +# package_doc_id = "" diff --git a/sdk/trafficmanager/azure-mgmt-trafficmanager/dev_requirements.txt b/sdk/trafficmanager/azure-mgmt-trafficmanager/dev_requirements.txt index 1f0e0d86b735..6ccb7f031ddd 100644 --- a/sdk/trafficmanager/azure-mgmt-trafficmanager/dev_requirements.txt +++ b/sdk/trafficmanager/azure-mgmt-trafficmanager/dev_requirements.txt @@ -1 +1 @@ --e ../../../azure-sdk-tools +-e ../../../tools/azure-sdk-tools diff --git a/shared_requirements.txt b/shared_requirements.txt index d5c48d3227ac..830c1d354648 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -87,7 +87,7 @@ azure-storage-queue~=1.3 cryptography>=2.1.4 futures typing -msal>=0.3.1 +msal~=0.3.1 msrest>=0.5.0 msrestazure<2.0.0,>=0.4.32 requests>=2.18.4 diff --git a/tools/azure-devtools/LICENSE b/tools/azure-devtools/LICENSE new file mode 100644 index 000000000000..4b1ad51b2f0e --- /dev/null +++ b/tools/azure-devtools/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/tools/azure-devtools/README.rst b/tools/azure-devtools/README.rst new file mode 100644 index 000000000000..bdf397897d71 --- /dev/null +++ b/tools/azure-devtools/README.rst @@ -0,0 +1,32 @@ +.. image:: https://travis-ci.org/Azure/azure-python-devtools.svg?branch=master + :target: https://travis-ci.org/Azure/azure-python-devtools + +Development tools for Python-based Azure tools +============================================== + +This package contains tools to aid in developing Python-based Azure code. + +This includes the following components: + +scenario_tests +-------------- + +A testing framework to handle much of the busywork +associated with testing code that interacts with Azure. + +ci_tools +-------- + +Some tooling to help developing CI tools. This includes some Git helpers, +Github RestAPI wrapper and a Bot framework for Github issues. + +Contributing +============ + +This project has adopted the +`Microsoft Open Source Code of Conduct `__. +For more information see the +`Code of Conduct FAQ `__ +or contact +`opencode@microsoft.com `__ +with any additional questions or comments. diff --git a/tools/azure-devtools/dev_requirements.txt b/tools/azure-devtools/dev_requirements.txt new file mode 100644 index 000000000000..9ab230d71c73 --- /dev/null +++ b/tools/azure-devtools/dev_requirements.txt @@ -0,0 +1,4 @@ +-e .[ci_tools] + +mock;python_version<="2.7" +pytest diff --git a/tools/azure-devtools/doc/scenario_base_tests.md b/tools/azure-devtools/doc/scenario_base_tests.md new file mode 100644 index 000000000000..945b9eadeed8 --- /dev/null +++ b/tools/azure-devtools/doc/scenario_base_tests.md @@ -0,0 +1,101 @@ +# How to write ReplayableTest based VCR tests + +The `scenario_tests` package uses the [VCR.py](https://pypi.python.org/pypi/vcrpy) library +to record the HTTP messages exchanged during a program run +and play them back at a later time, +making it useful for creating "scenario tests" +that interact with Azure (or other) services. +These tests can be replayed at a later time without any network activity, +allowing us to detect changes in the Python layers +between the code being tested and the underlying REST API. + + +## Overview + +Tests all derive from the `ReplayableTest` class +found in `azure_devtools.scenario_tests.base`. +This class exposes the VCR tests using the standard Python `unittest` framework +and allows the tests to be discovered by and debugged in Visual Studio. + +When you run a test, +the test driver will automatically detect the test is unrecorded +and record the HTTP requests and responses in a .yaml file +(referred to by VCR.py as a "cassette"). +If the test succeeds, the cassette will be preserved +and future playthroughs of the test will come from the cassette +rather than using actual network communication. + +If the tests are run on TravisCI, +any tests which cannot be replayed will automatically fail. + +`ReplayableTest` itself derives from `IntegrationTestBase`, +which provides some helpful methods for use in more general unit tests +but no functionality pertaining to network communication. + + +## Configuring ReplayableTest + +The only configuration of `ReplayableTest` that is "exposed" +(in the sense of being accessible other than through subclassing) +is whether tests should be run in "live" or "playback" mode. +This can be set in the following two ways, +of which the first takes precedence: +* Set the environment variable `AZURE_TEST_RUN_LIVE`. + Any value will cause the tests to run in live mode; + if the variable is unset the default of playback mode will be used. +* Specify a boolean value for `live-mode` in a configuration file, + the path to which must be specified by a `ReplayableTest` subclass as described below + (i.e. by default no config file will be read). + True values mean "live" mode; false ones mean "playback." + +"Live" and "playback" mode are actually just shorthand for recording modes +in the underlying VCR.py package; +they correspond to "all" and "once" +as described in the [VCR.py documentation](http://vcrpy.readthedocs.io/en/latest/usage.html#record-modes). + +### Subclassing ReplayableTest and features + +Most customization of `ReplayableTest` is accessible only through subclassing. + +The two main users of `ReplayableTest` are +[azure-cli](https://github.com/Azure/azure-cli) +and [azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python). +Each uses a subclass of `ReplayableTest` to add context-specific functionality +and preserve backward compatibility with test code +prior to the existence of `azure-devtools`. +For example, azure-cli's [compatibility layer](https://github.com/Azure/azure-cli/tree/master/src/azure-cli-testsdk) +adds methods for running CLI commands and evaluating their output. + +Subclasses of `ReplayableTest` can configure its behavior +by passing the following keyword arguments when they call +its `__init__` method (probably using `super`): + +* `config_file`: Path to a configuration file. + It should be in the format described in Python's + [ConfigParser](https://docs.python.org/3/library/configparser.html) docs + and currently allows only the boolean option `live-mode`. +* `recording_dir` and `recording_name`: + Directory path and file name, respectively, + for the recording that should be used for a given test case. + By default, the directory will be a `recordings` directory + in the same location as the file containing the test case, + and the file name will be the same as the test method name. + A `.yaml` extension will be appended to whatever is used for `recording_name`. +* `recording_processors` and `replay_processors`: + Lists of `RecordingProcessor` instances for making changes to requests and responses + during test recording and test playback, respectively. + See [recording_processors.py](src/azure_devtools/scenario_tests/recording_processors.py) + for some examples and how to implement them. +* `recording_patches` and `replay_patches`: + Lists of patches to apply to functions, methods, etc. + during test recording and playback, respectively. + See [patches.py](src/azure_devtools/scenario_tests/patches.py) + for some examples. Note the `mock_in_unit_test` function + which abstracts out some boilerplate for applying a patch. + + + \ No newline at end of file diff --git a/tools/azure-devtools/scripts/ci.sh b/tools/azure-devtools/scripts/ci.sh new file mode 100755 index 000000000000..7fec520d06f8 --- /dev/null +++ b/tools/azure-devtools/scripts/ci.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +pylint src/azure_devtools +pytest src/azure_devtools/scenario_tests/tests --cov=./ \ No newline at end of file diff --git a/azure-sdk-tools/packaging_tools/templates/setup.cfg b/tools/azure-devtools/setup.cfg similarity index 100% rename from azure-sdk-tools/packaging_tools/templates/setup.cfg rename to tools/azure-devtools/setup.cfg diff --git a/tools/azure-devtools/setup.py b/tools/azure-devtools/setup.py new file mode 100644 index 000000000000..7a332ffb384a --- /dev/null +++ b/tools/azure-devtools/setup.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import io +from setuptools import setup + + +VERSION = "1.1.1" + + +CLASSIFIERS = [ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'License :: OSI Approved :: MIT License', +] + + +DEPENDENCIES = [ + 'ConfigArgParse>=0.12.0', + 'six>=1.10.0', + 'vcrpy>=1.11.0', +] + +with io.open('README.rst', 'r', encoding='utf-8') as f: + README = f.read() + +setup( + name='azure-devtools', + version=VERSION, + description='Microsoft Azure Development Tools for SDK', + long_description=README, + license='MIT', + author='Microsoft Corporation', + author_email='ptvshelp@microsoft.com', + url='https://github.com/Azure/azure-python-devtools', + zip_safe=False, + classifiers=CLASSIFIERS, + packages=[ + 'azure_devtools', + 'azure_devtools.scenario_tests', + 'azure_devtools.ci_tools', + ], + extras_require={ + 'ci_tools':[ + "PyGithub>=1.40", # Can Merge PR after 1.36, "requests" and tests after 1.40 + "GitPython", + "requests>=2.0" + ] + }, + package_dir={'': 'src'}, + install_requires=DEPENDENCIES, +) diff --git a/azure-sdk-tools/devtools_testutils/setup.py b/tools/azure-devtools/src/azure_devtools/__init__.py similarity index 100% rename from azure-sdk-tools/devtools_testutils/setup.py rename to tools/azure-devtools/src/azure_devtools/__init__.py diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/__init__.py b/tools/azure-devtools/src/azure_devtools/ci_tools/__init__.py new file mode 100644 index 000000000000..34913fb394d7 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/__init__.py @@ -0,0 +1,4 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/bot_framework.py b/tools/azure-devtools/src/azure_devtools/ci_tools/bot_framework.py new file mode 100644 index 000000000000..13fb436b20f5 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/bot_framework.py @@ -0,0 +1,121 @@ +from collections import namedtuple +from functools import lru_cache +import logging +import os +import re + +from github import Github, GithubException, UnknownObjectException + +from .github_tools import ( + exception_to_github, +) + +_LOGGER = logging.getLogger(__name__) + + +def order(function): + function.bot_order = True + return function + +WebhookMetadata = namedtuple( + 'WebhookMetadata', + ['repo', 'issue', 'text', 'comment'] +) + +def build_from_issue_comment(gh_token, body): + """Create a WebhookMetadata from a comment added to an issue. + """ + if body["action"] in ["created", "edited"]: + github_con = Github(gh_token) + repo = github_con.get_repo(body['repository']['full_name']) + issue = repo.get_issue(body['issue']['number']) + text = body['comment']['body'] + try: + comment = issue.get_comment(body['comment']['id']) + except UnknownObjectException: + # If the comment has already disapeared, skip the command + return None + return WebhookMetadata(repo, issue, text, comment) + return None + +def build_from_issues(gh_token, body): + """Create a WebhookMetadata from an opening issue text. + """ + if body["action"] in ["opened", "edited"]: + github_con = Github(gh_token) + repo = github_con.get_repo(body['repository']['full_name']) + issue = repo.get_issue(body['issue']['number']) + text = body['issue']['body'] + comment = issue # It's where we update the comment: in the issue itself + return WebhookMetadata(repo, issue, text, comment) + return None + +@lru_cache() +def robot_name_from_env_variable(): + github_con = Github(os.environ["GH_TOKEN"]) + return github_con.get_user().login + + +class BotHandler: + def __init__(self, handler, robot_name=None, gh_token=None): + self.handler = handler + self.gh_token = gh_token or os.environ["GH_TOKEN"] + self.robot_name = robot_name or robot_name_from_env_variable() + + def _is_myself(self, body): + return body['sender']['login'].lower() == self.robot_name.lower() + + def issue_comment(self, body): + if self._is_myself(body): + return {'message': 'I don\'t talk to myself, I\'m not schizo'} + webhook_data = build_from_issue_comment(self.gh_token, body) + return self.manage_comment(webhook_data) + + def issues(self, body): + if self._is_myself(body): + return {'message': 'I don\'t talk to myself, I\'m not schizo'} + webhook_data = build_from_issues(self.gh_token, body) + return self.manage_comment(webhook_data) + + def orders(self): + """Return method tagged "order" in the handler. + """ + return [order_cmd for order_cmd in dir(self.handler) + if getattr(getattr(self.handler, order_cmd), "bot_order", False)] + + def manage_comment(self, webhook_data): + if webhook_data is None: + return {'message': 'Nothing for me'} + # Is someone talking to me: + message = re.search("@{} (.*)".format(self.robot_name), webhook_data.text, re.I) + response = None + if message: + command = message.group(1) + split_text = command.lower().split() + orderstr = split_text.pop(0) + if orderstr == "help": + response = self.help_order() + elif orderstr in self.orders(): + try: # Reaction is fun, but it's preview not prod. + # Be careful, don't fail the command if we can't thumbs up... + webhook_data.comment.create_reaction("+1") + except GithubException: + pass + with exception_to_github(webhook_data.issue): # Just in case + response = getattr(self.handler, orderstr)(webhook_data.issue, *split_text) + else: + response = "I didn't understand your command:\n```bash\n{}\n```\nin this context, sorry :(\n".format( + command + ) + response += self.help_order() + if response: + webhook_data.issue.create_comment(response) + return {'message': response} + return {'message': 'Nothing for me or exception'} + + def help_order(self): + orders = ["This is what I can do:"] + for orderstr in self.orders(): + orders.append("- `{}`".format(orderstr)) + orders.append("- `help` : this help message") + return "\n".join(orders) diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/git_tools.py b/tools/azure-devtools/src/azure_devtools/ci_tools/git_tools.py new file mode 100644 index 000000000000..8c29dd842dc8 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/git_tools.py @@ -0,0 +1,90 @@ +"""Pure git tools for managing local folder Git. +""" +import logging + +from git import Repo, GitCommandError + +_LOGGER = logging.getLogger(__name__) + +def checkout_and_create_branch(repo, name): + """Checkout branch. Create it if necessary""" + local_branch = repo.branches[name] if name in repo.branches else None + if not local_branch: + if name in repo.remotes.origin.refs: + # If origin branch exists but not local, git.checkout is the fatest way + # to create local branch with origin link automatically + msg = repo.git.checkout(name) + _LOGGER.debug(msg) + return + # Create local branch, will be link to origin later + local_branch = repo.create_head(name) + local_branch.checkout() + +def checkout_create_push_branch(repo, name): + """Checkout this branch. Create it if necessary, and push it to origin. + """ + try: + repo.git.checkout(name) + _LOGGER.info("Checkout %s success", name) + except GitCommandError: + _LOGGER.info("Checkout %s was impossible (branch does not exist). Creating it and push it.", name) + checkout_and_create_branch(repo, name) + repo.git.push('origin', name, set_upstream=True) + + +def do_commit(repo, message_template, branch_name, hexsha): + "Do a commit if modified/untracked files" + repo.git.add(repo.working_tree_dir) + + if not repo.git.diff(staged=True): + _LOGGER.warning('No modified files in this Autorest run') + return False + + checkout_and_create_branch(repo, branch_name) + msg = message_template.format(hexsha=hexsha) + commit = repo.index.commit(msg) + _LOGGER.info("Commit done: %s", msg) + return commit.hexsha + +def get_repo_hexsha(git_folder): + """Get the SHA1 of the current repo""" + repo = Repo(str(git_folder)) + if repo.bare: + not_git_hexsha = "notgitrepo" + _LOGGER.warning("Not a git repo, SHA1 used will be: %s", not_git_hexsha) + return not_git_hexsha + hexsha = repo.head.commit.hexsha + _LOGGER.info("Found REST API repo SHA1: %s", hexsha) + return hexsha + +def checkout_with_fetch(git_folder, refspec, repository="origin"): + """Fetch the refspec, and checkout FETCH_HEAD. + Beware that you will ne in detached head mode. + """ + _LOGGER.info("Trying to fetch and checkout %s", refspec) + repo = Repo(str(git_folder)) + repo.git.fetch(repository, refspec) # FETCH_HEAD should be set + repo.git.checkout("FETCH_HEAD") + _LOGGER.info("Fetch and checkout success for %s", refspec) + +def clone_to_path(https_authenticated_url, folder, branch_or_commit=None): + """Clone the given URL to the folder. + + :param str branch_or_commit: If specified, switch to this branch. Branch must exist. + """ + _LOGGER.info("Cloning repo") + repo = Repo.clone_from(https_authenticated_url, str(folder)) + # Do NOT clone and set branch at the same time, since we allow branch to be a SHA1 + # And you can't clone a SHA1 + if branch_or_commit: + _LOGGER.info("Checkout branch_or_commit %s", branch_or_commit) + repo.git.checkout(branch_or_commit) + + _LOGGER.info("Clone success") + +def get_files_in_commit(git_folder, commit_id="HEAD"): + """List of files in HEAD commit. + """ + repo = Repo(str(git_folder)) + output = repo.git.diff("--name-only", commit_id+"^", commit_id) + return output.splitlines() diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/github_tools.py b/tools/azure-devtools/src/azure_devtools/ci_tools/github_tools.py new file mode 100644 index 000000000000..530d4690fe87 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/github_tools.py @@ -0,0 +1,374 @@ +"""Github tools. +""" +from contextlib import contextmanager +import logging +import os +from pathlib import Path +import shutil +import stat +from subprocess import CalledProcessError +import traceback +from urllib.parse import urlsplit, urlunsplit + +from github import Github, GithubException +from git import Repo + +from .git_tools import ( + clone_to_path as _git_clone_to_path, + checkout_with_fetch +) + +_LOGGER = logging.getLogger(__name__) + +class ExceptionContext: # pylint: disable=too-few-public-methods + def __init__(self): + self.comment = None + +@contextmanager +def exception_to_github(github_obj_to_comment, summary=""): + """If any exception comes, log them in the given Github obj. + """ + context = ExceptionContext() + try: + yield context + except Exception: # pylint: disable=broad-except + if summary: + summary = ": ({})".format(summary) + error_type = "an unknown error" + try: + raise + except CalledProcessError as err: + error_type = "a Subprocess error" + content = "Command: {}\n".format(err.cmd) + content += "Finished with return code {}\n".format(err.returncode) + if err.output: + content += "and output:\n```shell\n{}\n```".format(err.output) + else: + content += "and no output" + except Exception: # pylint: disable=broad-except + content = "```python\n{}\n```".format(traceback.format_exc()) + response = "
Encountered {}{}

\n\n".format( + error_type, + summary + ) + response += content + response += "\n\n

" + context.comment = create_comment(github_obj_to_comment, response) + +def user_from_token(gh_token): + """Get user login from GitHub token""" + github_con = Github(gh_token) + return github_con.get_user() + +def create_comment(github_object, body): + """Create a comment, whatever the object is a PR, a commit or an issue. + """ + try: + return github_object.create_issue_comment(body) # It's a PR + except AttributeError: + return github_object.create_comment(body) # It's a commit/issue + +def get_comments(github_object): + """Get a list of comments, whater the object is a PR, a commit or an issue. + """ + try: + return github_object.get_issue_comments() # It's a PR + except AttributeError: + return github_object.get_comments() # It's a commit/issue + +def get_files(github_object): + """Get files from a PR or a commit. + """ + try: + return github_object.get_files() # Try as a PR object + except AttributeError: + return github_object.files # Try as a commit object + +def configure_user(gh_token, repo): + """git config --global user.email "you@example.com" + git config --global user.name "Your Name" + """ + user = user_from_token(gh_token) + repo.git.config('user.email', user.email or 'adxpysdk@microsoft.com') + repo.git.config('user.name', user.name or 'SwaggerToSDK Automation') + +def get_full_sdk_id(gh_token, sdk_git_id): + """If the SDK git id is incomplete, try to complete it with user login""" + if not '/' in sdk_git_id: + login = user_from_token(gh_token).login + return '{}/{}'.format(login, sdk_git_id) + return sdk_git_id + +def sync_fork(gh_token, github_repo_id, repo, push=True): + """Sync the current branch in this fork against the direct parent on Github""" + if not gh_token: + _LOGGER.warning('Skipping the upstream repo sync, no token') + return + _LOGGER.info('Check if repo has to be sync with upstream') + github_con = Github(gh_token) + github_repo = github_con.get_repo(github_repo_id) + + if not github_repo.parent: + _LOGGER.warning('This repo has no upstream') + return + + upstream_url = 'https://github.com/{}.git'.format(github_repo.parent.full_name) + upstream = repo.create_remote('upstream', url=upstream_url) + upstream.fetch() + active_branch_name = repo.active_branch.name + if not active_branch_name in repo.remotes.upstream.refs: + _LOGGER.info('Upstream has no branch %s to merge from', active_branch_name) + return + else: + _LOGGER.info('Merge from upstream') + msg = repo.git.rebase('upstream/{}'.format(repo.active_branch.name)) + _LOGGER.debug(msg) + if push: + msg = repo.git.push() + _LOGGER.debug(msg) + +def get_or_create_pull(github_repo, title, body, head, base, *, none_if_no_commit=False): + """Try to create the PR. If the PR exists, try to find it instead. Raises otherwise. + + You should always use the complete head syntax "org:branch", since the syntax is required + in case of listing. + + if "none_if_no_commit" is set, return None instead of raising exception if the problem + is that head and base are the same. + """ + try: # Try to create or get a PR + return github_repo.create_pull( + title=title, + body=body, + head=head, + base=base + ) + except GithubException as err: + err_message = err.data['errors'][0].get('message', '') + if err.status == 422 and err_message.startswith('A pull request already exists'): + _LOGGER.info('PR already exists, get this PR') + return list(github_repo.get_pulls( + head=head, + base=base + ))[0] + elif none_if_no_commit and err.status == 422 and err_message.startswith('No commits between'): + _LOGGER.info('No PR possible since head %s and base %s are the same', + head, + base) + return None + else: + _LOGGER.warning("Unable to create PR:\n%s", err.data) + raise + except Exception as err: + response = traceback.format_exc() + _LOGGER.warning("Unable to create PR:\n%s", response) + raise + +def clone_to_path(gh_token, folder, sdk_git_id, branch_or_commit=None, *, pr_number=None): + """Clone the given repo_id to the folder. + + If PR number is specified fetch the magic branches + pull//head or pull//merge from Github. "merge" is tried first, and fallback to "head". + Beware that pr_number implies detached head, and then no push is possible. + + If branch is specified, checkout this branch or commit finally. + + :param str branch_or_commit: If specified, switch to this branch/commit. + :param int pr_number: PR number. + """ + _LOGGER.info("Clone SDK repository %s", sdk_git_id) + url_parsing = urlsplit(sdk_git_id) + sdk_git_id = url_parsing.path + if sdk_git_id.startswith("/"): + sdk_git_id = sdk_git_id[1:] + + credentials_part = '' + if gh_token: + login = user_from_token(gh_token).login + credentials_part = '{user}:{token}@'.format( + user=login, + token=gh_token + ) + else: + _LOGGER.warning('Will clone the repo without writing credentials') + + https_authenticated_url = 'https://{credentials}github.com/{sdk_git_id}.git'.format( + credentials=credentials_part, + sdk_git_id=sdk_git_id + ) + # Clone the repo + _git_clone_to_path(https_authenticated_url, folder) + # If this is a PR, do some fetch to improve the number of SHA1 available + if pr_number: + try: + checkout_with_fetch(folder, "pull/{}/merge".format(pr_number)) + return + except Exception: # pylint: disable=broad-except + pass # Assume "merge" doesn't exist anymore, fetch "head" + checkout_with_fetch(folder, "pull/{}/head".format(pr_number)) + # If there is SHA1, checkout it. If PR number was given, SHA1 could be inside that PR. + if branch_or_commit: + repo = Repo(str(folder)) + repo.git.checkout(branch_or_commit) + +def do_pr(gh_token, sdk_git_id, sdk_pr_target_repo_id, branch_name, base_branch, pr_body=""): # pylint: disable=too-many-arguments + "Do the PR" + if not gh_token: + _LOGGER.info('Skipping the PR, no token found') + return None + if not sdk_pr_target_repo_id: + _LOGGER.info('Skipping the PR, no target repo id') + return None + + github_con = Github(gh_token) + sdk_pr_target_repo = github_con.get_repo(sdk_pr_target_repo_id) + + if '/' in sdk_git_id: + sdk_git_owner = sdk_git_id.split('/')[0] + _LOGGER.info("Do the PR from %s", sdk_git_owner) + head_name = "{}:{}".format(sdk_git_owner, branch_name) + else: + head_name = branch_name + sdk_git_repo = github_con.get_repo(sdk_git_id) + sdk_git_owner = sdk_git_repo.owner.login + + try: + github_pr = sdk_pr_target_repo.create_pull( + title='Automatic PR from {}'.format(branch_name), + body=pr_body, + head=head_name, + base=base_branch + ) + except GithubException as err: + if err.status == 422 and err.data['errors'][0].get('message', '').startswith('A pull request already exists'): + matching_pulls = sdk_pr_target_repo.get_pulls(base=base_branch, head=sdk_git_owner+":"+head_name) + matching_pull = matching_pulls[0] + _LOGGER.info('PR already exists: %s', matching_pull.html_url) + return matching_pull + raise + _LOGGER.info("Made PR %s", github_pr.html_url) + return github_pr + + +def remove_readonly(func, path, _): + "Clear the readonly bit and reattempt the removal" + os.chmod(path, stat.S_IWRITE) + func(path) + +@contextmanager +def manage_git_folder(gh_token, temp_dir, git_id, *, pr_number=None): + """Context manager to avoid readonly problem while cleanup the temp dir. + + If PR number is given, use magic branches "pull" from Github. + """ + _LOGGER.debug("Git ID %s", git_id) + if Path(git_id).exists(): + yield git_id + return # Do not erase a local folder, just skip here + + # Clone the specific branch + split_git_id = git_id.split("@") + branch = split_git_id[1] if len(split_git_id) > 1 else None + clone_to_path(gh_token, temp_dir, split_git_id[0], branch_or_commit=branch, pr_number=pr_number) + try: + yield temp_dir + # Pre-cleanup for Windows http://bugs.python.org/issue26660 + finally: + _LOGGER.debug("Preclean Rest folder") + shutil.rmtree(temp_dir, onerror=remove_readonly) + + +class GithubLink: + def __init__(self, gitid, link_type, branch_or_commit, path, token=None): # pylint: disable=too-many-arguments + self.gitid = gitid + self.link_type = link_type + self.branch_or_commit = branch_or_commit + self.path = path + self.token = token + + @classmethod + def from_string(cls, github_url): + parsed = urlsplit(github_url) + netloc = parsed.netloc + if "@" in netloc: + token, netloc = netloc.split("@") + else: + token = None + + split_path = parsed.path.split("/") + split_path.pop(0) # First is always empty + gitid = split_path.pop(0) + "/" + split_path.pop(0) + link_type = split_path.pop(0) if netloc != "raw.githubusercontent.com" else "raw" + branch_or_commit = split_path.pop(0) + path = "/".join(split_path) + return cls(gitid, link_type, branch_or_commit, path, token) + + def __repr__(self): + if self.link_type == "raw": + netloc = "raw.githubusercontent.com" + path = "/".join(["", self.gitid, self.branch_or_commit, self.path]) + # If raw and token, needs to be passed with "Authorization: token ", so nothing to do here + else: + netloc = "github.com" if not self.token else self.token + "@github.com" + path = "/".join(["", self.gitid, self.link_type, self.branch_or_commit, self.path]) + return urlunsplit(("https", netloc, path, '', '')) + + def as_raw_link(self): + """Returns a GithubLink to a raw content. + """ + if self.link_type == "raw": + return self # Can be discussed if we need an hard copy, or fail + if self.link_type != "blob": + raise ValueError("Cannot get a download link from a tree link") + return self.__class__( + self.gitid, + "raw", + self.branch_or_commit, + self.path, + self.token + ) + +class DashboardCommentableObject: # pylint: disable=too-few-public-methods + def __init__(self, issue_or_pr, header): + self._issue_or_pr = issue_or_pr + self._header = header + + def create_comment(self, text): + """Mimic issue API, so we can use it everywhere. + Return dashboard comment. + """ + return DashboardComment.get_or_create(self._issue_or_pr, self._header, text) + +class DashboardComment: + def __init__(self, github_comment, header): + self.github_comment = github_comment + self._header = header + + @classmethod + def get_or_create(cls, issue, header, text=None): + """Get or create the dashboard comment in this issue. + """ + for comment in get_comments(issue): + try: + if comment.body.splitlines()[0] == header: + obj = cls(comment, header) + break + except IndexError: # The comment body is empty + pass + # Hooooooo, no dashboard comment, let's create one + else: + comment = create_comment(issue, header) + obj = cls(comment, header) + if text: + obj.edit(text) + return obj + + def edit(self, text): + self.github_comment.edit(self._header+"\n"+text) + + @property + def body(self): + return self.github_comment.body[len(self._header+"\n"):] + + def delete(self): + self.github_comment.delete() diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_bot_basic_command.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_bot_basic_command.txt new file mode 100644 index 000000000000..fec50c88c687 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_bot_basic_command.txt @@ -0,0 +1,77 @@ +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/17 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:19 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4868'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"98b4fc509c1be25d2318a54b8c92958d"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:24 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.067750'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1584:97BA:C8520B:103DCD4:5AFDF1D7')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/17","id":296837951,"number":17,"title":"Bot testing test_bot_basic_command","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-13T18:21:32Z","updated_at":"2018-05-17T21:17:24Z","closed_at":null,"author_association":"OWNER","body":"Issue for test test_bot_basic_command","closed_by":null} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:19 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4867'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.068194'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1585:97AE:D648:1542E:5AFDF1D7')] +{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/17 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:19 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4866'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"98b4fc509c1be25d2318a54b8c92958d"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:24 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.056033'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1586:97B6:619CDF:7E742E:5AFDF1D7')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/17","id":296837951,"number":17,"title":"Bot testing test_bot_basic_command","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-13T18:21:32Z","updated_at":"2018-05-17T21:17:24Z","closed_at":null,"author_association":"OWNER","body":"Issue for test test_bot_basic_command","closed_by":null} + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/17/reactions +{'Accept': 'application/vnd.github.squirrel-girl-preview', 'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"content": "+1"} +200 +[('Date', 'Thu, 17 May 2018 21:19:19 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4865'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"830905522c930d77c944e2465cbf79e3"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.squirrel-girl-preview'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.049763'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1587:97BA:C85240:103DD1C:5AFDF1D7')] +{"id":19647639,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"content":"+1","created_at":"2018-02-15T16:48:56Z"} + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/17/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "I did something with myparameter"} +201 +[('Date', 'Thu, 17 May 2018 21:19:20 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1269'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4864'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"3c8c70479a1f9d4bd626e25a0fb202d5"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015300'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.235969'), ('X-GitHub-Request-Id', '1589:97BA:C8524D:103DD2D:5AFDF1D7')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015300","html_url":"https://github.com/lmazuel/TestingRepo/issues/17#issuecomment-390015300","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17","id":390015300,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:19Z","updated_at":"2018-05-17T21:19:19Z","author_association":"OWNER","body":"I did something with myparameter"} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/17/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:20 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4863'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"74c8cfcaef98bcea9d03825eaf8e8bcb"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.075117'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '158A:97B8:C19E00:FA7576:5AFDF1D8')] +[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015300","html_url":"https://github.com/lmazuel/TestingRepo/issues/17#issuecomment-390015300","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/17","id":390015300,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:19Z","updated_at":"2018-05-17T21:19:19Z","author_association":"OWNER","body":"I did something with myparameter"}] + +https +DELETE +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390015300 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Date', 'Thu, 17 May 2018 21:19:20 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4862'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.153464'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '158B:97B4:2A9DDC:371568:5AFDF1D8')] + + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_bot_basic_failure.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_bot_basic_failure.txt new file mode 100644 index 000000000000..47387cd8dd4a --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_bot_basic_failure.txt @@ -0,0 +1,77 @@ +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/18 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:20 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4861'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"927f79403c0b19d9941c1f9971554c97"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:25 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.091675'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '158C:97B8:C19E27:FA75AE:5AFDF1D8')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/18","id":296839107,"number":18,"title":"Bot testing test_bot_basic_failure","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-13T18:25:38Z","updated_at":"2018-05-17T21:17:25Z","closed_at":null,"author_association":"OWNER","body":"Test test_bot_basic_failure","closed_by":null} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:21 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4860'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.071013'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '158D:97B8:C19E34:FA75C6:5AFDF1D8')] +{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/18 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:21 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4859'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"927f79403c0b19d9941c1f9971554c97"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:25 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.077929'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '158E:97B6:619D50:7E74CE:5AFDF1D9')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/18","id":296839107,"number":18,"title":"Bot testing test_bot_basic_failure","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-13T18:25:38Z","updated_at":"2018-05-17T21:17:25Z","closed_at":null,"author_association":"OWNER","body":"Test test_bot_basic_failure","closed_by":null} + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/18/reactions +{'Accept': 'application/vnd.github.squirrel-girl-preview', 'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"content": "+1"} +200 +[('Date', 'Thu, 17 May 2018 21:19:21 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4858'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"f35e383770b095bc94f549fe44edc2fe"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.squirrel-girl-preview'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.068572'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '158F:97BA:C852D8:103DDF9:5AFDF1D9')] +{"id":19647644,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"content":"+1","created_at":"2018-02-15T16:48:58Z"} + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/18/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "
Encountered an unknown error

\n\n```python\nsomething to do with an exception\n```\n\n

"} +201 +[('Date', 'Thu, 17 May 2018 21:19:21 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1367'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4857'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"06822f58759ca9c9cd53dc2e99a93569"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015309'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.233947'), ('X-GitHub-Request-Id', '1590:97BA:C852EB:103DE13:5AFDF1D9')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015309","html_url":"https://github.com/lmazuel/TestingRepo/issues/18#issuecomment-390015309","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18","id":390015309,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:21Z","updated_at":"2018-05-17T21:19:21Z","author_association":"OWNER","body":"
Encountered an unknown error

\n\n```python\nsomething to do with an exception\n```\n\n

"} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/18/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:22 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4856'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"a5b1ec4e91e863af61c812af3c2a3308"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.052239'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1591:97BA:C85304:103DE35:5AFDF1D9')] +[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/378008509","html_url":"https://github.com/lmazuel/TestingRepo/issues/18#issuecomment-378008509","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18","id":378008509,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-04-02T18:49:03Z","updated_at":"2018-04-02T18:49:03Z","author_association":"OWNER","body":"
Encountered an unknown error

\n\n```python\nTraceback (most recent call last):\n File \"/home/travis/build/lmazuel/swagger-to-sdk/swaggertosdk/github_tools.py\", line 32, in exception_to_github\n yield context\n File \"/home/travis/build/lmazuel/swagger-to-sdk/swaggertosdk/restapi/bot_framework.py\", line 104, in manage_comment\n response = getattr(self.handler, orderstr)(webhook_data.issue, *split_text)\n File \"/home/travis/build/lmazuel/swagger-to-sdk/tests/test_bot_framework.py\", line 134, in command1\n raise ValueError(\"Not happy\")\nValueError: Not happy\n\n```\n\n

"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390014728","html_url":"https://github.com/lmazuel/TestingRepo/issues/18#issuecomment-390014728","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18","id":390014728,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:17:25Z","updated_at":"2018-05-17T21:17:25Z","author_association":"OWNER","body":"
Encountered an unknown error

\n\n```python\nsomething to do with an exception\n```\n\n

"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015309","html_url":"https://github.com/lmazuel/TestingRepo/issues/18#issuecomment-390015309","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/18","id":390015309,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:21Z","updated_at":"2018-05-17T21:19:21Z","author_association":"OWNER","body":"
Encountered an unknown error

\n\n```python\nsomething to do with an exception\n```\n\n

"}] + +https +DELETE +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390015309 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Date', 'Thu, 17 May 2018 21:19:22 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4855'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.105747'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '1592:97BA:C85310:103DE44:5AFDF1DA')] + + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_bot_help.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_bot_help.txt new file mode 100644 index 000000000000..c597b5fd77ae --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_bot_help.txt @@ -0,0 +1,66 @@ +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/16 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:22 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4854'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"dbdbf224af844ba6fe3d35549fe06d65"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:27 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.086366'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1593:97B8:C19EA6:FA766A:5AFDF1DA')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/16","id":296581533,"number":16,"title":"Bot testing test_bot_help","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-13T01:16:25Z","updated_at":"2018-05-17T21:17:27Z","closed_at":null,"author_association":"OWNER","body":"This is bot testing. Test framework will use this issue to test if bot can understand what we are saying. Webhook will be faked.","closed_by":null} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:22 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4853'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.067798'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1594:97B6:619DAB:7E754C:5AFDF1DA')] +{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/16 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:22 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4852'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"dbdbf224af844ba6fe3d35549fe06d65"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:27 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.069684'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1595:97B8:C19EC5:FA7690:5AFDF1DA')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/16","id":296581533,"number":16,"title":"Bot testing test_bot_help","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-13T01:16:25Z","updated_at":"2018-05-17T21:17:27Z","closed_at":null,"author_association":"OWNER","body":"This is bot testing. Test framework will use this issue to test if bot can understand what we are saying. Webhook will be faked.","closed_by":null} + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/16/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "This is what I can do:\n- `command1`\n- `command2`\n- `help` : this help message"} +201 +[('Date', 'Thu, 17 May 2018 21:19:23 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1317'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4851'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"c2544608584665dd2942321d6aab107f"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015316'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.261789'), ('X-GitHub-Request-Id', '1596:97BA:C8533D:103DE8D:5AFDF1DA')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015316","html_url":"https://github.com/lmazuel/TestingRepo/issues/16#issuecomment-390015316","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","id":390015316,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:23Z","updated_at":"2018-05-17T21:19:23Z","author_association":"OWNER","body":"This is what I can do:\n- `command1`\n- `command2`\n- `help` : this help message"} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/16/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:23 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4850'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"9becdc0c2a9bd3482c6eca5b01416246"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.073664'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1597:97BA:C85357:103DEB6:5AFDF1DB')] +[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/365120206","html_url":"https://github.com/lmazuel/TestingRepo/issues/16#issuecomment-365120206","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","id":365120206,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T01:24:00Z","updated_at":"2018-02-13T01:24:00Z","author_association":"OWNER","body":"This is what I can do:\n - `help` : this help message\n - `generate ` : create a PR for this README\n "},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/365120680","html_url":"https://github.com/lmazuel/TestingRepo/issues/16#issuecomment-365120680","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","id":365120680,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T01:26:35Z","updated_at":"2018-02-13T01:26:35Z","author_association":"OWNER","body":"This is what I can do:\n- `help` : this help message"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/365343119","html_url":"https://github.com/lmazuel/TestingRepo/issues/16#issuecomment-365343119","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","id":365343119,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T17:35:27Z","updated_at":"2018-02-13T17:35:27Z","author_association":"OWNER","body":"This is what I can do:\n- `command1`\n- `command2`\n- `help` : this help message"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/365350586","html_url":"https://github.com/lmazuel/TestingRepo/issues/16#issuecomment-365350586","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","id":365350586,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T17:59:45Z","updated_at":"2018-02-13T17:59:45Z","author_association":"OWNER","body":"End message for tests"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015316","html_url":"https://github.com/lmazuel/TestingRepo/issues/16#issuecomment-390015316","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","id":390015316,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:23Z","updated_at":"2018-05-17T21:19:23Z","author_association":"OWNER","body":"This is what I can do:\n- `command1`\n- `command2`\n- `help` : this help message"}] + +https +DELETE +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390015316 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Date', 'Thu, 17 May 2018 21:19:24 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4849'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.543403'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '1598:97B8:C19F06:FA76E1:5AFDF1DB')] + + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_bot_unknown_command.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_bot_unknown_command.txt new file mode 100644 index 000000000000..2b05c1c97257 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_bot_unknown_command.txt @@ -0,0 +1,66 @@ +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/19 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:24 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4848'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"817b6384493b05bdc635dcb4b3ed97e9"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:28 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.072901'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1599:97B6:619DF4:7E75B2:5AFDF1DC')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/19","id":296841237,"number":19,"title":"Bot testing test_bot_unknown_command","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-13T18:32:59Z","updated_at":"2018-05-17T21:17:28Z","closed_at":null,"author_association":"OWNER","body":"Test test_bot_unknown_command","closed_by":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false}} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:24 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4847'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.075721'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '159A:97B8:C19F3B:FA772C:5AFDF1DC')] +{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/19 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:24 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4846'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"817b6384493b05bdc635dcb4b3ed97e9"'), ('Last-Modified', 'Thu, 17 May 2018 21:17:28 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.054579'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '159B:97BA:C853B6:103DF3D:5AFDF1DC')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/19","id":296841237,"number":19,"title":"Bot testing test_bot_unknown_command","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-13T18:32:59Z","updated_at":"2018-05-17T21:17:28Z","closed_at":null,"author_association":"OWNER","body":"Test test_bot_unknown_command","closed_by":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false}} + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/19/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "I didn't understand your command:\n```bash\ncommand1 myparameter\n```\nin this context, sorry :(\nThis is what I can do:\n- `help` : this help message"} +201 +[('Date', 'Thu, 17 May 2018 21:19:25 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1387'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4845'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"7e5e5bc1d93fe17033b3690c64d1de5c"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015326'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.287623'), ('X-GitHub-Request-Id', '159C:97BA:C853C6:103DF50:5AFDF1DC')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015326","html_url":"https://github.com/lmazuel/TestingRepo/issues/19#issuecomment-390015326","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19","id":390015326,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:24Z","updated_at":"2018-05-17T21:19:24Z","author_association":"OWNER","body":"I didn't understand your command:\n```bash\ncommand1 myparameter\n```\nin this context, sorry :(\nThis is what I can do:\n- `help` : this help message"} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/19/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:25 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4844'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"2f96a1efc55bec5c0d05b8eb07192251"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.061455'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '159D:97B8:C19F68:FA7775:5AFDF1DD')] +[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390015326","html_url":"https://github.com/lmazuel/TestingRepo/issues/19#issuecomment-390015326","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/19","id":390015326,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:19:24Z","updated_at":"2018-05-17T21:19:24Z","author_association":"OWNER","body":"I didn't understand your command:\n```bash\ncommand1 myparameter\n```\nin this context, sorry :(\nThis is what I can do:\n- `help` : this help message"}] + +https +DELETE +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390015326 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Date', 'Thu, 17 May 2018 21:19:25 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4843'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.119982'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '159F:97BA:C853F6:103DF8C:5AFDF1DD')] + + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_webhook_data.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_webhook_data.txt new file mode 100644 index 000000000000..7fdc948de8d1 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/BotFrameworkTest.test_webhook_data.txt @@ -0,0 +1,66 @@ +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:25 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4842'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.053636'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '15A0:97B6:619E2D:7E75FD:5AFDF1DD')] +{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/16 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:25 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4841'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"7d2748617881607a7850e67e06267e71"'), ('Last-Modified', 'Thu, 17 May 2018 21:19:23 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.076099'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '15A1:97BA:C8540D:103DFB0:5AFDF1DD')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/16","id":296581533,"number":16,"title":"Bot testing test_bot_help","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-13T01:16:25Z","updated_at":"2018-05-17T21:19:23Z","closed_at":null,"author_association":"OWNER","body":"This is bot testing. Test framework will use this issue to test if bot can understand what we are saying. Webhook will be faked.","closed_by":null} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:25 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4840'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.069166'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '15A2:97BA:C8541C:103DFC4:5AFDF1DD')] +{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/16 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:26 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4839'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"7d2748617881607a7850e67e06267e71"'), ('Last-Modified', 'Thu, 17 May 2018 21:19:23 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.070185'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '15A3:97B4:2A9E5A:37161B:5AFDF1DD')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/16","id":296581533,"number":16,"title":"Bot testing test_bot_help","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-13T01:16:25Z","updated_at":"2018-05-17T21:19:23Z","closed_at":null,"author_association":"OWNER","body":"This is bot testing. Test framework will use this issue to test if bot can understand what we are saying. Webhook will be faked.","closed_by":null} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/365120206 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:26 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4838'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"9ae58cc064227ab7ba03d6700bc43271"'), ('Last-Modified', 'Tue, 08 May 2018 04:10:43 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.060661'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '15A4:97B6:619E50:7E7635:5AFDF1DE')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/365120206","html_url":"https://github.com/lmazuel/TestingRepo/issues/16#issuecomment-365120206","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/16","id":365120206,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T01:24:00Z","updated_at":"2018-02-13T01:24:00Z","author_association":"OWNER","body":"This is what I can do:\n - `help` : this help message\n - `generate ` : create a PR for this README\n "} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:19:26 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4837'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"725d5cec4f2c42be4592ff68c6cde59c"'), ('Last-Modified', 'Thu, 21 Apr 2016 17:29:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.059502'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '15A5:97BA:C85441:103DFF5:5AFDF1DE')] +{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"network_count":1,"subscribers_count":1} + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_clone_path.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_clone_path.txt new file mode 100644 index 000000000000..a207132972d7 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_clone_path.txt @@ -0,0 +1,99 @@ +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Fri, 06 Jul 2018 21:50:18 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4991'), ('X-RateLimit-Reset', '1530917381'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"10b653fde1e6d20073ad0d69f59b2c3f"'), ('Last-Modified', 'Fri, 08 Jun 2018 04:11:06 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.048085'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'DFBC:85AB:4441C25:57B4B8B:5B3FE41A')] +{"login":"lmazuel","id":1050156,"node_id":"MDQ6VXNlcjEwNTAxNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":47,"public_gists":14,"followers":40,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-06-08T04:11:06Z","private_gists":2,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41453,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Fri, 06 Jul 2018 21:50:20 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4990'), ('X-RateLimit-Reset', '1530917381'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"10b653fde1e6d20073ad0d69f59b2c3f"'), ('Last-Modified', 'Fri, 08 Jun 2018 04:11:06 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.093382'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'DFBE:85A8:208C8EA:29398CF:5B3FE41C')] +{"login":"lmazuel","id":1050156,"node_id":"MDQ6VXNlcjEwNTAxNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":47,"public_gists":14,"followers":40,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-06-08T04:11:06Z","private_gists":2,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41453,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Fri, 06 Jul 2018 21:50:22 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4989'), ('X-RateLimit-Reset', '1530917381'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"10b653fde1e6d20073ad0d69f59b2c3f"'), ('Last-Modified', 'Fri, 08 Jun 2018 04:11:06 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.042008'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'DFC1:85A8:208C923:2939909:5B3FE41E')] +{"login":"lmazuel","id":1050156,"node_id":"MDQ6VXNlcjEwNTAxNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":47,"public_gists":14,"followers":40,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-06-08T04:11:06Z","private_gists":2,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41453,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Fri, 06 Jul 2018 21:50:24 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4988'), ('X-RateLimit-Reset', '1530917381'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"10b653fde1e6d20073ad0d69f59b2c3f"'), ('Last-Modified', 'Fri, 08 Jun 2018 04:11:06 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.058983'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'DFC3:85A8:208C95A:2939952:5B3FE41F')] +{"login":"lmazuel","id":1050156,"node_id":"MDQ6VXNlcjEwNTAxNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":47,"public_gists":14,"followers":40,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-06-08T04:11:06Z","private_gists":2,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41453,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Fri, 06 Jul 2018 21:50:25 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4987'), ('X-RateLimit-Reset', '1530917381'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"10b653fde1e6d20073ad0d69f59b2c3f"'), ('Last-Modified', 'Fri, 08 Jun 2018 04:11:06 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.054447'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'DFC7:85AA:3E20F9D:4F32AB0:5B3FE421')] +{"login":"lmazuel","id":1050156,"node_id":"MDQ6VXNlcjEwNTAxNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":47,"public_gists":14,"followers":40,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-06-08T04:11:06Z","private_gists":2,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41453,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Fri, 06 Jul 2018 21:50:29 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4986'), ('X-RateLimit-Reset', '1530917381'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"10b653fde1e6d20073ad0d69f59b2c3f"'), ('Last-Modified', 'Fri, 08 Jun 2018 04:11:06 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.053094'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'DFCC:85AB:44420F3:57B51B8:5B3FE424')] +{"login":"lmazuel","id":1050156,"node_id":"MDQ6VXNlcjEwNTAxNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":47,"public_gists":14,"followers":40,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-06-08T04:11:06Z","private_gists":2,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41453,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/pulls/2 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Fri, 06 Jul 2018 21:50:33 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4985'), ('X-RateLimit-Reset', '1530917381'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"8a6ef82b7dcdf6548b23e3a686b38341"'), ('Last-Modified', 'Thu, 05 Jul 2018 16:03:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.114799'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'DFD1:85AB:44422E1:57B544C:5B3FE429')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/2","id":70768598,"node_id":"MDExOlB1bGxSZXF1ZXN0NzA3Njg1OTg=","html_url":"https://github.com/lmazuel/TestingRepo/pull/2","diff_url":"https://github.com/lmazuel/TestingRepo/pull/2.diff","patch_url":"https://github.com/lmazuel/TestingRepo/pull/2.patch","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/2","number":2,"state":"open","locked":false,"title":"Update README.md","user":{"login":"AutorestCI","id":18218145,"node_id":"MDQ6VXNlcjE4MjE4MTQ1","avatar_url":"https://avatars3.githubusercontent.com/u/18218145?v=4","gravatar_id":"","url":"https://api.github.com/users/AutorestCI","html_url":"https://github.com/AutorestCI","followers_url":"https://api.github.com/users/AutorestCI/followers","following_url":"https://api.github.com/users/AutorestCI/following{/other_user}","gists_url":"https://api.github.com/users/AutorestCI/gists{/gist_id}","starred_url":"https://api.github.com/users/AutorestCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AutorestCI/subscriptions","organizations_url":"https://api.github.com/users/AutorestCI/orgs","repos_url":"https://api.github.com/users/AutorestCI/repos","events_url":"https://api.github.com/users/AutorestCI/events{/privacy}","received_events_url":"https://api.github.com/users/AutorestCI/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-19T21:29:49Z","updated_at":"2018-07-05T16:03:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d020a4d8788aa40753ca326f0818a8cd805ac93","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/2/commits","review_comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/2/comments","review_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/2/comments","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/40d2028637a6b5f8f6ae6e595e772d6fc33b93bb","head":{"label":"AutorestCI:AutorestCI-patch-1","ref":"AutorestCI-patch-1","sha":"40d2028637a6b5f8f6ae6e595e772d6fc33b93bb","user":{"login":"AutorestCI","id":18218145,"node_id":"MDQ6VXNlcjE4MjE4MTQ1","avatar_url":"https://avatars3.githubusercontent.com/u/18218145?v=4","gravatar_id":"","url":"https://api.github.com/users/AutorestCI","html_url":"https://github.com/AutorestCI","followers_url":"https://api.github.com/users/AutorestCI/followers","following_url":"https://api.github.com/users/AutorestCI/following{/other_user}","gists_url":"https://api.github.com/users/AutorestCI/gists{/gist_id}","starred_url":"https://api.github.com/users/AutorestCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AutorestCI/subscriptions","organizations_url":"https://api.github.com/users/AutorestCI/orgs","repos_url":"https://api.github.com/users/AutorestCI/repos","events_url":"https://api.github.com/users/AutorestCI/events{/privacy}","received_events_url":"https://api.github.com/users/AutorestCI/received_events","type":"User","site_admin":false},"repo":{"id":59243826,"node_id":"MDEwOlJlcG9zaXRvcnk1OTI0MzgyNg==","name":"TestingRepo","full_name":"AutorestCI/TestingRepo","owner":{"login":"AutorestCI","id":18218145,"node_id":"MDQ6VXNlcjE4MjE4MTQ1","avatar_url":"https://avatars3.githubusercontent.com/u/18218145?v=4","gravatar_id":"","url":"https://api.github.com/users/AutorestCI","html_url":"https://github.com/AutorestCI","followers_url":"https://api.github.com/users/AutorestCI/followers","following_url":"https://api.github.com/users/AutorestCI/following{/other_user}","gists_url":"https://api.github.com/users/AutorestCI/gists{/gist_id}","starred_url":"https://api.github.com/users/AutorestCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AutorestCI/subscriptions","organizations_url":"https://api.github.com/users/AutorestCI/orgs","repos_url":"https://api.github.com/users/AutorestCI/repos","events_url":"https://api.github.com/users/AutorestCI/events{/privacy}","received_events_url":"https://api.github.com/users/AutorestCI/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AutorestCI/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":true,"url":"https://api.github.com/repos/AutorestCI/TestingRepo","forks_url":"https://api.github.com/repos/AutorestCI/TestingRepo/forks","keys_url":"https://api.github.com/repos/AutorestCI/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AutorestCI/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AutorestCI/TestingRepo/teams","hooks_url":"https://api.github.com/repos/AutorestCI/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/AutorestCI/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/AutorestCI/TestingRepo/events","assignees_url":"https://api.github.com/repos/AutorestCI/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/AutorestCI/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/AutorestCI/TestingRepo/tags","blobs_url":"https://api.github.com/repos/AutorestCI/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AutorestCI/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AutorestCI/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/AutorestCI/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AutorestCI/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/AutorestCI/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/AutorestCI/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/AutorestCI/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/AutorestCI/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/AutorestCI/TestingRepo/subscription","commits_url":"https://api.github.com/repos/AutorestCI/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/AutorestCI/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/AutorestCI/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/AutorestCI/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/AutorestCI/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/AutorestCI/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AutorestCI/TestingRepo/merges","archive_url":"https://api.github.com/repos/AutorestCI/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AutorestCI/TestingRepo/downloads","issues_url":"https://api.github.com/repos/AutorestCI/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/AutorestCI/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/AutorestCI/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/AutorestCI/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AutorestCI/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/AutorestCI/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/AutorestCI/TestingRepo/deployments","created_at":"2016-05-19T21:26:35Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2016-05-19T21:28:13Z","git_url":"git://github.com/AutorestCI/TestingRepo.git","ssh_url":"git@github.com:AutorestCI/TestingRepo.git","clone_url":"https://github.com/AutorestCI/TestingRepo.git","svn_url":"https://github.com/AutorestCI/TestingRepo","homepage":null,"size":1,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"lmazuel:master","ref":"master","sha":"dd82f65f1b6314b18609b8572464b6d328ea70d4","user":{"login":"lmazuel","id":1050156,"node_id":"MDQ6VXNlcjEwNTAxNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"repo":{"id":56793153,"node_id":"MDEwOlJlcG9zaXRvcnk1Njc5MzE1Mw==","name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"node_id":"MDQ6VXNlcjEwNTAxNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/2"},"html":{"href":"https://github.com/lmazuel/TestingRepo/pull/2"},"issue":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/issues/2"},"comments":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/40d2028637a6b5f8f6ae6e595e772d6fc33b93bb"}},"author_association":"COLLABORATOR","merged":false,"mergeable":true,"rebaseable":false,"mergeable_state":"clean","merged_by":null,"comments":3,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":2,"deletions":0,"changed_files":1} + +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Fri, 06 Jul 2018 21:50:33 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4984'), ('X-RateLimit-Reset', '1530917381'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"10b653fde1e6d20073ad0d69f59b2c3f"'), ('Last-Modified', 'Fri, 08 Jun 2018 04:11:06 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.039463'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'DFD3:85A8:208CA76:2939AE7:5B3FE429')] +{"login":"lmazuel","id":1050156,"node_id":"MDQ6VXNlcjEwNTAxNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":47,"public_gists":14,"followers":40,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-06-08T04:11:06Z","private_gists":2,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41453,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Fri, 06 Jul 2018 21:50:36 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4983'), ('X-RateLimit-Reset', '1530917381'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"10b653fde1e6d20073ad0d69f59b2c3f"'), ('Last-Modified', 'Fri, 08 Jun 2018 04:11:06 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.042491'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'DFDB:85A5:50C84B:6722D2:5B3FE42C')] +{"login":"lmazuel","id":1050156,"node_id":"MDQ6VXNlcjEwNTAxNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":47,"public_gists":14,"followers":40,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-06-08T04:11:06Z","private_gists":2,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41453,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_configure.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_configure.txt new file mode 100644 index 000000000000..c59238163ea6 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_configure.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:30 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4801'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"77a0c498bc6360506f9e7a4dd33857df"'), ('Last-Modified', 'Tue, 08 May 2018 04:10:43 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.050830'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '16F8:97BA:C9220B:104EE7D:5AFDF3C2')] +{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":46,"public_gists":14,"followers":30,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-05-08T04:10:43Z","private_gists":1,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41216,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_create_comment.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_create_comment.txt new file mode 100644 index 000000000000..d43df7590331 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_create_comment.txt @@ -0,0 +1,66 @@ +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/14 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:31 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4800'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"8bb2ec36d3e6380bc0eabd5bd44e96eb"'), ('Last-Modified', 'Thu, 17 May 2018 21:15:04 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.064500'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '16F9:97BA:C92251:104EED1:5AFDF3C3')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/14","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/14/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/14/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/14","id":291717104,"number":14,"title":"Testing comment","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-01-25T21:12:00Z","updated_at":"2018-05-17T21:15:04Z","closed_at":null,"author_association":"OWNER","body":"","closed_by":null} + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/14/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "This is a test"} +201 +[('Date', 'Thu, 17 May 2018 21:27:31 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1251'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4799'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"d2dfbb8c026a93b366703c2905dd6477"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017673'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.445487'), ('X-GitHub-Request-Id', '16FA:97B8:C2461E:FB54DF:5AFDF3C3')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017673","html_url":"https://github.com/lmazuel/TestingRepo/issues/14#issuecomment-390017673","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/14","id":390017673,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:31Z","updated_at":"2018-05-17T21:27:31Z","author_association":"OWNER","body":"This is a test"} + +https +DELETE +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390017673 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Date', 'Thu, 17 May 2018 21:27:32 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4798'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.141787'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '16FB:97BA:C9227D:104EF10:5AFDF3C3')] + + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/pulls/2 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:32 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4797'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"e0597269209bdeaf65893e74635ff339"'), ('Last-Modified', 'Thu, 17 May 2018 21:15:05 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.132533'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '16FC:97B8:C24657:FB552C:5AFDF3C4')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/2","id":70768598,"html_url":"https://github.com/lmazuel/TestingRepo/pull/2","diff_url":"https://github.com/lmazuel/TestingRepo/pull/2.diff","patch_url":"https://github.com/lmazuel/TestingRepo/pull/2.patch","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/2","number":2,"state":"open","locked":false,"title":"Update README.md","user":{"login":"AutorestCI","id":18218145,"avatar_url":"https://avatars3.githubusercontent.com/u/18218145?v=4","gravatar_id":"","url":"https://api.github.com/users/AutorestCI","html_url":"https://github.com/AutorestCI","followers_url":"https://api.github.com/users/AutorestCI/followers","following_url":"https://api.github.com/users/AutorestCI/following{/other_user}","gists_url":"https://api.github.com/users/AutorestCI/gists{/gist_id}","starred_url":"https://api.github.com/users/AutorestCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AutorestCI/subscriptions","organizations_url":"https://api.github.com/users/AutorestCI/orgs","repos_url":"https://api.github.com/users/AutorestCI/repos","events_url":"https://api.github.com/users/AutorestCI/events{/privacy}","received_events_url":"https://api.github.com/users/AutorestCI/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-19T21:29:49Z","updated_at":"2018-05-17T21:15:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d020a4d8788aa40753ca326f0818a8cd805ac93","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/2/commits","review_comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/2/comments","review_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/2/comments","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/40d2028637a6b5f8f6ae6e595e772d6fc33b93bb","head":{"label":"AutorestCI:AutorestCI-patch-1","ref":"AutorestCI-patch-1","sha":"40d2028637a6b5f8f6ae6e595e772d6fc33b93bb","user":{"login":"AutorestCI","id":18218145,"avatar_url":"https://avatars3.githubusercontent.com/u/18218145?v=4","gravatar_id":"","url":"https://api.github.com/users/AutorestCI","html_url":"https://github.com/AutorestCI","followers_url":"https://api.github.com/users/AutorestCI/followers","following_url":"https://api.github.com/users/AutorestCI/following{/other_user}","gists_url":"https://api.github.com/users/AutorestCI/gists{/gist_id}","starred_url":"https://api.github.com/users/AutorestCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AutorestCI/subscriptions","organizations_url":"https://api.github.com/users/AutorestCI/orgs","repos_url":"https://api.github.com/users/AutorestCI/repos","events_url":"https://api.github.com/users/AutorestCI/events{/privacy}","received_events_url":"https://api.github.com/users/AutorestCI/received_events","type":"User","site_admin":false},"repo":{"id":59243826,"name":"TestingRepo","full_name":"AutorestCI/TestingRepo","owner":{"login":"AutorestCI","id":18218145,"avatar_url":"https://avatars3.githubusercontent.com/u/18218145?v=4","gravatar_id":"","url":"https://api.github.com/users/AutorestCI","html_url":"https://github.com/AutorestCI","followers_url":"https://api.github.com/users/AutorestCI/followers","following_url":"https://api.github.com/users/AutorestCI/following{/other_user}","gists_url":"https://api.github.com/users/AutorestCI/gists{/gist_id}","starred_url":"https://api.github.com/users/AutorestCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AutorestCI/subscriptions","organizations_url":"https://api.github.com/users/AutorestCI/orgs","repos_url":"https://api.github.com/users/AutorestCI/repos","events_url":"https://api.github.com/users/AutorestCI/events{/privacy}","received_events_url":"https://api.github.com/users/AutorestCI/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AutorestCI/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":true,"url":"https://api.github.com/repos/AutorestCI/TestingRepo","forks_url":"https://api.github.com/repos/AutorestCI/TestingRepo/forks","keys_url":"https://api.github.com/repos/AutorestCI/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AutorestCI/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AutorestCI/TestingRepo/teams","hooks_url":"https://api.github.com/repos/AutorestCI/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/AutorestCI/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/AutorestCI/TestingRepo/events","assignees_url":"https://api.github.com/repos/AutorestCI/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/AutorestCI/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/AutorestCI/TestingRepo/tags","blobs_url":"https://api.github.com/repos/AutorestCI/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AutorestCI/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AutorestCI/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/AutorestCI/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AutorestCI/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/AutorestCI/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/AutorestCI/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/AutorestCI/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/AutorestCI/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/AutorestCI/TestingRepo/subscription","commits_url":"https://api.github.com/repos/AutorestCI/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/AutorestCI/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/AutorestCI/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/AutorestCI/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/AutorestCI/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/AutorestCI/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AutorestCI/TestingRepo/merges","archive_url":"https://api.github.com/repos/AutorestCI/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AutorestCI/TestingRepo/downloads","issues_url":"https://api.github.com/repos/AutorestCI/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/AutorestCI/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/AutorestCI/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/AutorestCI/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AutorestCI/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/AutorestCI/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/AutorestCI/TestingRepo/deployments","created_at":"2016-05-19T21:26:35Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2016-05-19T21:28:13Z","git_url":"git://github.com/AutorestCI/TestingRepo.git","ssh_url":"git@github.com:AutorestCI/TestingRepo.git","clone_url":"https://github.com/AutorestCI/TestingRepo.git","svn_url":"https://github.com/AutorestCI/TestingRepo","homepage":null,"size":1,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"lmazuel:master","ref":"master","sha":"dd82f65f1b6314b18609b8572464b6d328ea70d4","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"repo":{"id":56793153,"name":"TestingRepo","full_name":"lmazuel/TestingRepo","owner":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmazuel/TestingRepo","description":"To test to Python Github SDK. Nothing interesting here.","fork":false,"url":"https://api.github.com/repos/lmazuel/TestingRepo","forks_url":"https://api.github.com/repos/lmazuel/TestingRepo/forks","keys_url":"https://api.github.com/repos/lmazuel/TestingRepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmazuel/TestingRepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmazuel/TestingRepo/teams","hooks_url":"https://api.github.com/repos/lmazuel/TestingRepo/hooks","issue_events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/events{/number}","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/events","assignees_url":"https://api.github.com/repos/lmazuel/TestingRepo/assignees{/user}","branches_url":"https://api.github.com/repos/lmazuel/TestingRepo/branches{/branch}","tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/tags","blobs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/{sha}","languages_url":"https://api.github.com/repos/lmazuel/TestingRepo/languages","stargazers_url":"https://api.github.com/repos/lmazuel/TestingRepo/stargazers","contributors_url":"https://api.github.com/repos/lmazuel/TestingRepo/contributors","subscribers_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscribers","subscription_url":"https://api.github.com/repos/lmazuel/TestingRepo/subscription","commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmazuel/TestingRepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmazuel/TestingRepo/contents/{+path}","compare_url":"https://api.github.com/repos/lmazuel/TestingRepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmazuel/TestingRepo/merges","archive_url":"https://api.github.com/repos/lmazuel/TestingRepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmazuel/TestingRepo/downloads","issues_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues{/number}","pulls_url":"https://api.github.com/repos/lmazuel/TestingRepo/pulls{/number}","milestones_url":"https://api.github.com/repos/lmazuel/TestingRepo/milestones{/number}","notifications_url":"https://api.github.com/repos/lmazuel/TestingRepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/labels{/name}","releases_url":"https://api.github.com/repos/lmazuel/TestingRepo/releases{/id}","deployments_url":"https://api.github.com/repos/lmazuel/TestingRepo/deployments","created_at":"2016-04-21T17:29:04Z","updated_at":"2016-04-21T17:29:04Z","pushed_at":"2018-02-14T21:55:42Z","git_url":"git://github.com/lmazuel/TestingRepo.git","ssh_url":"git@github.com:lmazuel/TestingRepo.git","clone_url":"https://github.com/lmazuel/TestingRepo.git","svn_url":"https://github.com/lmazuel/TestingRepo","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/2"},"html":{"href":"https://github.com/lmazuel/TestingRepo/pull/2"},"issue":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/issues/2"},"comments":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/lmazuel/TestingRepo/statuses/40d2028637a6b5f8f6ae6e595e772d6fc33b93bb"}},"author_association":"COLLABORATOR","merged":false,"mergeable":true,"rebaseable":false,"mergeable_state":"clean","merged_by":null,"comments":3,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":2,"deletions":0,"changed_files":1} + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/2/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "This is a test"} +201 +[('Date', 'Thu, 17 May 2018 21:27:32 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1247'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4796'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"b3aba802534abbc06eb4cee35eca6eac"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017676'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.233537'), ('X-GitHub-Request-Id', '16FD:97B8:C2466C:FB5542:5AFDF3C4')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017676","html_url":"https://github.com/lmazuel/TestingRepo/pull/2#issuecomment-390017676","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/2","id":390017676,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:32Z","updated_at":"2018-05-17T21:27:32Z","author_association":"OWNER","body":"This is a test"} + +https +DELETE +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390017676 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Date', 'Thu, 17 May 2018 21:27:33 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4795'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.189453'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '16FE:97BA:C922C2:104EF68:5AFDF3C4')] + + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_dashboard.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_dashboard.txt new file mode 100644 index 000000000000..8b62646b0d02 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_dashboard.txt @@ -0,0 +1,110 @@ +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/15 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:33 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4794'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"f7880303c57eae4c85d647cee834e3f6"'), ('Last-Modified', 'Thu, 17 May 2018 21:15:07 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.054964'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '16FF:97BA:C922DA:104EF8A:5AFDF3C5')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/15","id":293729231,"number":15,"title":"Dashboard testing","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-02T00:09:29Z","updated_at":"2018-05-17T21:15:07Z","closed_at":null,"author_association":"OWNER","body":"","closed_by":null} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/15/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:33 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4793'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"394698f297e36caa81023c22d91e8f84"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.106485'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1700:97BA:C922E8:104EF9A:5AFDF3C5')] +[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/362444226","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-362444226","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":362444226,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T00:10:56Z","updated_at":"2018-02-02T00:59:46Z","author_association":"OWNER","body":"klsfjdlkjflksd\nlskjflkdjf\n"}] + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/15/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:33 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4792'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"394698f297e36caa81023c22d91e8f84"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.066016'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1701:97B8:C246C0:FB55B0:5AFDF3C5')] +[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/362444226","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-362444226","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":362444226,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T00:10:56Z","updated_at":"2018-02-02T00:59:46Z","author_association":"OWNER","body":"klsfjdlkjflksd\nlskjflkdjf\n"}] + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/15/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "# MYHEADER"} +201 +[('Date', 'Thu, 17 May 2018 21:27:33 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1247'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4791'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"772f2729f150f5896d0a03475c5dd0c5"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.190633'), ('X-GitHub-Request-Id', '1702:97B8:C246D0:FB55C5:5AFDF3C5')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-390017687","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":390017687,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:33Z","updated_at":"2018-05-17T21:27:33Z","author_association":"OWNER","body":"# MYHEADER"} + +https +PATCH +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390017687 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "# MYHEADER\n
Encountered an unknown error: (Python bot)

\n\n```python\nsomething to do with an exception\n```\n\n

"} +200 +[('Date', 'Thu, 17 May 2018 21:27:34 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4790'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"bd0982c93a87b03a313876721ccc76a4"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.191203'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1703:97B8:C246F0:FB55EC:5AFDF3C5')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-390017687","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":390017687,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:33Z","updated_at":"2018-05-17T21:27:34Z","author_association":"OWNER","body":"# MYHEADER\n
Encountered an unknown error: (Python bot)

\n\n```python\nsomething to do with an exception\n```\n\n

"} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/15/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:34 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4789'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"b91f459a1d0337ede82a9105fa62ce19"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.075426'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1704:97BA:C92330:104F002:5AFDF3C6')] +[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/362444226","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-362444226","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":362444226,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T00:10:56Z","updated_at":"2018-02-02T00:59:46Z","author_association":"OWNER","body":"klsfjdlkjflksd\nlskjflkdjf\n"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-390017687","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":390017687,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:33Z","updated_at":"2018-05-17T21:27:34Z","author_association":"OWNER","body":"# MYHEADER\n
Encountered an unknown error: (Python bot)

\n\n```python\nsomething to do with an exception\n```\n\n

"}] + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/15/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:34 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4788'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"b91f459a1d0337ede82a9105fa62ce19"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.070095'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1705:97BA:C92342:104F012:5AFDF3C6')] +[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/362444226","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-362444226","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":362444226,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T00:10:56Z","updated_at":"2018-02-02T00:59:46Z","author_association":"OWNER","body":"klsfjdlkjflksd\nlskjflkdjf\n"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-390017687","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":390017687,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:33Z","updated_at":"2018-05-17T21:27:34Z","author_association":"OWNER","body":"# MYHEADER\n
Encountered an unknown error: (Python bot)

\n\n```python\nsomething to do with an exception\n```\n\n

"}] + +https +PATCH +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390017687 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "# MYHEADER\nNew text comment"} +200 +[('Date', 'Thu, 17 May 2018 21:27:34 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4787'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"7d8a8bf4af44d34c832747ad13a83446"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.218436'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1706:97B8:C24728:FB5638:5AFDF3C6')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-390017687","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":390017687,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:33Z","updated_at":"2018-05-17T21:27:34Z","author_association":"OWNER","body":"# MYHEADER\nNew text comment"} + +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/15/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:35 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4786'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"2765cea7edb0c5332910282095b1d4c1"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.061215'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1707:97B8:C2473C:FB5658:5AFDF3C6')] +[{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/362444226","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-362444226","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":362444226,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T00:10:56Z","updated_at":"2018-02-02T00:59:46Z","author_association":"OWNER","body":"klsfjdlkjflksd\nlskjflkdjf\n"},{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017687","html_url":"https://github.com/lmazuel/TestingRepo/issues/15#issuecomment-390017687","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/15","id":390017687,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:33Z","updated_at":"2018-05-17T21:27:34Z","author_association":"OWNER","body":"# MYHEADER\nNew text comment"}] + +https +DELETE +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390017687 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Date', 'Thu, 17 May 2018 21:27:35 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4785'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.126890'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '1708:97B4:2AC8C4:374BDD:5AFDF3C7')] + + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_exception_to_github.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_exception_to_github.txt new file mode 100644 index 000000000000..935e64e2fc1f --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_exception_to_github.txt @@ -0,0 +1,99 @@ +https +GET +api.github.com +None +/repos/lmazuel/TestingRepo/issues/13 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:35 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4784'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"5d22339274e7041343287e3bfa73f758"'), ('Last-Modified', 'Thu, 17 May 2018 21:15:10 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', 'repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.057591'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1709:97B6:61F179:7EE505:5AFDF3C7')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13","repository_url":"https://api.github.com/repos/lmazuel/TestingRepo","labels_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13/comments","events_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13/events","html_url":"https://github.com/lmazuel/TestingRepo/issues/13","id":290980764,"number":13,"title":"Testing exception","user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-01-23T20:24:40Z","updated_at":"2018-05-17T21:15:10Z","closed_at":null,"author_association":"OWNER","body":"This unittest is doing something stupid, to test I'm able to log in a generic way the stacktrace in Github","closed_by":null} + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/13/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "
Encountered an unknown error

\n\n```python\nsomething to do with an exception\n```\n\n

"} +201 +[('Date', 'Thu, 17 May 2018 21:27:35 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1367'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4783'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"02c13ce01b48f85e423f4eaaa70ae776"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017694'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.207902'), ('X-GitHub-Request-Id', '170A:97BA:C923A8:104F0A2:5AFDF3C7')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017694","html_url":"https://github.com/lmazuel/TestingRepo/issues/13#issuecomment-390017694","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13","id":390017694,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:35Z","updated_at":"2018-05-17T21:27:35Z","author_association":"OWNER","body":"
Encountered an unknown error

\n\n```python\nsomething to do with an exception\n```\n\n

"} + +https +DELETE +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390017694 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Date', 'Thu, 17 May 2018 21:27:36 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4782'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.137629'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '170B:97B6:61F19A:7EE52A:5AFDF3C7')] + + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/13/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "
Encountered an unknown error: (Python bot)

\n\n```python\nsomething to do with an exception\n```\n\n

"} +201 +[('Date', 'Thu, 17 May 2018 21:27:36 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1381'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4781'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"80a0e4c3cf7c8e5152378483fc9b6928"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017696'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.177832'), ('X-GitHub-Request-Id', '170C:97B4:2AC8D4:374BF5:5AFDF3C8')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017696","html_url":"https://github.com/lmazuel/TestingRepo/issues/13#issuecomment-390017696","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13","id":390017696,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:36Z","updated_at":"2018-05-17T21:27:36Z","author_association":"OWNER","body":"
Encountered an unknown error: (Python bot)

\n\n```python\nsomething to do with an exception\n```\n\n

"} + +https +DELETE +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390017696 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Date', 'Thu, 17 May 2018 21:27:36 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4780'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.152868'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '170D:97BA:C923DA:104F0E5:5AFDF3C8')] + + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/13/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "
Encountered a Subprocess error: (Python bot)

\n\nCommand: ['autorest', 'readme.md']\nFinished with return code 2\nand output:\n```shell\nError line 1\nError line 2\n```\n\n

"} +201 +[('Date', 'Thu, 17 May 2018 21:27:36 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1453'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4779'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"1b1b351c9807c836fbc5facac7829561"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017699'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.193468'), ('X-GitHub-Request-Id', '170E:97B6:61F1CD:7EE566:5AFDF3C8')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017699","html_url":"https://github.com/lmazuel/TestingRepo/issues/13#issuecomment-390017699","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13","id":390017699,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:36Z","updated_at":"2018-05-17T21:27:36Z","author_association":"OWNER","body":"
Encountered a Subprocess error: (Python bot)

\n\nCommand: ['autorest', 'readme.md']\nFinished with return code 2\nand output:\n```shell\nError line 1\nError line 2\n```\n\n

"} + +https +DELETE +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390017699 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Date', 'Thu, 17 May 2018 21:27:37 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4778'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.129749'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '170F:97BA:C92400:104F11E:5AFDF3C8')] + + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/issues/13/comments +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"body": "
Encountered a Subprocess error: (Python bot)

\n\nCommand: ['autorest', 'readme.md']\nFinished with return code 2\nand no output\n\n

"} +201 +[('Date', 'Thu, 17 May 2018 21:27:37 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '1412'), ('Server', 'GitHub.com'), ('Status', '201 Created'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4777'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', '"c63186bf115722901d5391428f67a13b"'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('Location', 'https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017701'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.211042'), ('X-GitHub-Request-Id', '1710:97B8:C24810:FB5779:5AFDF3C9')] +{"url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/comments/390017701","html_url":"https://github.com/lmazuel/TestingRepo/issues/13#issuecomment-390017701","issue_url":"https://api.github.com/repos/lmazuel/TestingRepo/issues/13","id":390017701,"user":{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T21:27:37Z","updated_at":"2018-05-17T21:27:37Z","author_association":"OWNER","body":"
Encountered a Subprocess error: (Python bot)

\n\nCommand: ['autorest', 'readme.md']\nFinished with return code 2\nand no output\n\n

"} + +https +DELETE +api.github.com +None +/repos/lmazuel/TestingRepo/issues/comments/390017701 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +204 +[('Date', 'Thu, 17 May 2018 21:27:37 GMT'), ('Content-Type', 'application/octet-stream'), ('Server', 'GitHub.com'), ('Status', '204 No Content'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4776'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.150903'), ('Vary', 'Accept-Encoding'), ('X-GitHub-Request-Id', '1711:97BA:C92421:104F154:5AFDF3C9')] + + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_get_files.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_get_files.txt new file mode 100644 index 000000000000..5cc5b47e4f6a --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_get_files.txt @@ -0,0 +1,33 @@ +https +GET +api.github.com +None +/repos/Azure/azure-sdk-for-python/pulls/1833 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:38 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4775'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"efe380b23abd3372e84ff35dbd437a3c"'), ('Last-Modified', 'Thu, 29 Mar 2018 00:23:35 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.134239'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1712:97B8:C2483A:FB57AE:5AFDF3C9')] +{"url":"https://api.github.com/repos/Azure/azure-sdk-for-python/pulls/1833","id":165209780,"html_url":"https://github.com/Azure/azure-sdk-for-python/pull/1833","diff_url":"https://github.com/Azure/azure-sdk-for-python/pull/1833.diff","patch_url":"https://github.com/Azure/azure-sdk-for-python/pull/1833.patch","issue_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/issues/1833","number":1833,"state":"closed","locked":false,"title":"Automatic PR of restapi_auto_bgsky_master into master","user":{"login":"AutorestCI","id":18218145,"avatar_url":"https://avatars3.githubusercontent.com/u/18218145?v=4","gravatar_id":"","url":"https://api.github.com/users/AutorestCI","html_url":"https://github.com/AutorestCI","followers_url":"https://api.github.com/users/AutorestCI/followers","following_url":"https://api.github.com/users/AutorestCI/following{/other_user}","gists_url":"https://api.github.com/users/AutorestCI/gists{/gist_id}","starred_url":"https://api.github.com/users/AutorestCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AutorestCI/subscriptions","organizations_url":"https://api.github.com/users/AutorestCI/orgs","repos_url":"https://api.github.com/users/AutorestCI/repos","events_url":"https://api.github.com/users/AutorestCI/events{/privacy}","received_events_url":"https://api.github.com/users/AutorestCI/received_events","type":"User","site_admin":false},"body":"Created to sync https://github.com/Azure/azure-rest-api-specs/pull/2335","created_at":"2018-01-25T19:40:09Z","updated_at":"2018-02-06T18:26:44Z","closed_at":"2018-02-06T18:26:41Z","merged_at":null,"merge_commit_sha":"7a4bc4682149db0f88b1ad628b432fe90ae87786","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":803155593,"url":"https://api.github.com/repos/Azure/azure-sdk-for-python/labels/RestPRMerged","name":"RestPRMerged","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/pulls/1833/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/pulls/1833/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/issues/1833/comments","statuses_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/statuses/3d6c419cd2ade53c240c40db96dbe34957351244","head":{"label":"Azure:restapi_auto_bgsky_master","ref":"restapi_auto_bgsky_master","sha":"3d6c419cd2ade53c240c40db96dbe34957351244","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":4127088,"name":"azure-sdk-for-python","full_name":"Azure/azure-sdk-for-python","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-sdk-for-python","description":"Microsoft Azure SDK for Python","fork":false,"url":"https://api.github.com/repos/Azure/azure-sdk-for-python","forks_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/forks","keys_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/teams","hooks_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/events","assignees_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/tags","blobs_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/subscription","commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/merges","archive_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/downloads","issues_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/deployments","created_at":"2012-04-24T16:46:12Z","updated_at":"2018-05-16T23:44:09Z","pushed_at":"2018-05-17T20:20:22Z","git_url":"git://github.com/Azure/azure-sdk-for-python.git","ssh_url":"git@github.com:Azure/azure-sdk-for-python.git","clone_url":"https://github.com/Azure/azure-sdk-for-python.git","svn_url":"https://github.com/Azure/azure-sdk-for-python","homepage":"","size":64485,"stargazers_count":536,"watchers_count":536,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":450,"mirror_url":null,"archived":false,"open_issues_count":176,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":450,"open_issues":176,"watchers":536,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"f4715da4f929733b2b95c03142512f85ae8728a5","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":4127088,"name":"azure-sdk-for-python","full_name":"Azure/azure-sdk-for-python","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-sdk-for-python","description":"Microsoft Azure SDK for Python","fork":false,"url":"https://api.github.com/repos/Azure/azure-sdk-for-python","forks_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/forks","keys_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/teams","hooks_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/events","assignees_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/tags","blobs_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/subscription","commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/merges","archive_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/downloads","issues_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/deployments","created_at":"2012-04-24T16:46:12Z","updated_at":"2018-05-16T23:44:09Z","pushed_at":"2018-05-17T20:20:22Z","git_url":"git://github.com/Azure/azure-sdk-for-python.git","ssh_url":"git@github.com:Azure/azure-sdk-for-python.git","clone_url":"https://github.com/Azure/azure-sdk-for-python.git","svn_url":"https://github.com/Azure/azure-sdk-for-python","homepage":"","size":64485,"stargazers_count":536,"watchers_count":536,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":450,"mirror_url":null,"archived":false,"open_issues_count":176,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":450,"open_issues":176,"watchers":536,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-python/pulls/1833"},"html":{"href":"https://github.com/Azure/azure-sdk-for-python/pull/1833"},"issue":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-python/issues/1833"},"comments":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-python/issues/1833/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-python/pulls/1833/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-python/pulls/1833/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-python/statuses/3d6c419cd2ade53c240c40db96dbe34957351244"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":1,"review_comments":0,"maintainer_can_modify":false,"commits":9,"additions":1941,"deletions":43,"changed_files":23} + +https +GET +api.github.com +None +/repos/Azure/azure-sdk-for-python/pulls/1833/files +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:38 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4774'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"974102d71c3b4d54ea78ae6faeddeb4d"'), ('Last-Modified', 'Thu, 29 Mar 2018 00:23:35 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.104289'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1713:97B6:61F208:7EE5BA:5AFDF3CA')] +[{"sha":"bf24d5ec847de2a0e8e63082550a5bcfeac05048","filename":"azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py","status":"modified","additions":33,"deletions":4,"changes":37,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -14,9 +14,12 @@\n from msrestazure import AzureConfiguration\n from .version import VERSION\n from .operations.usage_details_operations import UsageDetailsOperations\n+from .operations.marketplaces_operations import MarketplacesOperations\n from .operations.reservations_summaries_operations import ReservationsSummariesOperations\n from .operations.reservations_details_operations import ReservationsDetailsOperations\n+from .operations.budgets_operations import BudgetsOperations\n from .operations.operations import Operations\n+from .operations.price_sheet_operations import PriceSheetOperations\n from . import models\n \n \n@@ -30,16 +33,24 @@ class ConsumptionManagementClientConfiguration(AzureConfiguration):\n object`\n :param subscription_id: Azure Subscription ID.\n :type subscription_id: str\n+ :param resource_group_name: Azure Resource Group Name.\n+ :type resource_group_name: str\n+ :param budget_name: Budget Name.\n+ :type budget_name: str\n :param str base_url: Service URL\n \"\"\"\n \n def __init__(\n- self, credentials, subscription_id, base_url=None):\n+ self, credentials, subscription_id, resource_group_name, budget_name, base_url=None):\n \n if credentials is None:\n raise ValueError(\"Parameter 'credentials' must not be None.\")\n if subscription_id is None:\n raise ValueError(\"Parameter 'subscription_id' must not be None.\")\n+ if resource_group_name is None:\n+ raise ValueError(\"Parameter 'resource_group_name' must not be None.\")\n+ if budget_name is None:\n+ raise ValueError(\"Parameter 'budget_name' must not be None.\")\n if not base_url:\n base_url = 'https://management.azure.com'\n \n@@ -50,6 +61,8 @@ def __init__(\n \n self.credentials = credentials\n self.subscription_id = subscription_id\n+ self.resource_group_name = resource_group_name\n+ self.budget_name = budget_name\n \n \n class ConsumptionManagementClient(object):\n@@ -60,37 +73,53 @@ class ConsumptionManagementClient(object):\n \n :ivar usage_details: UsageDetails operations\n :vartype usage_details: azure.mgmt.consumption.operations.UsageDetailsOperations\n+ :ivar marketplaces: Marketplaces operations\n+ :vartype marketplaces: azure.mgmt.consumption.operations.MarketplacesOperations\n :ivar reservations_summaries: ReservationsSummaries operations\n :vartype reservations_summaries: azure.mgmt.consumption.operations.ReservationsSummariesOperations\n :ivar reservations_details: ReservationsDetails operations\n :vartype reservations_details: azure.mgmt.consumption.operations.ReservationsDetailsOperations\n+ :ivar budgets: Budgets operations\n+ :vartype budgets: azure.mgmt.consumption.operations.BudgetsOperations\n :ivar operations: Operations operations\n :vartype operations: azure.mgmt.consumption.operations.Operations\n+ :ivar price_sheet: PriceSheet operations\n+ :vartype price_sheet: azure.mgmt.consumption.operations.PriceSheetOperations\n \n :param credentials: Credentials needed for the client to connect to Azure.\n :type credentials: :mod:`A msrestazure Credentials\n object`\n :param subscription_id: Azure Subscription ID.\n :type subscription_id: str\n+ :param resource_group_name: Azure Resource Group Name.\n+ :type resource_group_name: str\n+ :param budget_name: Budget Name.\n+ :type budget_name: str\n :param str base_url: Service URL\n \"\"\"\n \n def __init__(\n- self, credentials, subscription_id, base_url=None):\n+ self, credentials, subscription_id, resource_group_name, budget_name, base_url=None):\n \n- self.config = ConsumptionManagementClientConfiguration(credentials, subscription_id, base_url)\n+ self.config = ConsumptionManagementClientConfiguration(credentials, subscription_id, resource_group_name, budget_name, base_url)\n self._client = ServiceClient(self.config.credentials, self.config)\n \n client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}\n- self.api_version = '2017-11-30'\n+ self.api_version = '2018-01-31'\n self._serialize = Serializer(client_models)\n self._deserialize = Deserializer(client_models)\n \n self.usage_details = UsageDetailsOperations(\n self._client, self.config, self._serialize, self._deserialize)\n+ self.marketplaces = MarketplacesOperations(\n+ self._client, self.config, self._serialize, self._deserialize)\n self.reservations_summaries = ReservationsSummariesOperations(\n self._client, self.config, self._serialize, self._deserialize)\n self.reservations_details = ReservationsDetailsOperations(\n self._client, self.config, self._serialize, self._deserialize)\n+ self.budgets = BudgetsOperations(\n+ self._client, self.config, self._serialize, self._deserialize)\n self.operations = Operations(\n self._client, self.config, self._serialize, self._deserialize)\n+ self.price_sheet = PriceSheetOperations(\n+ self._client, self.config, self._serialize, self._deserialize)"},{"sha":"d071f7f2e49d6159288f76e17b5cf2c52f900933","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py","status":"modified","additions":28,"deletions":0,"changes":28,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -11,34 +11,62 @@\n \n from .meter_details import MeterDetails\n from .usage_detail import UsageDetail\n+from .marketplace import Marketplace\n from .reservation_summaries import ReservationSummaries\n from .reservation_details import ReservationDetails\n+from .budget_time_period import BudgetTimePeriod\n+from .filters import Filters\n+from .current_spend import CurrentSpend\n+from .notification import Notification\n+from .budget import Budget\n from .error_details import ErrorDetails\n from .error_response import ErrorResponse, ErrorResponseException\n from .operation_display import OperationDisplay\n from .operation import Operation\n from .resource import Resource\n+from .proxy_resource import ProxyResource\n+from .price_sheet_list_result import PriceSheetListResult\n+from .price_sheet_model import PriceSheetModel\n from .usage_detail_paged import UsageDetailPaged\n+from .marketplace_paged import MarketplacePaged\n from .reservation_summaries_paged import ReservationSummariesPaged\n from .reservation_details_paged import ReservationDetailsPaged\n+from .budget_paged import BudgetPaged\n from .operation_paged import OperationPaged\n from .consumption_management_client_enums import (\n+ CategoryType,\n+ TimeGrainType,\n+ OperatorType,\n Datagrain,\n )\n \n __all__ = [\n 'MeterDetails',\n 'UsageDetail',\n+ 'Marketplace',\n 'ReservationSummaries',\n 'ReservationDetails',\n+ 'BudgetTimePeriod',\n+ 'Filters',\n+ 'CurrentSpend',\n+ 'Notification',\n+ 'Budget',\n 'ErrorDetails',\n 'ErrorResponse', 'ErrorResponseException',\n 'OperationDisplay',\n 'Operation',\n 'Resource',\n+ 'ProxyResource',\n+ 'PriceSheetListResult',\n+ 'PriceSheetModel',\n 'UsageDetailPaged',\n+ 'MarketplacePaged',\n 'ReservationSummariesPaged',\n 'ReservationDetailsPaged',\n+ 'BudgetPaged',\n 'OperationPaged',\n+ 'CategoryType',\n+ 'TimeGrainType',\n+ 'OperatorType',\n 'Datagrain',\n ]"},{"sha":"f6485d49266ddf2734c02ab55dceb9aba94bfe0a","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py","status":"added","additions":91,"deletions":0,"changes":91,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,91 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from .proxy_resource import ProxyResource\n+\n+\n+class Budget(ProxyResource):\n+ \"\"\"A budget resource.\n+\n+ Variables are only populated by the server, and will be ignored when\n+ sending a request.\n+\n+ :ivar id: Resource Id.\n+ :vartype id: str\n+ :ivar name: Resource name.\n+ :vartype name: str\n+ :ivar type: Resource type.\n+ :vartype type: str\n+ :param e_tag: eTag of the resource. To handle concurrent update scenarion,\n+ this field will be used to determine whether the user is updating the\n+ latest version or not.\n+ :type e_tag: str\n+ :param category: The category of the budget, whether the budget tracks\n+ cost or usage. Possible values include: 'Cost', 'Usage'\n+ :type category: str or ~azure.mgmt.consumption.models.CategoryType\n+ :param amount: The total amount of cost to track with the budget\n+ :type amount: decimal.Decimal\n+ :param time_grain: The time covered by a budget. Tracking of the amount\n+ will be reset based on the time grain. Possible values include: 'Monthly',\n+ 'Quarterly', 'Annually'\n+ :type time_grain: str or ~azure.mgmt.consumption.models.TimeGrainType\n+ :param time_period: Has start and end date of the budget. The start date\n+ must be first of the month and should be less than the end date. Budget\n+ start date must be on or after June 1, 2017. Future start date should not\n+ be more than three months. Past start date should be selected within the\n+ timegrain preiod. There are no restrictions on the end date.\n+ :type time_period: ~azure.mgmt.consumption.models.BudgetTimePeriod\n+ :param filters: May be used to filter budgets by resource group, resource,\n+ or meter.\n+ :type filters: ~azure.mgmt.consumption.models.Filters\n+ :ivar current_spend: The current amount of cost which is being tracked for\n+ a budget.\n+ :vartype current_spend: ~azure.mgmt.consumption.models.CurrentSpend\n+ :param notifications: Dictionary of notifications associated with the\n+ budget. Budget can have up to five notifications.\n+ :type notifications: dict[str,\n+ ~azure.mgmt.consumption.models.Notification]\n+ \"\"\"\n+\n+ _validation = {\n+ 'id': {'readonly': True},\n+ 'name': {'readonly': True},\n+ 'type': {'readonly': True},\n+ 'category': {'required': True},\n+ 'amount': {'required': True},\n+ 'time_grain': {'required': True},\n+ 'time_period': {'required': True},\n+ 'current_spend': {'readonly': True},\n+ }\n+\n+ _attribute_map = {\n+ 'id': {'key': 'id', 'type': 'str'},\n+ 'name': {'key': 'name', 'type': 'str'},\n+ 'type': {'key': 'type', 'type': 'str'},\n+ 'e_tag': {'key': 'eTag', 'type': 'str'},\n+ 'category': {'key': 'properties.category', 'type': 'str'},\n+ 'amount': {'key': 'properties.amount', 'type': 'decimal'},\n+ 'time_grain': {'key': 'properties.timeGrain', 'type': 'str'},\n+ 'time_period': {'key': 'properties.timePeriod', 'type': 'BudgetTimePeriod'},\n+ 'filters': {'key': 'properties.filters', 'type': 'Filters'},\n+ 'current_spend': {'key': 'properties.currentSpend', 'type': 'CurrentSpend'},\n+ 'notifications': {'key': 'properties.notifications', 'type': '{Notification}'},\n+ }\n+\n+ def __init__(self, category, amount, time_grain, time_period, e_tag=None, filters=None, notifications=None):\n+ super(Budget, self).__init__(e_tag=e_tag)\n+ self.category = category\n+ self.amount = amount\n+ self.time_grain = time_grain\n+ self.time_period = time_period\n+ self.filters = filters\n+ self.current_spend = None\n+ self.notifications = notifications"},{"sha":"2668382253e2d7aaefb8665a466d2482193e0246","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py","status":"added","additions":27,"deletions":0,"changes":27,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,27 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.paging import Paged\n+\n+\n+class BudgetPaged(Paged):\n+ \"\"\"\n+ A paging container for iterating over a list of :class:`Budget ` object\n+ \"\"\"\n+\n+ _attribute_map = {\n+ 'next_link': {'key': 'nextLink', 'type': 'str'},\n+ 'current_page': {'key': 'value', 'type': '[Budget]'}\n+ }\n+\n+ def __init__(self, *args, **kwargs):\n+\n+ super(BudgetPaged, self).__init__(*args, **kwargs)"},{"sha":"2b1c0e78418a1deb6b6147fc90ea53f1a03256d0","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py","status":"added","additions":37,"deletions":0,"changes":37,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,37 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.serialization import Model\n+\n+\n+class BudgetTimePeriod(Model):\n+ \"\"\"The start and end date for a budget.\n+\n+ :param start_date: The start date for the budget.\n+ :type start_date: datetime\n+ :param end_date: The end date for the budget. If not provided, we default\n+ this to 10 years from the start date.\n+ :type end_date: datetime\n+ \"\"\"\n+\n+ _validation = {\n+ 'start_date': {'required': True},\n+ }\n+\n+ _attribute_map = {\n+ 'start_date': {'key': 'startDate', 'type': 'iso-8601'},\n+ 'end_date': {'key': 'endDate', 'type': 'iso-8601'},\n+ }\n+\n+ def __init__(self, start_date, end_date=None):\n+ super(BudgetTimePeriod, self).__init__()\n+ self.start_date = start_date\n+ self.end_date = end_date"},{"sha":"bb0db82f76b32c1d02cca1de69b0ecc49b3b548b","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py","status":"modified","additions":20,"deletions":0,"changes":20,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -12,6 +12,26 @@\n from enum import Enum\n \n \n+class CategoryType(Enum):\n+\n+ cost = \"Cost\"\n+ usage = \"Usage\"\n+\n+\n+class TimeGrainType(Enum):\n+\n+ monthly = \"Monthly\"\n+ quarterly = \"Quarterly\"\n+ annually = \"Annually\"\n+\n+\n+class OperatorType(Enum):\n+\n+ equal_to = \"EqualTo\"\n+ greater_than = \"GreaterThan\"\n+ greater_than_or_equal_to = \"GreaterThanOrEqualTo\"\n+\n+\n class Datagrain(Enum):\n \n daily_grain = \"daily\""},{"sha":"839c286b104079f531a4b130f3e01082d63d08ac","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py","status":"added","additions":41,"deletions":0,"changes":41,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,41 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.serialization import Model\n+\n+\n+class CurrentSpend(Model):\n+ \"\"\"The current amount of cost which is being tracked for a budget.\n+\n+ Variables are only populated by the server, and will be ignored when\n+ sending a request.\n+\n+ :ivar amount: The total amount of cost which is being tracked by the\n+ budget.\n+ :vartype amount: decimal.Decimal\n+ :ivar unit: The unit of measure for the budget amount.\n+ :vartype unit: str\n+ \"\"\"\n+\n+ _validation = {\n+ 'amount': {'readonly': True},\n+ 'unit': {'readonly': True},\n+ }\n+\n+ _attribute_map = {\n+ 'amount': {'key': 'amount', 'type': 'decimal'},\n+ 'unit': {'key': 'unit', 'type': 'str'},\n+ }\n+\n+ def __init__(self):\n+ super(CurrentSpend, self).__init__()\n+ self.amount = None\n+ self.unit = None"},{"sha":"dc010a065900621f02b77dfe1b389071e597fd73","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py","status":"added","additions":44,"deletions":0,"changes":44,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,44 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.serialization import Model\n+\n+\n+class Filters(Model):\n+ \"\"\"May be used to filter budgets by resource group, resource, or meter.\n+\n+ :param resource_groups: The list of filters on resource groups, allowed at\n+ subscription level only.\n+ :type resource_groups: list[str]\n+ :param resources: The list of filters on resources.\n+ :type resources: list[str]\n+ :param meters: The list of filters on meters, mandatory for budgets of\n+ usage category.\n+ :type meters: list[str]\n+ \"\"\"\n+\n+ _validation = {\n+ 'resource_groups': {'max_items': 10, 'min_items': 0},\n+ 'resources': {'max_items': 10, 'min_items': 0},\n+ 'meters': {'max_items': 10, 'min_items': 0},\n+ }\n+\n+ _attribute_map = {\n+ 'resource_groups': {'key': 'resourceGroups', 'type': '[str]'},\n+ 'resources': {'key': 'resources', 'type': '[str]'},\n+ 'meters': {'key': 'meters', 'type': '[str]'},\n+ }\n+\n+ def __init__(self, resource_groups=None, resources=None, meters=None):\n+ super(Filters, self).__init__()\n+ self.resource_groups = resource_groups\n+ self.resources = resources\n+ self.meters = meters"},{"sha":"d401f3fdc397e6aa0d40011f987917ef0984a8bc","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py","status":"added","additions":174,"deletions":0,"changes":174,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,174 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from .resource import Resource\n+\n+\n+class Marketplace(Resource):\n+ \"\"\"An marketplace resource.\n+\n+ Variables are only populated by the server, and will be ignored when\n+ sending a request.\n+\n+ :ivar id: Resource Id.\n+ :vartype id: str\n+ :ivar name: Resource name.\n+ :vartype name: str\n+ :ivar type: Resource type.\n+ :vartype type: str\n+ :ivar tags: Resource tags.\n+ :vartype tags: dict[str, str]\n+ :ivar billing_period_id: The id of the billing period resource that the\n+ usage belongs to.\n+ :vartype billing_period_id: str\n+ :ivar usage_start: The start of the date time range covered by the usage\n+ detail.\n+ :vartype usage_start: datetime\n+ :ivar usage_end: The end of the date time range covered by the usage\n+ detail.\n+ :vartype usage_end: datetime\n+ :ivar resource_rate: The marketplace resource rate.\n+ :vartype resource_rate: decimal.Decimal\n+ :ivar offer_name: The type of offer.\n+ :vartype offer_name: str\n+ :ivar resource_group: The name of resource group.\n+ :vartype resource_group: str\n+ :ivar order_number: The order number.\n+ :vartype order_number: str\n+ :ivar instance_name: The name of the resource instance that the usage is\n+ about.\n+ :vartype instance_name: str\n+ :ivar instance_id: The uri of the resource instance that the usage is\n+ about.\n+ :vartype instance_id: str\n+ :ivar currency: The ISO currency in which the meter is charged, for\n+ example, USD.\n+ :vartype currency: str\n+ :ivar consumed_quantity: The quantity of usage.\n+ :vartype consumed_quantity: decimal.Decimal\n+ :ivar unit_of_measure: The unit of measure.\n+ :vartype unit_of_measure: str\n+ :ivar pretax_cost: The amount of cost before tax.\n+ :vartype pretax_cost: decimal.Decimal\n+ :ivar is_estimated: The estimated usage is subject to change.\n+ :vartype is_estimated: bool\n+ :ivar meter_id: The meter id.\n+ :vartype meter_id: str\n+ :ivar subscription_guid: Subscription guid.\n+ :vartype subscription_guid: str\n+ :ivar subscription_name: Subscription name.\n+ :vartype subscription_name: str\n+ :ivar account_name: Account name.\n+ :vartype account_name: str\n+ :ivar department_name: Department name.\n+ :vartype department_name: str\n+ :ivar consumed_service: Consumed service name.\n+ :vartype consumed_service: str\n+ :ivar cost_center: The cost center of this department if it is a\n+ department and a costcenter exists\n+ :vartype cost_center: str\n+ :ivar additional_properties: Additional details of this usage item. By\n+ default this is not populated, unless it's specified in $expand.\n+ :vartype additional_properties: str\n+ :ivar publisher_name: The name of publisher.\n+ :vartype publisher_name: str\n+ :ivar plan_name: The name of plan.\n+ :vartype plan_name: str\n+ \"\"\"\n+\n+ _validation = {\n+ 'id': {'readonly': True},\n+ 'name': {'readonly': True},\n+ 'type': {'readonly': True},\n+ 'tags': {'readonly': True},\n+ 'billing_period_id': {'readonly': True},\n+ 'usage_start': {'readonly': True},\n+ 'usage_end': {'readonly': True},\n+ 'resource_rate': {'readonly': True},\n+ 'offer_name': {'readonly': True},\n+ 'resource_group': {'readonly': True},\n+ 'order_number': {'readonly': True},\n+ 'instance_name': {'readonly': True},\n+ 'instance_id': {'readonly': True},\n+ 'currency': {'readonly': True},\n+ 'consumed_quantity': {'readonly': True},\n+ 'unit_of_measure': {'readonly': True},\n+ 'pretax_cost': {'readonly': True},\n+ 'is_estimated': {'readonly': True},\n+ 'meter_id': {'readonly': True},\n+ 'subscription_guid': {'readonly': True},\n+ 'subscription_name': {'readonly': True},\n+ 'account_name': {'readonly': True},\n+ 'department_name': {'readonly': True},\n+ 'consumed_service': {'readonly': True},\n+ 'cost_center': {'readonly': True},\n+ 'additional_properties': {'readonly': True},\n+ 'publisher_name': {'readonly': True},\n+ 'plan_name': {'readonly': True},\n+ }\n+\n+ _attribute_map = {\n+ 'id': {'key': 'id', 'type': 'str'},\n+ 'name': {'key': 'name', 'type': 'str'},\n+ 'type': {'key': 'type', 'type': 'str'},\n+ 'tags': {'key': 'tags', 'type': '{str}'},\n+ 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'},\n+ 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'},\n+ 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'},\n+ 'resource_rate': {'key': 'properties.resourceRate', 'type': 'decimal'},\n+ 'offer_name': {'key': 'properties.offerName', 'type': 'str'},\n+ 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'},\n+ 'order_number': {'key': 'properties.orderNumber', 'type': 'str'},\n+ 'instance_name': {'key': 'properties.instanceName', 'type': 'str'},\n+ 'instance_id': {'key': 'properties.instanceId', 'type': 'str'},\n+ 'currency': {'key': 'properties.currency', 'type': 'str'},\n+ 'consumed_quantity': {'key': 'properties.consumedQuantity', 'type': 'decimal'},\n+ 'unit_of_measure': {'key': 'properties.unitOfMeasure', 'type': 'str'},\n+ 'pretax_cost': {'key': 'properties.pretaxCost', 'type': 'decimal'},\n+ 'is_estimated': {'key': 'properties.isEstimated', 'type': 'bool'},\n+ 'meter_id': {'key': 'properties.meterId', 'type': 'str'},\n+ 'subscription_guid': {'key': 'properties.subscriptionGuid', 'type': 'str'},\n+ 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'},\n+ 'account_name': {'key': 'properties.accountName', 'type': 'str'},\n+ 'department_name': {'key': 'properties.departmentName', 'type': 'str'},\n+ 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'},\n+ 'cost_center': {'key': 'properties.costCenter', 'type': 'str'},\n+ 'additional_properties': {'key': 'properties.additionalProperties', 'type': 'str'},\n+ 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'},\n+ 'plan_name': {'key': 'properties.planName', 'type': 'str'},\n+ }\n+\n+ def __init__(self):\n+ super(Marketplace, self).__init__()\n+ self.billing_period_id = None\n+ self.usage_start = None\n+ self.usage_end = None\n+ self.resource_rate = None\n+ self.offer_name = None\n+ self.resource_group = None\n+ self.order_number = None\n+ self.instance_name = None\n+ self.instance_id = None\n+ self.currency = None\n+ self.consumed_quantity = None\n+ self.unit_of_measure = None\n+ self.pretax_cost = None\n+ self.is_estimated = None\n+ self.meter_id = None\n+ self.subscription_guid = None\n+ self.subscription_name = None\n+ self.account_name = None\n+ self.department_name = None\n+ self.consumed_service = None\n+ self.cost_center = None\n+ self.additional_properties = None\n+ self.publisher_name = None\n+ self.plan_name = None"},{"sha":"d360761aca550436c8a2be210180f36920169c06","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_paged.py","status":"added","additions":27,"deletions":0,"changes":27,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_paged.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_paged.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_paged.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,27 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.paging import Paged\n+\n+\n+class MarketplacePaged(Paged):\n+ \"\"\"\n+ A paging container for iterating over a list of :class:`Marketplace ` object\n+ \"\"\"\n+\n+ _attribute_map = {\n+ 'next_link': {'key': 'nextLink', 'type': 'str'},\n+ 'current_page': {'key': 'value', 'type': '[Marketplace]'}\n+ }\n+\n+ def __init__(self, *args, **kwargs):\n+\n+ super(MarketplacePaged, self).__init__(*args, **kwargs)"},{"sha":"61e1ca0ed34df63b0df71d2970b19f7fa8a866bd","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py","status":"added","additions":62,"deletions":0,"changes":62,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,62 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.serialization import Model\n+\n+\n+class Notification(Model):\n+ \"\"\"The notification associated with a budget.\n+\n+ :param enabled: The notification is enabled or not.\n+ :type enabled: bool\n+ :param operator: The comparison operator. Possible values include:\n+ 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo'\n+ :type operator: str or ~azure.mgmt.consumption.models.OperatorType\n+ :param threshold: Threshold value associated with a notification.\n+ Notification is sent when the cost exceeded the threshold. It is always\n+ percent and has to be between 0 and 1000.\n+ :type threshold: decimal.Decimal\n+ :param contact_emails: Email addresses to send the budget notification to\n+ when the threshold is exceeded.\n+ :type contact_emails: list[str]\n+ :param contact_roles: Contact roles to send the budget notification to\n+ when the threshold is exceeded.\n+ :type contact_roles: list[str]\n+ :param contact_groups: Action groups to send the budget notification to\n+ when the threshold is exceeded.\n+ :type contact_groups: list[str]\n+ \"\"\"\n+\n+ _validation = {\n+ 'enabled': {'required': True},\n+ 'operator': {'required': True},\n+ 'threshold': {'required': True},\n+ 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 1},\n+ 'contact_groups': {'max_items': 50, 'min_items': 0},\n+ }\n+\n+ _attribute_map = {\n+ 'enabled': {'key': 'enabled', 'type': 'bool'},\n+ 'operator': {'key': 'operator', 'type': 'str'},\n+ 'threshold': {'key': 'threshold', 'type': 'decimal'},\n+ 'contact_emails': {'key': 'contactEmails', 'type': '[str]'},\n+ 'contact_roles': {'key': 'contactRoles', 'type': '[str]'},\n+ 'contact_groups': {'key': 'contactGroups', 'type': '[str]'},\n+ }\n+\n+ def __init__(self, enabled, operator, threshold, contact_emails, contact_roles=None, contact_groups=None):\n+ super(Notification, self).__init__()\n+ self.enabled = enabled\n+ self.operator = operator\n+ self.threshold = threshold\n+ self.contact_emails = contact_emails\n+ self.contact_roles = contact_roles\n+ self.contact_groups = contact_groups"},{"sha":"6b201161f1dd7f05fef48e2355c696e882bb029c","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_list_result.py","status":"added","additions":41,"deletions":0,"changes":41,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_list_result.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_list_result.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_list_result.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,41 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.serialization import Model\n+\n+\n+class PriceSheetListResult(Model):\n+ \"\"\"price sheet result. It contains the pricesheet associated with billing\n+ period.\n+\n+ Variables are only populated by the server, and will be ignored when\n+ sending a request.\n+\n+ :ivar value: Price sheet\n+ :vartype value: object\n+ :ivar next_link: The link (url) to the next page of results.\n+ :vartype next_link: str\n+ \"\"\"\n+\n+ _validation = {\n+ 'value': {'readonly': True},\n+ 'next_link': {'readonly': True},\n+ }\n+\n+ _attribute_map = {\n+ 'value': {'key': 'value', 'type': 'object'},\n+ 'next_link': {'key': 'nextLink', 'type': 'str'},\n+ }\n+\n+ def __init__(self):\n+ super(PriceSheetListResult, self).__init__()\n+ self.value = None\n+ self.next_link = None"},{"sha":"0f51585aa714c16764b94d5170b6f65e3f4b5ac0","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_model.py","status":"added","additions":88,"deletions":0,"changes":88,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_model.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_model.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_model.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,88 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from .resource import Resource\n+\n+\n+class PriceSheetModel(Resource):\n+ \"\"\"An pricesheet resource.\n+\n+ Variables are only populated by the server, and will be ignored when\n+ sending a request.\n+\n+ :ivar id: Resource Id.\n+ :vartype id: str\n+ :ivar name: Resource name.\n+ :vartype name: str\n+ :ivar type: Resource type.\n+ :vartype type: str\n+ :ivar tags: Resource tags.\n+ :vartype tags: dict[str, str]\n+ :ivar billing_period_id: The id of the billing period resource that the\n+ usage belongs to.\n+ :vartype billing_period_id: str\n+ :ivar meter_id: The meter id\n+ :vartype meter_id: str\n+ :ivar meter_details: The details about the meter. By default this is not\n+ populated, unless it's specified in $expand.\n+ :vartype meter_details: ~azure.mgmt.consumption.models.MeterDetails\n+ :ivar unit_of_measure: Unit of measure\n+ :vartype unit_of_measure: str\n+ :ivar included_quantity: Included quality for an offer\n+ :vartype included_quantity: decimal.Decimal\n+ :ivar part_number: Part Number\n+ :vartype part_number: str\n+ :ivar unit_price: Unit Price\n+ :vartype unit_price: decimal.Decimal\n+ :ivar currency_code: Currency Code\n+ :vartype currency_code: str\n+ \"\"\"\n+\n+ _validation = {\n+ 'id': {'readonly': True},\n+ 'name': {'readonly': True},\n+ 'type': {'readonly': True},\n+ 'tags': {'readonly': True},\n+ 'billing_period_id': {'readonly': True},\n+ 'meter_id': {'readonly': True},\n+ 'meter_details': {'readonly': True},\n+ 'unit_of_measure': {'readonly': True},\n+ 'included_quantity': {'readonly': True},\n+ 'part_number': {'readonly': True},\n+ 'unit_price': {'readonly': True},\n+ 'currency_code': {'readonly': True},\n+ }\n+\n+ _attribute_map = {\n+ 'id': {'key': 'id', 'type': 'str'},\n+ 'name': {'key': 'name', 'type': 'str'},\n+ 'type': {'key': 'type', 'type': 'str'},\n+ 'tags': {'key': 'tags', 'type': '{str}'},\n+ 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'},\n+ 'meter_id': {'key': 'properties.meterId', 'type': 'str'},\n+ 'meter_details': {'key': 'properties.meterDetails', 'type': 'MeterDetails'},\n+ 'unit_of_measure': {'key': 'properties.unitOfMeasure', 'type': 'str'},\n+ 'included_quantity': {'key': 'properties.includedQuantity', 'type': 'decimal'},\n+ 'part_number': {'key': 'properties.partNumber', 'type': 'str'},\n+ 'unit_price': {'key': 'properties.unitPrice', 'type': 'decimal'},\n+ 'currency_code': {'key': 'properties.currencyCode', 'type': 'str'},\n+ }\n+\n+ def __init__(self):\n+ super(PriceSheetModel, self).__init__()\n+ self.billing_period_id = None\n+ self.meter_id = None\n+ self.meter_details = None\n+ self.unit_of_measure = None\n+ self.included_quantity = None\n+ self.part_number = None\n+ self.unit_price = None\n+ self.currency_code = None"},{"sha":"f6a9a40d22d569970958af165de44c9f84162e47","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py","status":"added","additions":51,"deletions":0,"changes":51,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,51 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.serialization import Model\n+\n+\n+class ProxyResource(Model):\n+ \"\"\"The Resource model definition.\n+\n+ Variables are only populated by the server, and will be ignored when\n+ sending a request.\n+\n+ :ivar id: Resource Id.\n+ :vartype id: str\n+ :ivar name: Resource name.\n+ :vartype name: str\n+ :ivar type: Resource type.\n+ :vartype type: str\n+ :param e_tag: eTag of the resource. To handle concurrent update scenarion,\n+ this field will be used to determine whether the user is updating the\n+ latest version or not.\n+ :type e_tag: str\n+ \"\"\"\n+\n+ _validation = {\n+ 'id': {'readonly': True},\n+ 'name': {'readonly': True},\n+ 'type': {'readonly': True},\n+ }\n+\n+ _attribute_map = {\n+ 'id': {'key': 'id', 'type': 'str'},\n+ 'name': {'key': 'name', 'type': 'str'},\n+ 'type': {'key': 'type', 'type': 'str'},\n+ 'e_tag': {'key': 'eTag', 'type': 'str'},\n+ }\n+\n+ def __init__(self, e_tag=None):\n+ super(ProxyResource, self).__init__()\n+ self.id = None\n+ self.name = None\n+ self.type = None\n+ self.e_tag = e_tag"},{"sha":"cb1dff45a8f9ca787f34422829a20b142a1b9339","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py","status":"modified","additions":6,"deletions":0,"changes":6,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -10,13 +10,19 @@\n # --------------------------------------------------------------------------\n \n from .usage_details_operations import UsageDetailsOperations\n+from .marketplaces_operations import MarketplacesOperations\n from .reservations_summaries_operations import ReservationsSummariesOperations\n from .reservations_details_operations import ReservationsDetailsOperations\n+from .budgets_operations import BudgetsOperations\n from .operations import Operations\n+from .price_sheet_operations import PriceSheetOperations\n \n __all__ = [\n 'UsageDetailsOperations',\n+ 'MarketplacesOperations',\n 'ReservationsSummariesOperations',\n 'ReservationsDetailsOperations',\n+ 'BudgetsOperations',\n 'Operations',\n+ 'PriceSheetOperations',\n ]"},{"sha":"38562f5af055bad608bd52aee7804a97040fab44","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py","status":"added","additions":514,"deletions":0,"changes":514,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,514 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+import uuid\n+from msrest.pipeline import ClientRawResponse\n+\n+from .. import models\n+\n+\n+class BudgetsOperations(object):\n+ \"\"\"BudgetsOperations operations.\n+\n+ :param client: Client for service requests.\n+ :param config: Configuration of service client.\n+ :param serializer: An object model serializer.\n+ :param deserializer: An objec model deserializer.\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n+ \"\"\"\n+\n+ models = models\n+\n+ def __init__(self, client, config, serializer, deserializer):\n+\n+ self._client = client\n+ self._serialize = serializer\n+ self._deserialize = deserializer\n+ self.api_version = \"2018-01-31\"\n+\n+ self.config = config\n+\n+ def list(\n+ self, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Lists all budgets for a subscription.\n+\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: An iterator like instance of Budget\n+ :rtype:\n+ ~azure.mgmt.consumption.models.BudgetPaged[~azure.mgmt.consumption.models.Budget]\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ def internal_paging(next_link=None, raw=False):\n+\n+ if not next_link:\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ else:\n+ url = next_link\n+ query_parameters = {}\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(\n+ request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ return response\n+\n+ # Deserialize response\n+ deserialized = models.BudgetPaged(internal_paging, self._deserialize.dependencies)\n+\n+ if raw:\n+ header_dict = {}\n+ client_raw_response = models.BudgetPaged(internal_paging, self._deserialize.dependencies, header_dict)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def list_by_resource_group_name(\n+ self, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Lists all budgets for a resource group under a subscription.\n+\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: An iterator like instance of Budget\n+ :rtype:\n+ ~azure.mgmt.consumption.models.BudgetPaged[~azure.mgmt.consumption.models.Budget]\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ def internal_paging(next_link=None, raw=False):\n+\n+ if not next_link:\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'resourceGroupName': self._serialize.url(\"self.config.resource_group_name\", self.config.resource_group_name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ else:\n+ url = next_link\n+ query_parameters = {}\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(\n+ request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ return response\n+\n+ # Deserialize response\n+ deserialized = models.BudgetPaged(internal_paging, self._deserialize.dependencies)\n+\n+ if raw:\n+ header_dict = {}\n+ client_raw_response = models.BudgetPaged(internal_paging, self._deserialize.dependencies, header_dict)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def get(\n+ self, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Gets the budget for a subscription by budget name.\n+\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: Budget or ClientRawResponse if raw=true\n+ :rtype: ~azure.mgmt.consumption.models.Budget or\n+ ~msrest.pipeline.ClientRawResponse\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'budgetName': self._serialize.url(\"self.config.budget_name\", self.config.budget_name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ deserialized = None\n+\n+ if response.status_code == 200:\n+ deserialized = self._deserialize('Budget', response)\n+\n+ if raw:\n+ client_raw_response = ClientRawResponse(deserialized, response)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def create_or_update(\n+ self, parameters, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"The operation to create or update a budget. Update operation requires\n+ latest eTag to be set in the request mandatorily. You may obtain the\n+ latest eTag by performing a get operation. Create operation does not\n+ require eTag.\n+\n+ :param parameters: Parameters supplied to the Create Budget operation.\n+ :type parameters: ~azure.mgmt.consumption.models.Budget\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: An iterator like instance of None\n+ :rtype: ~azure.mgmt.consumption.models.Budget[None]\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ def internal_paging(next_link=None, raw=False):\n+\n+ if not next_link:\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'budgetName': self._serialize.url(\"self.config.budget_name\", self.config.budget_name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ else:\n+ url = next_link\n+ query_parameters = {}\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct body\n+ body_content = self._serialize.body(parameters, 'Budget')\n+\n+ # Construct and send request\n+ request = self._client.put(url, query_parameters)\n+ response = self._client.send(\n+ request, header_parameters, body_content, stream=False, **operation_config)\n+\n+ if response.status_code not in [200, 201]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ return response\n+\n+ # Deserialize response\n+ deserialized = models.Budget(internal_paging, self._deserialize.dependencies)\n+\n+ if raw:\n+ header_dict = {}\n+ client_raw_response = models.Budget(internal_paging, self._deserialize.dependencies, header_dict)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def delete(\n+ self, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"The operation to delete a budget.\n+\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: None or ClientRawResponse if raw=true\n+ :rtype: None or ~msrest.pipeline.ClientRawResponse\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'budgetName': self._serialize.url(\"self.config.budget_name\", self.config.budget_name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.delete(url, query_parameters)\n+ response = self._client.send(request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ if raw:\n+ client_raw_response = ClientRawResponse(None, response)\n+ return client_raw_response\n+\n+ def get_by_resource_group_name(\n+ self, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Gets the budget for a resource group under a subscription by budget\n+ name.\n+\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: Budget or ClientRawResponse if raw=true\n+ :rtype: ~azure.mgmt.consumption.models.Budget or\n+ ~msrest.pipeline.ClientRawResponse\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'resourceGroupName': self._serialize.url(\"self.config.resource_group_name\", self.config.resource_group_name, 'str'),\n+ 'budgetName': self._serialize.url(\"self.config.budget_name\", self.config.budget_name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ deserialized = None\n+\n+ if response.status_code == 200:\n+ deserialized = self._deserialize('Budget', response)\n+\n+ if raw:\n+ client_raw_response = ClientRawResponse(deserialized, response)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def create_or_update_by_resource_group_name(\n+ self, parameters, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"The operation to create or update a budget. Update operation requires\n+ latest eTag to be set in the request mandatorily. You may obtain the\n+ latest eTag by performing a get operation. Create operation does not\n+ require eTag.\n+\n+ :param parameters: Parameters supplied to the Create Budget operation.\n+ :type parameters: ~azure.mgmt.consumption.models.Budget\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: An iterator like instance of None\n+ :rtype: ~azure.mgmt.consumption.models.Budget[None]\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ def internal_paging(next_link=None, raw=False):\n+\n+ if not next_link:\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'resourceGroupName': self._serialize.url(\"self.config.resource_group_name\", self.config.resource_group_name, 'str'),\n+ 'budgetName': self._serialize.url(\"self.config.budget_name\", self.config.budget_name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ else:\n+ url = next_link\n+ query_parameters = {}\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct body\n+ body_content = self._serialize.body(parameters, 'Budget')\n+\n+ # Construct and send request\n+ request = self._client.put(url, query_parameters)\n+ response = self._client.send(\n+ request, header_parameters, body_content, stream=False, **operation_config)\n+\n+ if response.status_code not in [200, 201]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ return response\n+\n+ # Deserialize response\n+ deserialized = models.Budget(internal_paging, self._deserialize.dependencies)\n+\n+ if raw:\n+ header_dict = {}\n+ client_raw_response = models.Budget(internal_paging, self._deserialize.dependencies, header_dict)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def delete_by_resource_group_name(\n+ self, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"The operation to delete a budget.\n+\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: None or ClientRawResponse if raw=true\n+ :rtype: None or ~msrest.pipeline.ClientRawResponse\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'resourceGroupName': self._serialize.url(\"self.config.resource_group_name\", self.config.resource_group_name, 'str'),\n+ 'budgetName': self._serialize.url(\"self.config.budget_name\", self.config.budget_name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.delete(url, query_parameters)\n+ response = self._client.send(request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ if raw:\n+ client_raw_response = ClientRawResponse(None, response)\n+ return client_raw_response"},{"sha":"e74aa82ad6ec36fee8e4c10903efe7a5d5e9a584","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/marketplaces_operations.py","status":"added","additions":209,"deletions":0,"changes":209,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/marketplaces_operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/marketplaces_operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/marketplaces_operations.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,209 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+import uuid\n+from msrest.pipeline import ClientRawResponse\n+\n+from .. import models\n+\n+\n+class MarketplacesOperations(object):\n+ \"\"\"MarketplacesOperations operations.\n+\n+ :param client: Client for service requests.\n+ :param config: Configuration of service client.\n+ :param serializer: An object model serializer.\n+ :param deserializer: An objec model deserializer.\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n+ \"\"\"\n+\n+ models = models\n+\n+ def __init__(self, client, config, serializer, deserializer):\n+\n+ self._client = client\n+ self._serialize = serializer\n+ self._deserialize = deserializer\n+ self.api_version = \"2018-01-31\"\n+\n+ self.config = config\n+\n+ def list(\n+ self, filter=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Lists the marketplaces for a scope by subscriptionId. Marketplaces are\n+ available via this API only for May 1, 2014 or later.\n+\n+ :param filter: May be used to filter marketplaces by\n+ properties/usageEnd (Utc time), properties/usageStart (Utc time),\n+ properties/resourceGroup, properties/instanceName or\n+ properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le',\n+ 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.\n+ :type filter: str\n+ :param top: May be used to limit the number of results to the most\n+ recent N marketplaces.\n+ :type top: int\n+ :param skiptoken: Skiptoken is only used if a previous operation\n+ returned a partial result. If a previous response contains a nextLink\n+ element, the value of the nextLink element will include a skiptoken\n+ parameter that specifies a starting point to use for subsequent calls.\n+ :type skiptoken: str\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: An iterator like instance of Marketplace\n+ :rtype:\n+ ~azure.mgmt.consumption.models.MarketplacePaged[~azure.mgmt.consumption.models.Marketplace]\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ def internal_paging(next_link=None, raw=False):\n+\n+ if not next_link:\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/marketplaces'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ if filter is not None:\n+ query_parameters['$filter'] = self._serialize.query(\"filter\", filter, 'str')\n+ if top is not None:\n+ query_parameters['$top'] = self._serialize.query(\"top\", top, 'int', maximum=1000, minimum=1)\n+ if skiptoken is not None:\n+ query_parameters['$skiptoken'] = self._serialize.query(\"skiptoken\", skiptoken, 'str')\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ else:\n+ url = next_link\n+ query_parameters = {}\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(\n+ request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ return response\n+\n+ # Deserialize response\n+ deserialized = models.MarketplacePaged(internal_paging, self._deserialize.dependencies)\n+\n+ if raw:\n+ header_dict = {}\n+ client_raw_response = models.MarketplacePaged(internal_paging, self._deserialize.dependencies, header_dict)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def list_by_billing_period(\n+ self, billing_period_name, filter=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Lists the marketplaces for a scope by billing period and\n+ subscripotionId. Marketplaces are available via this API only for May\n+ 1, 2014 or later.\n+\n+ :param billing_period_name: Billing Period Name.\n+ :type billing_period_name: str\n+ :param filter: May be used to filter marketplaces by\n+ properties/usageEnd (Utc time), properties/usageStart (Utc time),\n+ properties/resourceGroup, properties/instanceName or\n+ properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le',\n+ 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.\n+ :type filter: str\n+ :param top: May be used to limit the number of results to the most\n+ recent N marketplaces.\n+ :type top: int\n+ :param skiptoken: Skiptoken is only used if a previous operation\n+ returned a partial result. If a previous response contains a nextLink\n+ element, the value of the nextLink element will include a skiptoken\n+ parameter that specifies a starting point to use for subsequent calls.\n+ :type skiptoken: str\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: An iterator like instance of Marketplace\n+ :rtype:\n+ ~azure.mgmt.consumption.models.MarketplacePaged[~azure.mgmt.consumption.models.Marketplace]\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ def internal_paging(next_link=None, raw=False):\n+\n+ if not next_link:\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'billingPeriodName': self._serialize.url(\"billing_period_name\", billing_period_name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ if filter is not None:\n+ query_parameters['$filter'] = self._serialize.query(\"filter\", filter, 'str')\n+ if top is not None:\n+ query_parameters['$top'] = self._serialize.query(\"top\", top, 'int', maximum=1000, minimum=1)\n+ if skiptoken is not None:\n+ query_parameters['$skiptoken'] = self._serialize.query(\"skiptoken\", skiptoken, 'str')\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ else:\n+ url = next_link\n+ query_parameters = {}\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(\n+ request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ return response\n+\n+ # Deserialize response\n+ deserialized = models.MarketplacePaged(internal_paging, self._deserialize.dependencies)\n+\n+ if raw:\n+ header_dict = {}\n+ client_raw_response = models.MarketplacePaged(internal_paging, self._deserialize.dependencies, header_dict)\n+ return client_raw_response\n+\n+ return deserialized"},{"sha":"f3efdae1c20868aef1cbad552979edb11f41663f","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py","status":"modified","additions":3,"deletions":3,"changes":6,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -22,7 +22,7 @@ class Operations(object):\n :param config: Configuration of service client.\n :param serializer: An object model serializer.\n :param deserializer: An objec model deserializer.\n- :ivar api_version: Version of the API to be used with the client request. The current version is 2017-11-30. Constant value: \"2017-11-30\".\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n \"\"\"\n \n models = models\n@@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer):\n self._client = client\n self._serialize = serializer\n self._deserialize = deserializer\n- self.api_version = \"2017-11-30\"\n+ self.api_version = \"2018-01-31\"\n \n self.config = config\n \n@@ -78,7 +78,7 @@ def internal_paging(next_link=None, raw=False):\n # Construct and send request\n request = self._client.get(url, query_parameters)\n response = self._client.send(\n- request, header_parameters, **operation_config)\n+ request, header_parameters, stream=False, **operation_config)\n \n if response.status_code not in [200]:\n raise models.ErrorResponseException(self._deserialize, response)"},{"sha":"701320c573d314526b127b4b3e5f8233852ad8b1","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py","status":"added","additions":176,"deletions":0,"changes":176,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -0,0 +1,176 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+import uuid\n+from msrest.pipeline import ClientRawResponse\n+\n+from .. import models\n+\n+\n+class PriceSheetOperations(object):\n+ \"\"\"PriceSheetOperations operations.\n+\n+ :param client: Client for service requests.\n+ :param config: Configuration of service client.\n+ :param serializer: An object model serializer.\n+ :param deserializer: An objec model deserializer.\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n+ \"\"\"\n+\n+ models = models\n+\n+ def __init__(self, client, config, serializer, deserializer):\n+\n+ self._client = client\n+ self._serialize = serializer\n+ self._deserialize = deserializer\n+ self.api_version = \"2018-01-31\"\n+\n+ self.config = config\n+\n+ def list(\n+ self, expand=None, skiptoken=None, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Lists the price sheet for a scope by subscriptionId. Price sheets are\n+ available via this API only for May 1, 2014 or later.\n+\n+ :param expand: May be used to expand the properties/meterDetails\n+ within a price sheet. By default, these fields are not included when\n+ returning price sheet.\n+ :type expand: str\n+ :param skiptoken: Skiptoken is only used if a previous operation\n+ returned a partial result. If a previous response contains a nextLink\n+ element, the value of the nextLink element will include a skiptoken\n+ parameter that specifies a starting point to use for subsequent calls.\n+ :type skiptoken: str\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: PriceSheetListResult or ClientRawResponse if raw=true\n+ :rtype: ~azure.mgmt.consumption.models.PriceSheetListResult or\n+ ~msrest.pipeline.ClientRawResponse\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ if expand is not None:\n+ query_parameters['$expand'] = self._serialize.query(\"expand\", expand, 'str')\n+ if skiptoken is not None:\n+ query_parameters['$skiptoken'] = self._serialize.query(\"skiptoken\", skiptoken, 'str')\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ deserialized = None\n+\n+ if response.status_code == 200:\n+ deserialized = self._deserialize('PriceSheetListResult', response)\n+\n+ if raw:\n+ client_raw_response = ClientRawResponse(deserialized, response)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def list_by_billing_period(\n+ self, billing_period_name, expand=None, skiptoken=None, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Lists the price sheet for a scope by subscriptionId and billing period.\n+ Price sheets are available via this API only for May 1, 2014 or later.\n+\n+ :param billing_period_name: Billing Period Name.\n+ :type billing_period_name: str\n+ :param expand: May be used to expand the properties/meterDetails\n+ within a price sheet. By default, these fields are not included when\n+ returning price sheet.\n+ :type expand: str\n+ :param skiptoken: Skiptoken is only used if a previous operation\n+ returned a partial result. If a previous response contains a nextLink\n+ element, the value of the nextLink element will include a skiptoken\n+ parameter that specifies a starting point to use for subsequent calls.\n+ :type skiptoken: str\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: PriceSheetListResult or ClientRawResponse if raw=true\n+ :rtype: ~azure.mgmt.consumption.models.PriceSheetListResult or\n+ ~msrest.pipeline.ClientRawResponse\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'billingPeriodName': self._serialize.url(\"billing_period_name\", billing_period_name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ if expand is not None:\n+ query_parameters['$expand'] = self._serialize.query(\"expand\", expand, 'str')\n+ if skiptoken is not None:\n+ query_parameters['$skiptoken'] = self._serialize.query(\"skiptoken\", skiptoken, 'str')\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ deserialized = None\n+\n+ if response.status_code == 200:\n+ deserialized = self._deserialize('PriceSheetListResult', response)\n+\n+ if raw:\n+ client_raw_response = ClientRawResponse(deserialized, response)\n+ return client_raw_response\n+\n+ return deserialized"},{"sha":"485bb51bf4eb5333baf96a44f51ae286faabb00c","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py","status":"modified","additions":82,"deletions":12,"changes":94,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -22,7 +22,7 @@ class ReservationsDetailsOperations(object):\n :param config: Configuration of service client.\n :param serializer: An object model serializer.\n :param deserializer: An objec model deserializer.\n- :ivar api_version: Version of the API to be used with the client request. The current version is 2017-11-30. Constant value: \"2017-11-30\".\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n \"\"\"\n \n models = models\n@@ -32,19 +32,16 @@ def __init__(self, client, config, serializer, deserializer):\n self._client = client\n self._serialize = serializer\n self._deserialize = deserializer\n- self.api_version = \"2017-11-30\"\n+ self.api_version = \"2018-01-31\"\n \n self.config = config\n \n- def list(\n- self, scope, filter, custom_headers=None, raw=False, **operation_config):\n+ def list_by_reservation_order(\n+ self, reservation_order_id, filter, custom_headers=None, raw=False, **operation_config):\n \"\"\"Lists the reservations details for provided date range.\n \n- :param scope: The scope of the reservation details. The scope can be\n- 'providers/Microsoft.Capacity/reservationorders/{ReservationOrderId}'\n- or\n- 'providers/Microsoft.Capacity/reservationorders/{ReservationOrderId}/reservations/{ReservationId}'\n- :type scope: str\n+ :param reservation_order_id: Order Id of the reservation\n+ :type reservation_order_id: str\n :param filter: Filter reservation details by date range. The\n properties/UsageDate for start date and end date. The filter supports\n 'le' and 'ge'\n@@ -64,9 +61,9 @@ def internal_paging(next_link=None, raw=False):\n \n if not next_link:\n # Construct URL\n- url = '/{scope}/providers/Microsoft.Consumption/reservationDetails'\n+ url = '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails'\n path_format_arguments = {\n- 'scope': self._serialize.url(\"scope\", scope, 'str', skip_quote=True)\n+ 'reservationOrderId': self._serialize.url(\"reservation_order_id\", reservation_order_id, 'str')\n }\n url = self._client.format_url(url, **path_format_arguments)\n \n@@ -92,7 +89,80 @@ def internal_paging(next_link=None, raw=False):\n # Construct and send request\n request = self._client.get(url, query_parameters)\n response = self._client.send(\n- request, header_parameters, **operation_config)\n+ request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ return response\n+\n+ # Deserialize response\n+ deserialized = models.ReservationDetailsPaged(internal_paging, self._deserialize.dependencies)\n+\n+ if raw:\n+ header_dict = {}\n+ client_raw_response = models.ReservationDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def list_by_reservation_order_and_reservation(\n+ self, reservation_order_id, reservation_id, filter, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Lists the reservations details for provided date range.\n+\n+ :param reservation_order_id: Order Id of the reservation\n+ :type reservation_order_id: str\n+ :param reservation_id: Id of the reservation\n+ :type reservation_id: str\n+ :param filter: Filter reservation details by date range. The\n+ properties/UsageDate for start date and end date. The filter supports\n+ 'le' and 'ge'\n+ :type filter: str\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: An iterator like instance of ReservationDetails\n+ :rtype:\n+ ~azure.mgmt.consumption.models.ReservationDetailsPaged[~azure.mgmt.consumption.models.ReservationDetails]\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ def internal_paging(next_link=None, raw=False):\n+\n+ if not next_link:\n+ # Construct URL\n+ url = '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails'\n+ path_format_arguments = {\n+ 'reservationOrderId': self._serialize.url(\"reservation_order_id\", reservation_order_id, 'str'),\n+ 'reservationId': self._serialize.url(\"reservation_id\", reservation_id, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['$filter'] = self._serialize.query(\"filter\", filter, 'str')\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ else:\n+ url = next_link\n+ query_parameters = {}\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(\n+ request, header_parameters, stream=False, **operation_config)\n \n if response.status_code not in [200]:\n raise models.ErrorResponseException(self._deserialize, response)"},{"sha":"2c1c2b451318b518d75a578a83e49e5597c6be6d","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py","status":"modified","additions":86,"deletions":12,"changes":98,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -22,7 +22,7 @@ class ReservationsSummariesOperations(object):\n :param config: Configuration of service client.\n :param serializer: An object model serializer.\n :param deserializer: An objec model deserializer.\n- :ivar api_version: Version of the API to be used with the client request. The current version is 2017-11-30. Constant value: \"2017-11-30\".\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n \"\"\"\n \n models = models\n@@ -32,19 +32,16 @@ def __init__(self, client, config, serializer, deserializer):\n self._client = client\n self._serialize = serializer\n self._deserialize = deserializer\n- self.api_version = \"2017-11-30\"\n+ self.api_version = \"2018-01-31\"\n \n self.config = config\n \n- def list(\n- self, scope, grain, filter=None, custom_headers=None, raw=False, **operation_config):\n+ def list_by_reservation_order(\n+ self, reservation_order_id, grain, filter=None, custom_headers=None, raw=False, **operation_config):\n \"\"\"Lists the reservations summaries for daily or monthly grain.\n \n- :param scope: The scope of the reservation summaries. The scope can be\n- 'providers/Microsoft.Capacity/reservationorders/{ReservationOrderId}'\n- or\n- 'providers/Microsoft.Capacity/reservationorders/{ReservationOrderId}/reservations/{ReservationId}'\n- :type scope: str\n+ :param reservation_order_id: Order Id of the reservation\n+ :type reservation_order_id: str\n :param grain: Can be daily or monthly. Possible values include:\n 'DailyGrain', 'MonthlyGrain'\n :type grain: str or ~azure.mgmt.consumption.models.Datagrain\n@@ -66,9 +63,9 @@ def internal_paging(next_link=None, raw=False):\n \n if not next_link:\n # Construct URL\n- url = '/{scope}/providers/Microsoft.Consumption/reservationSummaries'\n+ url = '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries'\n path_format_arguments = {\n- 'scope': self._serialize.url(\"scope\", scope, 'str', skip_quote=True)\n+ 'reservationOrderId': self._serialize.url(\"reservation_order_id\", reservation_order_id, 'str')\n }\n url = self._client.format_url(url, **path_format_arguments)\n \n@@ -96,7 +93,84 @@ def internal_paging(next_link=None, raw=False):\n # Construct and send request\n request = self._client.get(url, query_parameters)\n response = self._client.send(\n- request, header_parameters, **operation_config)\n+ request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ return response\n+\n+ # Deserialize response\n+ deserialized = models.ReservationSummariesPaged(internal_paging, self._deserialize.dependencies)\n+\n+ if raw:\n+ header_dict = {}\n+ client_raw_response = models.ReservationSummariesPaged(internal_paging, self._deserialize.dependencies, header_dict)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def list_by_reservation_order_and_reservation(\n+ self, reservation_order_id, reservation_id, grain, filter=None, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Lists the reservations summaries for daily or monthly grain.\n+\n+ :param reservation_order_id: Order Id of the reservation\n+ :type reservation_order_id: str\n+ :param reservation_id: Id of the reservation\n+ :type reservation_id: str\n+ :param grain: Can be daily or monthly. Possible values include:\n+ 'DailyGrain', 'MonthlyGrain'\n+ :type grain: str or ~azure.mgmt.consumption.models.Datagrain\n+ :param filter: Required only for daily grain. The properties/UsageDate\n+ for start date and end date. The filter supports 'le' and 'ge'\n+ :type filter: str\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: An iterator like instance of ReservationSummaries\n+ :rtype:\n+ ~azure.mgmt.consumption.models.ReservationSummariesPaged[~azure.mgmt.consumption.models.ReservationSummaries]\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ def internal_paging(next_link=None, raw=False):\n+\n+ if not next_link:\n+ # Construct URL\n+ url = '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries'\n+ path_format_arguments = {\n+ 'reservationOrderId': self._serialize.url(\"reservation_order_id\", reservation_order_id, 'str'),\n+ 'reservationId': self._serialize.url(\"reservation_id\", reservation_id, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['grain'] = self._serialize.query(\"grain\", grain, 'str')\n+ if filter is not None:\n+ query_parameters['$filter'] = self._serialize.query(\"filter\", filter, 'str')\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ else:\n+ url = next_link\n+ query_parameters = {}\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(\n+ request, header_parameters, stream=False, **operation_config)\n \n if response.status_code not in [200]:\n raise models.ErrorResponseException(self._deserialize, response)"},{"sha":"a0f6cd91bd084879c4ac7e89959d2231a4b5795e","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py","status":"modified","additions":100,"deletions":11,"changes":111,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -22,7 +22,7 @@ class UsageDetailsOperations(object):\n :param config: Configuration of service client.\n :param serializer: An object model serializer.\n :param deserializer: An objec model deserializer.\n- :ivar api_version: Version of the API to be used with the client request. The current version is 2017-11-30. Constant value: \"2017-11-30\".\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n \"\"\"\n \n models = models\n@@ -32,20 +32,15 @@ def __init__(self, client, config, serializer, deserializer):\n self._client = client\n self._serialize = serializer\n self._deserialize = deserializer\n- self.api_version = \"2017-11-30\"\n+ self.api_version = \"2018-01-31\"\n \n self.config = config\n \n def list(\n- self, scope, expand=None, filter=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config):\n+ self, expand=None, filter=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config):\n \"\"\"Lists the usage details for a scope by billing period. Usage details\n are available via this API only for May 1, 2014 or later.\n \n- :param scope: The scope of the usage details. The scope can be\n- '/subscriptions/{subscriptionId}' for a subscription, or\n- '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'\n- for a billing perdiod.\n- :type scope: str\n :param expand: May be used to expand the\n properties/additionalProperties or properties/meterDetails within a\n list of usage details. By default, these fields are not included when\n@@ -80,9 +75,9 @@ def internal_paging(next_link=None, raw=False):\n \n if not next_link:\n # Construct URL\n- url = '/{scope}/providers/Microsoft.Consumption/usageDetails'\n+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/usageDetails'\n path_format_arguments = {\n- 'scope': self._serialize.url(\"scope\", scope, 'str', skip_quote=True)\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str')\n }\n url = self._client.format_url(url, **path_format_arguments)\n \n@@ -115,7 +110,101 @@ def internal_paging(next_link=None, raw=False):\n # Construct and send request\n request = self._client.get(url, query_parameters)\n response = self._client.send(\n- request, header_parameters, **operation_config)\n+ request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ return response\n+\n+ # Deserialize response\n+ deserialized = models.UsageDetailPaged(internal_paging, self._deserialize.dependencies)\n+\n+ if raw:\n+ header_dict = {}\n+ client_raw_response = models.UsageDetailPaged(internal_paging, self._deserialize.dependencies, header_dict)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def list_by_billing_period(\n+ self, billing_period_name, expand=None, filter=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Lists the usage details for a scope by billing period. Usage details\n+ are available via this API only for May 1, 2014 or later.\n+\n+ :param billing_period_name: Billing Period Name.\n+ :type billing_period_name: str\n+ :param expand: May be used to expand the\n+ properties/additionalProperties or properties/meterDetails within a\n+ list of usage details. By default, these fields are not included when\n+ listing usage details.\n+ :type expand: str\n+ :param filter: May be used to filter usageDetails by\n+ properties/usageEnd (Utc time), properties/usageStart (Utc time),\n+ properties/resourceGroup, properties/instanceName or\n+ properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le',\n+ 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.\n+ :type filter: str\n+ :param skiptoken: Skiptoken is only used if a previous operation\n+ returned a partial result. If a previous response contains a nextLink\n+ element, the value of the nextLink element will include a skiptoken\n+ parameter that specifies a starting point to use for subsequent calls.\n+ :type skiptoken: str\n+ :param top: May be used to limit the number of results to the most\n+ recent N usageDetails.\n+ :type top: int\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: An iterator like instance of UsageDetail\n+ :rtype:\n+ ~azure.mgmt.consumption.models.UsageDetailPaged[~azure.mgmt.consumption.models.UsageDetail]\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ def internal_paging(next_link=None, raw=False):\n+\n+ if not next_link:\n+ # Construct URL\n+ url = '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails'\n+ path_format_arguments = {\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'billingPeriodName': self._serialize.url(\"billing_period_name\", billing_period_name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ if expand is not None:\n+ query_parameters['$expand'] = self._serialize.query(\"expand\", expand, 'str')\n+ if filter is not None:\n+ query_parameters['$filter'] = self._serialize.query(\"filter\", filter, 'str')\n+ if skiptoken is not None:\n+ query_parameters['$skiptoken'] = self._serialize.query(\"skiptoken\", skiptoken, 'str')\n+ if top is not None:\n+ query_parameters['$top'] = self._serialize.query(\"top\", top, 'int', maximum=1000, minimum=1)\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ else:\n+ url = next_link\n+ query_parameters = {}\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(\n+ request, header_parameters, stream=False, **operation_config)\n \n if response.status_code not in [200]:\n raise models.ErrorResponseException(self._deserialize, response)"},{"sha":"9c644827672b274106be6000914f998e7e703574","filename":"azure-mgmt-consumption/azure/mgmt/consumption/version.py","status":"modified","additions":1,"deletions":1,"changes":2,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/version.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/3d6c419cd2ade53c240c40db96dbe34957351244/azure-mgmt-consumption/azure/mgmt/consumption/version.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/version.py?ref=3d6c419cd2ade53c240c40db96dbe34957351244","patch":"@@ -9,5 +9,5 @@\n # regenerated.\n # --------------------------------------------------------------------------\n \n-VERSION = \"1.1.0\"\n+VERSION = \"1.2.0\"\n "}] + +https +GET +api.github.com +None +/repos/Azure/azure-sdk-for-python/commits/042b7a5840ff471776bb64e46b50950ee9f84430 +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:38 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4773'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"dc862e28bdff24590d33c5d927a64947"'), ('Last-Modified', 'Thu, 25 Jan 2018 19:40:02 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.277675'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1714:97BA:C92467:104F1B5:5AFDF3CA')] +{"sha":"042b7a5840ff471776bb64e46b50950ee9f84430","commit":{"author":{"name":"Azure SDK for Python bot","email":"aspysdk2@microsoft.com","date":"2018-01-25T19:40:02Z"},"committer":{"name":"Azure SDK for Python bot","email":"aspysdk2@microsoft.com","date":"2018-01-25T19:40:02Z"},"message":"Generated from a59b564eca116f99d057c9758d0dd40393ce75b7\n\nIntroduce Pricesheet Arm API","tree":{"sha":"a6d63b3754e7f65c6a4fbed3d3e9c5a2d72ce778","url":"https://api.github.com/repos/Azure/azure-sdk-for-python/git/trees/a6d63b3754e7f65c6a4fbed3d3e9c5a2d72ce778"},"url":"https://api.github.com/repos/Azure/azure-sdk-for-python/git/commits/042b7a5840ff471776bb64e46b50950ee9f84430","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null}},"url":"https://api.github.com/repos/Azure/azure-sdk-for-python/commits/042b7a5840ff471776bb64e46b50950ee9f84430","html_url":"https://github.com/Azure/azure-sdk-for-python/commit/042b7a5840ff471776bb64e46b50950ee9f84430","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/commits/042b7a5840ff471776bb64e46b50950ee9f84430/comments","author":{"login":"AutorestCI","id":18218145,"avatar_url":"https://avatars3.githubusercontent.com/u/18218145?v=4","gravatar_id":"","url":"https://api.github.com/users/AutorestCI","html_url":"https://github.com/AutorestCI","followers_url":"https://api.github.com/users/AutorestCI/followers","following_url":"https://api.github.com/users/AutorestCI/following{/other_user}","gists_url":"https://api.github.com/users/AutorestCI/gists{/gist_id}","starred_url":"https://api.github.com/users/AutorestCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AutorestCI/subscriptions","organizations_url":"https://api.github.com/users/AutorestCI/orgs","repos_url":"https://api.github.com/users/AutorestCI/repos","events_url":"https://api.github.com/users/AutorestCI/events{/privacy}","received_events_url":"https://api.github.com/users/AutorestCI/received_events","type":"User","site_admin":false},"committer":{"login":"AutorestCI","id":18218145,"avatar_url":"https://avatars3.githubusercontent.com/u/18218145?v=4","gravatar_id":"","url":"https://api.github.com/users/AutorestCI","html_url":"https://github.com/AutorestCI","followers_url":"https://api.github.com/users/AutorestCI/followers","following_url":"https://api.github.com/users/AutorestCI/following{/other_user}","gists_url":"https://api.github.com/users/AutorestCI/gists{/gist_id}","starred_url":"https://api.github.com/users/AutorestCI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AutorestCI/subscriptions","organizations_url":"https://api.github.com/users/AutorestCI/orgs","repos_url":"https://api.github.com/users/AutorestCI/repos","events_url":"https://api.github.com/users/AutorestCI/events{/privacy}","received_events_url":"https://api.github.com/users/AutorestCI/received_events","type":"User","site_admin":false},"parents":[{"sha":"f4715da4f929733b2b95c03142512f85ae8728a5","url":"https://api.github.com/repos/Azure/azure-sdk-for-python/commits/f4715da4f929733b2b95c03142512f85ae8728a5","html_url":"https://github.com/Azure/azure-sdk-for-python/commit/f4715da4f929733b2b95c03142512f85ae8728a5"}],"stats":{"total":985,"additions":967,"deletions":18},"files":[{"sha":"55432c5a7edf83b2ce128aa764edf18e8bfb3149","filename":"azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py","status":"modified","additions":21,"deletions":4,"changes":25,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -16,7 +16,9 @@\n from .operations.usage_details_operations import UsageDetailsOperations\n from .operations.reservations_summaries_operations import ReservationsSummariesOperations\n from .operations.reservations_details_operations import ReservationsDetailsOperations\n+from .operations.budgets_operations import BudgetsOperations\n from .operations.operations import Operations\n+from .operations.price_sheet_operations import PriceSheetOperations\n from . import models\n \n \n@@ -30,16 +32,20 @@ class ConsumptionManagementClientConfiguration(AzureConfiguration):\n object`\n :param subscription_id: Azure Subscription ID.\n :type subscription_id: str\n+ :param name: Budget name.\n+ :type name: str\n :param str base_url: Service URL\n \"\"\"\n \n def __init__(\n- self, credentials, subscription_id, base_url=None):\n+ self, credentials, subscription_id, name, base_url=None):\n \n if credentials is None:\n raise ValueError(\"Parameter 'credentials' must not be None.\")\n if subscription_id is None:\n raise ValueError(\"Parameter 'subscription_id' must not be None.\")\n+ if name is None:\n+ raise ValueError(\"Parameter 'name' must not be None.\")\n if not base_url:\n base_url = 'https://management.azure.com'\n \n@@ -50,6 +56,7 @@ def __init__(\n \n self.credentials = credentials\n self.subscription_id = subscription_id\n+ self.name = name\n \n \n class ConsumptionManagementClient(object):\n@@ -64,25 +71,31 @@ class ConsumptionManagementClient(object):\n :vartype reservations_summaries: azure.mgmt.consumption.operations.ReservationsSummariesOperations\n :ivar reservations_details: ReservationsDetails operations\n :vartype reservations_details: azure.mgmt.consumption.operations.ReservationsDetailsOperations\n+ :ivar budgets: Budgets operations\n+ :vartype budgets: azure.mgmt.consumption.operations.BudgetsOperations\n :ivar operations: Operations operations\n :vartype operations: azure.mgmt.consumption.operations.Operations\n+ :ivar price_sheet: PriceSheet operations\n+ :vartype price_sheet: azure.mgmt.consumption.operations.PriceSheetOperations\n \n :param credentials: Credentials needed for the client to connect to Azure.\n :type credentials: :mod:`A msrestazure Credentials\n object`\n :param subscription_id: Azure Subscription ID.\n :type subscription_id: str\n+ :param name: Budget name.\n+ :type name: str\n :param str base_url: Service URL\n \"\"\"\n \n def __init__(\n- self, credentials, subscription_id, base_url=None):\n+ self, credentials, subscription_id, name, base_url=None):\n \n- self.config = ConsumptionManagementClientConfiguration(credentials, subscription_id, base_url)\n+ self.config = ConsumptionManagementClientConfiguration(credentials, subscription_id, name, base_url)\n self._client = ServiceClient(self.config.credentials, self.config)\n \n client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}\n- self.api_version = '2017-11-30'\n+ self.api_version = '2018-01-31'\n self._serialize = Serializer(client_models)\n self._deserialize = Deserializer(client_models)\n \n@@ -92,5 +105,9 @@ def __init__(\n self._client, self.config, self._serialize, self._deserialize)\n self.reservations_details = ReservationsDetailsOperations(\n self._client, self.config, self._serialize, self._deserialize)\n+ self.budgets = BudgetsOperations(\n+ self._client, self.config, self._serialize, self._deserialize)\n self.operations = Operations(\n self._client, self.config, self._serialize, self._deserialize)\n+ self.price_sheet = PriceSheetOperations(\n+ self._client, self.config, self._serialize, self._deserialize)"},{"sha":"2565b46a9d2b4dc2df7fa591699f866b2f496d1b","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py","status":"modified","additions":24,"deletions":0,"changes":24,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -13,16 +13,28 @@\n from .usage_detail import UsageDetail\n from .reservation_summaries import ReservationSummaries\n from .reservation_details import ReservationDetails\n+from .budget_time_period import BudgetTimePeriod\n+from .filters import Filters\n+from .current_spend import CurrentSpend\n+from .notification import Notification\n+from .budget import Budget\n from .error_details import ErrorDetails\n from .error_response import ErrorResponse, ErrorResponseException\n from .operation_display import OperationDisplay\n from .operation import Operation\n from .resource import Resource\n+from .proxy_resource import ProxyResource\n+from .price_sheet import PriceSheet\n from .usage_detail_paged import UsageDetailPaged\n from .reservation_summaries_paged import ReservationSummariesPaged\n from .reservation_details_paged import ReservationDetailsPaged\n+from .budget_paged import BudgetPaged\n from .operation_paged import OperationPaged\n+from .price_sheet_paged import PriceSheetPaged\n from .consumption_management_client_enums import (\n+ CategoryType,\n+ TimeGrainType,\n+ OperatorType,\n Datagrain,\n )\n \n@@ -31,14 +43,26 @@\n 'UsageDetail',\n 'ReservationSummaries',\n 'ReservationDetails',\n+ 'BudgetTimePeriod',\n+ 'Filters',\n+ 'CurrentSpend',\n+ 'Notification',\n+ 'Budget',\n 'ErrorDetails',\n 'ErrorResponse', 'ErrorResponseException',\n 'OperationDisplay',\n 'Operation',\n 'Resource',\n+ 'ProxyResource',\n+ 'PriceSheet',\n 'UsageDetailPaged',\n 'ReservationSummariesPaged',\n 'ReservationDetailsPaged',\n+ 'BudgetPaged',\n 'OperationPaged',\n+ 'PriceSheetPaged',\n+ 'CategoryType',\n+ 'TimeGrainType',\n+ 'OperatorType',\n 'Datagrain',\n ]"},{"sha":"f6485d49266ddf2734c02ab55dceb9aba94bfe0a","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py","status":"added","additions":91,"deletions":0,"changes":91,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -0,0 +1,91 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from .proxy_resource import ProxyResource\n+\n+\n+class Budget(ProxyResource):\n+ \"\"\"A budget resource.\n+\n+ Variables are only populated by the server, and will be ignored when\n+ sending a request.\n+\n+ :ivar id: Resource Id.\n+ :vartype id: str\n+ :ivar name: Resource name.\n+ :vartype name: str\n+ :ivar type: Resource type.\n+ :vartype type: str\n+ :param e_tag: eTag of the resource. To handle concurrent update scenarion,\n+ this field will be used to determine whether the user is updating the\n+ latest version or not.\n+ :type e_tag: str\n+ :param category: The category of the budget, whether the budget tracks\n+ cost or usage. Possible values include: 'Cost', 'Usage'\n+ :type category: str or ~azure.mgmt.consumption.models.CategoryType\n+ :param amount: The total amount of cost to track with the budget\n+ :type amount: decimal.Decimal\n+ :param time_grain: The time covered by a budget. Tracking of the amount\n+ will be reset based on the time grain. Possible values include: 'Monthly',\n+ 'Quarterly', 'Annually'\n+ :type time_grain: str or ~azure.mgmt.consumption.models.TimeGrainType\n+ :param time_period: Has start and end date of the budget. The start date\n+ must be first of the month and should be less than the end date. Budget\n+ start date must be on or after June 1, 2017. Future start date should not\n+ be more than three months. Past start date should be selected within the\n+ timegrain preiod. There are no restrictions on the end date.\n+ :type time_period: ~azure.mgmt.consumption.models.BudgetTimePeriod\n+ :param filters: May be used to filter budgets by resource group, resource,\n+ or meter.\n+ :type filters: ~azure.mgmt.consumption.models.Filters\n+ :ivar current_spend: The current amount of cost which is being tracked for\n+ a budget.\n+ :vartype current_spend: ~azure.mgmt.consumption.models.CurrentSpend\n+ :param notifications: Dictionary of notifications associated with the\n+ budget. Budget can have up to five notifications.\n+ :type notifications: dict[str,\n+ ~azure.mgmt.consumption.models.Notification]\n+ \"\"\"\n+\n+ _validation = {\n+ 'id': {'readonly': True},\n+ 'name': {'readonly': True},\n+ 'type': {'readonly': True},\n+ 'category': {'required': True},\n+ 'amount': {'required': True},\n+ 'time_grain': {'required': True},\n+ 'time_period': {'required': True},\n+ 'current_spend': {'readonly': True},\n+ }\n+\n+ _attribute_map = {\n+ 'id': {'key': 'id', 'type': 'str'},\n+ 'name': {'key': 'name', 'type': 'str'},\n+ 'type': {'key': 'type', 'type': 'str'},\n+ 'e_tag': {'key': 'eTag', 'type': 'str'},\n+ 'category': {'key': 'properties.category', 'type': 'str'},\n+ 'amount': {'key': 'properties.amount', 'type': 'decimal'},\n+ 'time_grain': {'key': 'properties.timeGrain', 'type': 'str'},\n+ 'time_period': {'key': 'properties.timePeriod', 'type': 'BudgetTimePeriod'},\n+ 'filters': {'key': 'properties.filters', 'type': 'Filters'},\n+ 'current_spend': {'key': 'properties.currentSpend', 'type': 'CurrentSpend'},\n+ 'notifications': {'key': 'properties.notifications', 'type': '{Notification}'},\n+ }\n+\n+ def __init__(self, category, amount, time_grain, time_period, e_tag=None, filters=None, notifications=None):\n+ super(Budget, self).__init__(e_tag=e_tag)\n+ self.category = category\n+ self.amount = amount\n+ self.time_grain = time_grain\n+ self.time_period = time_period\n+ self.filters = filters\n+ self.current_spend = None\n+ self.notifications = notifications"},{"sha":"2668382253e2d7aaefb8665a466d2482193e0246","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py","status":"added","additions":27,"deletions":0,"changes":27,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -0,0 +1,27 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.paging import Paged\n+\n+\n+class BudgetPaged(Paged):\n+ \"\"\"\n+ A paging container for iterating over a list of :class:`Budget ` object\n+ \"\"\"\n+\n+ _attribute_map = {\n+ 'next_link': {'key': 'nextLink', 'type': 'str'},\n+ 'current_page': {'key': 'value', 'type': '[Budget]'}\n+ }\n+\n+ def __init__(self, *args, **kwargs):\n+\n+ super(BudgetPaged, self).__init__(*args, **kwargs)"},{"sha":"2b1c0e78418a1deb6b6147fc90ea53f1a03256d0","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py","status":"added","additions":37,"deletions":0,"changes":37,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -0,0 +1,37 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.serialization import Model\n+\n+\n+class BudgetTimePeriod(Model):\n+ \"\"\"The start and end date for a budget.\n+\n+ :param start_date: The start date for the budget.\n+ :type start_date: datetime\n+ :param end_date: The end date for the budget. If not provided, we default\n+ this to 10 years from the start date.\n+ :type end_date: datetime\n+ \"\"\"\n+\n+ _validation = {\n+ 'start_date': {'required': True},\n+ }\n+\n+ _attribute_map = {\n+ 'start_date': {'key': 'startDate', 'type': 'iso-8601'},\n+ 'end_date': {'key': 'endDate', 'type': 'iso-8601'},\n+ }\n+\n+ def __init__(self, start_date, end_date=None):\n+ super(BudgetTimePeriod, self).__init__()\n+ self.start_date = start_date\n+ self.end_date = end_date"},{"sha":"bb0db82f76b32c1d02cca1de69b0ecc49b3b548b","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py","status":"modified","additions":20,"deletions":0,"changes":20,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -12,6 +12,26 @@\n from enum import Enum\n \n \n+class CategoryType(Enum):\n+\n+ cost = \"Cost\"\n+ usage = \"Usage\"\n+\n+\n+class TimeGrainType(Enum):\n+\n+ monthly = \"Monthly\"\n+ quarterly = \"Quarterly\"\n+ annually = \"Annually\"\n+\n+\n+class OperatorType(Enum):\n+\n+ equal_to = \"EqualTo\"\n+ greater_than = \"GreaterThan\"\n+ greater_than_or_equal_to = \"GreaterThanOrEqualTo\"\n+\n+\n class Datagrain(Enum):\n \n daily_grain = \"daily\""},{"sha":"839c286b104079f531a4b130f3e01082d63d08ac","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py","status":"added","additions":41,"deletions":0,"changes":41,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -0,0 +1,41 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.serialization import Model\n+\n+\n+class CurrentSpend(Model):\n+ \"\"\"The current amount of cost which is being tracked for a budget.\n+\n+ Variables are only populated by the server, and will be ignored when\n+ sending a request.\n+\n+ :ivar amount: The total amount of cost which is being tracked by the\n+ budget.\n+ :vartype amount: decimal.Decimal\n+ :ivar unit: The unit of measure for the budget amount.\n+ :vartype unit: str\n+ \"\"\"\n+\n+ _validation = {\n+ 'amount': {'readonly': True},\n+ 'unit': {'readonly': True},\n+ }\n+\n+ _attribute_map = {\n+ 'amount': {'key': 'amount', 'type': 'decimal'},\n+ 'unit': {'key': 'unit', 'type': 'str'},\n+ }\n+\n+ def __init__(self):\n+ super(CurrentSpend, self).__init__()\n+ self.amount = None\n+ self.unit = None"},{"sha":"dc010a065900621f02b77dfe1b389071e597fd73","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py","status":"added","additions":44,"deletions":0,"changes":44,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -0,0 +1,44 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.serialization import Model\n+\n+\n+class Filters(Model):\n+ \"\"\"May be used to filter budgets by resource group, resource, or meter.\n+\n+ :param resource_groups: The list of filters on resource groups, allowed at\n+ subscription level only.\n+ :type resource_groups: list[str]\n+ :param resources: The list of filters on resources.\n+ :type resources: list[str]\n+ :param meters: The list of filters on meters, mandatory for budgets of\n+ usage category.\n+ :type meters: list[str]\n+ \"\"\"\n+\n+ _validation = {\n+ 'resource_groups': {'max_items': 10, 'min_items': 0},\n+ 'resources': {'max_items': 10, 'min_items': 0},\n+ 'meters': {'max_items': 10, 'min_items': 0},\n+ }\n+\n+ _attribute_map = {\n+ 'resource_groups': {'key': 'resourceGroups', 'type': '[str]'},\n+ 'resources': {'key': 'resources', 'type': '[str]'},\n+ 'meters': {'key': 'meters', 'type': '[str]'},\n+ }\n+\n+ def __init__(self, resource_groups=None, resources=None, meters=None):\n+ super(Filters, self).__init__()\n+ self.resource_groups = resource_groups\n+ self.resources = resources\n+ self.meters = meters"},{"sha":"61e1ca0ed34df63b0df71d2970b19f7fa8a866bd","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py","status":"added","additions":62,"deletions":0,"changes":62,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -0,0 +1,62 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.serialization import Model\n+\n+\n+class Notification(Model):\n+ \"\"\"The notification associated with a budget.\n+\n+ :param enabled: The notification is enabled or not.\n+ :type enabled: bool\n+ :param operator: The comparison operator. Possible values include:\n+ 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo'\n+ :type operator: str or ~azure.mgmt.consumption.models.OperatorType\n+ :param threshold: Threshold value associated with a notification.\n+ Notification is sent when the cost exceeded the threshold. It is always\n+ percent and has to be between 0 and 1000.\n+ :type threshold: decimal.Decimal\n+ :param contact_emails: Email addresses to send the budget notification to\n+ when the threshold is exceeded.\n+ :type contact_emails: list[str]\n+ :param contact_roles: Contact roles to send the budget notification to\n+ when the threshold is exceeded.\n+ :type contact_roles: list[str]\n+ :param contact_groups: Action groups to send the budget notification to\n+ when the threshold is exceeded.\n+ :type contact_groups: list[str]\n+ \"\"\"\n+\n+ _validation = {\n+ 'enabled': {'required': True},\n+ 'operator': {'required': True},\n+ 'threshold': {'required': True},\n+ 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 1},\n+ 'contact_groups': {'max_items': 50, 'min_items': 0},\n+ }\n+\n+ _attribute_map = {\n+ 'enabled': {'key': 'enabled', 'type': 'bool'},\n+ 'operator': {'key': 'operator', 'type': 'str'},\n+ 'threshold': {'key': 'threshold', 'type': 'decimal'},\n+ 'contact_emails': {'key': 'contactEmails', 'type': '[str]'},\n+ 'contact_roles': {'key': 'contactRoles', 'type': '[str]'},\n+ 'contact_groups': {'key': 'contactGroups', 'type': '[str]'},\n+ }\n+\n+ def __init__(self, enabled, operator, threshold, contact_emails, contact_roles=None, contact_groups=None):\n+ super(Notification, self).__init__()\n+ self.enabled = enabled\n+ self.operator = operator\n+ self.threshold = threshold\n+ self.contact_emails = contact_emails\n+ self.contact_roles = contact_roles\n+ self.contact_groups = contact_groups"},{"sha":"bc5f89b78fbeb0a81a93d089f3a640f8e63ff3a2","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet.py","status":"added","additions":88,"deletions":0,"changes":88,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -0,0 +1,88 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from .resource import Resource\n+\n+\n+class PriceSheet(Resource):\n+ \"\"\"An pricesheet resource.\n+\n+ Variables are only populated by the server, and will be ignored when\n+ sending a request.\n+\n+ :ivar id: Resource Id.\n+ :vartype id: str\n+ :ivar name: Resource name.\n+ :vartype name: str\n+ :ivar type: Resource type.\n+ :vartype type: str\n+ :ivar tags: Resource tags.\n+ :vartype tags: dict[str, str]\n+ :ivar billing_period_id: The id of the billing period resource that the\n+ usage belongs to.\n+ :vartype billing_period_id: str\n+ :ivar meter_id: The meter id\n+ :vartype meter_id: str\n+ :ivar meter_details: The details about the meter. By default this is not\n+ populated, unless it's specified in $expand.\n+ :vartype meter_details: ~azure.mgmt.consumption.models.MeterDetails\n+ :ivar unit_of_measure: Unit of measure\n+ :vartype unit_of_measure: str\n+ :ivar included_quantity: Included quality for an offer\n+ :vartype included_quantity: decimal.Decimal\n+ :ivar part_number: Part Number\n+ :vartype part_number: str\n+ :ivar unit_price: Unit Price\n+ :vartype unit_price: decimal.Decimal\n+ :ivar currency_code: Currency Code\n+ :vartype currency_code: str\n+ \"\"\"\n+\n+ _validation = {\n+ 'id': {'readonly': True},\n+ 'name': {'readonly': True},\n+ 'type': {'readonly': True},\n+ 'tags': {'readonly': True},\n+ 'billing_period_id': {'readonly': True},\n+ 'meter_id': {'readonly': True},\n+ 'meter_details': {'readonly': True},\n+ 'unit_of_measure': {'readonly': True},\n+ 'included_quantity': {'readonly': True},\n+ 'part_number': {'readonly': True},\n+ 'unit_price': {'readonly': True},\n+ 'currency_code': {'readonly': True},\n+ }\n+\n+ _attribute_map = {\n+ 'id': {'key': 'id', 'type': 'str'},\n+ 'name': {'key': 'name', 'type': 'str'},\n+ 'type': {'key': 'type', 'type': 'str'},\n+ 'tags': {'key': 'tags', 'type': '{str}'},\n+ 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'},\n+ 'meter_id': {'key': 'properties.meterId', 'type': 'str'},\n+ 'meter_details': {'key': 'properties.meterDetails', 'type': 'MeterDetails'},\n+ 'unit_of_measure': {'key': 'properties.unitOfMeasure', 'type': 'str'},\n+ 'included_quantity': {'key': 'properties.includedQuantity', 'type': 'decimal'},\n+ 'part_number': {'key': 'properties.partNumber', 'type': 'str'},\n+ 'unit_price': {'key': 'properties.unitPrice', 'type': 'decimal'},\n+ 'currency_code': {'key': 'properties.currencyCode', 'type': 'str'},\n+ }\n+\n+ def __init__(self):\n+ super(PriceSheet, self).__init__()\n+ self.billing_period_id = None\n+ self.meter_id = None\n+ self.meter_details = None\n+ self.unit_of_measure = None\n+ self.included_quantity = None\n+ self.part_number = None\n+ self.unit_price = None\n+ self.currency_code = None"},{"sha":"5dfe48207a52fc6efd11d8a2108a89bbed439301","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_paged.py","status":"added","additions":27,"deletions":0,"changes":27,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_paged.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_paged.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_paged.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -0,0 +1,27 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.paging import Paged\n+\n+\n+class PriceSheetPaged(Paged):\n+ \"\"\"\n+ A paging container for iterating over a list of :class:`PriceSheet ` object\n+ \"\"\"\n+\n+ _attribute_map = {\n+ 'next_link': {'key': 'nextLink', 'type': 'str'},\n+ 'current_page': {'key': 'value', 'type': '[PriceSheet]'}\n+ }\n+\n+ def __init__(self, *args, **kwargs):\n+\n+ super(PriceSheetPaged, self).__init__(*args, **kwargs)"},{"sha":"f6a9a40d22d569970958af165de44c9f84162e47","filename":"azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py","status":"added","additions":51,"deletions":0,"changes":51,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -0,0 +1,51 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+from msrest.serialization import Model\n+\n+\n+class ProxyResource(Model):\n+ \"\"\"The Resource model definition.\n+\n+ Variables are only populated by the server, and will be ignored when\n+ sending a request.\n+\n+ :ivar id: Resource Id.\n+ :vartype id: str\n+ :ivar name: Resource name.\n+ :vartype name: str\n+ :ivar type: Resource type.\n+ :vartype type: str\n+ :param e_tag: eTag of the resource. To handle concurrent update scenarion,\n+ this field will be used to determine whether the user is updating the\n+ latest version or not.\n+ :type e_tag: str\n+ \"\"\"\n+\n+ _validation = {\n+ 'id': {'readonly': True},\n+ 'name': {'readonly': True},\n+ 'type': {'readonly': True},\n+ }\n+\n+ _attribute_map = {\n+ 'id': {'key': 'id', 'type': 'str'},\n+ 'name': {'key': 'name', 'type': 'str'},\n+ 'type': {'key': 'type', 'type': 'str'},\n+ 'e_tag': {'key': 'eTag', 'type': 'str'},\n+ }\n+\n+ def __init__(self, e_tag=None):\n+ super(ProxyResource, self).__init__()\n+ self.id = None\n+ self.name = None\n+ self.type = None\n+ self.e_tag = e_tag"},{"sha":"f791e0bc747d0bcd880175ab41f6f1a94f599bb1","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py","status":"modified","additions":4,"deletions":0,"changes":4,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -12,11 +12,15 @@\n from .usage_details_operations import UsageDetailsOperations\n from .reservations_summaries_operations import ReservationsSummariesOperations\n from .reservations_details_operations import ReservationsDetailsOperations\n+from .budgets_operations import BudgetsOperations\n from .operations import Operations\n+from .price_sheet_operations import PriceSheetOperations\n \n __all__ = [\n 'UsageDetailsOperations',\n 'ReservationsSummariesOperations',\n 'ReservationsDetailsOperations',\n+ 'BudgetsOperations',\n 'Operations',\n+ 'PriceSheetOperations',\n ]"},{"sha":"1694905cc3b44bf71f17a69479734d1a90f0128a","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py","status":"added","additions":297,"deletions":0,"changes":297,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -0,0 +1,297 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+import uuid\n+from msrest.pipeline import ClientRawResponse\n+\n+from .. import models\n+\n+\n+class BudgetsOperations(object):\n+ \"\"\"BudgetsOperations operations.\n+\n+ :param client: Client for service requests.\n+ :param config: Configuration of service client.\n+ :param serializer: An object model serializer.\n+ :param deserializer: An objec model deserializer.\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n+ \"\"\"\n+\n+ models = models\n+\n+ def __init__(self, client, config, serializer, deserializer):\n+\n+ self._client = client\n+ self._serialize = serializer\n+ self._deserialize = deserializer\n+ self.api_version = \"2018-01-31\"\n+\n+ self.config = config\n+\n+ def list(\n+ self, scope, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Lists all budgets for a scope.\n+\n+ :param scope: The scope of the budgets. The scope can be\n+ 'subscriptions/{subscriptionId}' for a subscription, or\n+ 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}' for a\n+ resource group under a subscription.\n+ :type scope: str\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: An iterator like instance of Budget\n+ :rtype:\n+ ~azure.mgmt.consumption.models.BudgetPaged[~azure.mgmt.consumption.models.Budget]\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ def internal_paging(next_link=None, raw=False):\n+\n+ if not next_link:\n+ # Construct URL\n+ url = '/{scope}/providers/Microsoft.Consumption/budgets'\n+ path_format_arguments = {\n+ 'scope': self._serialize.url(\"scope\", scope, 'str', skip_quote=True),\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ else:\n+ url = next_link\n+ query_parameters = {}\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(\n+ request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ return response\n+\n+ # Deserialize response\n+ deserialized = models.BudgetPaged(internal_paging, self._deserialize.dependencies)\n+\n+ if raw:\n+ header_dict = {}\n+ client_raw_response = models.BudgetPaged(internal_paging, self._deserialize.dependencies, header_dict)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def get(\n+ self, scope, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Gets the budget for a scope by budget name.\n+\n+ :param scope: The scope of the budgets. The scope can be\n+ 'subscriptions/{subscriptionId}' for a subscription, or\n+ 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}' for a\n+ resource group under a subscription.\n+ :type scope: str\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: Budget or ClientRawResponse if raw=true\n+ :rtype: ~azure.mgmt.consumption.models.Budget or\n+ ~msrest.pipeline.ClientRawResponse\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ # Construct URL\n+ url = '/{scope}/providers/Microsoft.Consumption/budgets/{name}'\n+ path_format_arguments = {\n+ 'scope': self._serialize.url(\"scope\", scope, 'str', skip_quote=True),\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'name': self._serialize.url(\"self.config.name\", self.config.name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ deserialized = None\n+\n+ if response.status_code == 200:\n+ deserialized = self._deserialize('Budget', response)\n+\n+ if raw:\n+ client_raw_response = ClientRawResponse(deserialized, response)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def create_or_update(\n+ self, scope, parameters, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"The operation to create or update a budget. Update operation requires\n+ latest eTag to be set in the request mandatorily. You may obtain the\n+ latest eTag by performing a get operation. Create operation does not\n+ require eTag.\n+\n+ :param scope: The scope of the budgets. The scope can be\n+ 'subscriptions/{subscriptionId}' for a subscription, or\n+ 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}' for a\n+ resource group under a subscription.\n+ :type scope: str\n+ :param parameters: Parameters supplied to the Create Budget operation.\n+ :type parameters: ~azure.mgmt.consumption.models.Budget\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: An iterator like instance of None\n+ :rtype: ~azure.mgmt.consumption.models.Budget[None]\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ def internal_paging(next_link=None, raw=False):\n+\n+ if not next_link:\n+ # Construct URL\n+ url = '/{scope}/providers/Microsoft.Consumption/budgets/{name}'\n+ path_format_arguments = {\n+ 'scope': self._serialize.url(\"scope\", scope, 'str', skip_quote=True),\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'name': self._serialize.url(\"self.config.name\", self.config.name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ else:\n+ url = next_link\n+ query_parameters = {}\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct body\n+ body_content = self._serialize.body(parameters, 'Budget')\n+\n+ # Construct and send request\n+ request = self._client.put(url, query_parameters)\n+ response = self._client.send(\n+ request, header_parameters, body_content, stream=False, **operation_config)\n+\n+ if response.status_code not in [200, 201]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ return response\n+\n+ # Deserialize response\n+ deserialized = models.Budget(internal_paging, self._deserialize.dependencies)\n+\n+ if raw:\n+ header_dict = {}\n+ client_raw_response = models.Budget(internal_paging, self._deserialize.dependencies, header_dict)\n+ return client_raw_response\n+\n+ return deserialized\n+\n+ def delete(\n+ self, scope, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"The operation to delete a budget.\n+\n+ :param scope: The scope of the budgets. The scope can be\n+ 'subscriptions/{subscriptionId}' for a subscription, or\n+ 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}' for a\n+ resource group under a subscription.\n+ :type scope: str\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: None or ClientRawResponse if raw=true\n+ :rtype: None or ~msrest.pipeline.ClientRawResponse\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ # Construct URL\n+ url = '/{scope}/providers/Microsoft.Consumption/budgets/{name}'\n+ path_format_arguments = {\n+ 'scope': self._serialize.url(\"scope\", scope, 'str', skip_quote=True),\n+ 'subscriptionId': self._serialize.url(\"self.config.subscription_id\", self.config.subscription_id, 'str'),\n+ 'name': self._serialize.url(\"self.config.name\", self.config.name, 'str')\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.delete(url, query_parameters)\n+ response = self._client.send(request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ if raw:\n+ client_raw_response = ClientRawResponse(None, response)\n+ return client_raw_response"},{"sha":"f3efdae1c20868aef1cbad552979edb11f41663f","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py","status":"modified","additions":3,"deletions":3,"changes":6,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -22,7 +22,7 @@ class Operations(object):\n :param config: Configuration of service client.\n :param serializer: An object model serializer.\n :param deserializer: An objec model deserializer.\n- :ivar api_version: Version of the API to be used with the client request. The current version is 2017-11-30. Constant value: \"2017-11-30\".\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n \"\"\"\n \n models = models\n@@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer):\n self._client = client\n self._serialize = serializer\n self._deserialize = deserializer\n- self.api_version = \"2017-11-30\"\n+ self.api_version = \"2018-01-31\"\n \n self.config = config\n \n@@ -78,7 +78,7 @@ def internal_paging(next_link=None, raw=False):\n # Construct and send request\n request = self._client.get(url, query_parameters)\n response = self._client.send(\n- request, header_parameters, **operation_config)\n+ request, header_parameters, stream=False, **operation_config)\n \n if response.status_code not in [200]:\n raise models.ErrorResponseException(self._deserialize, response)"},{"sha":"d5663fb7895a1f04d509f50a5821dbe9b94704dc","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py","status":"added","additions":119,"deletions":0,"changes":119,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -0,0 +1,119 @@\n+# coding=utf-8\n+# --------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+#\n+# Code generated by Microsoft (R) AutoRest Code Generator.\n+# Changes may cause incorrect behavior and will be lost if the code is\n+# regenerated.\n+# --------------------------------------------------------------------------\n+\n+import uuid\n+from msrest.pipeline import ClientRawResponse\n+\n+from .. import models\n+\n+\n+class PriceSheetOperations(object):\n+ \"\"\"PriceSheetOperations operations.\n+\n+ :param client: Client for service requests.\n+ :param config: Configuration of service client.\n+ :param serializer: An object model serializer.\n+ :param deserializer: An objec model deserializer.\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n+ \"\"\"\n+\n+ models = models\n+\n+ def __init__(self, client, config, serializer, deserializer):\n+\n+ self._client = client\n+ self._serialize = serializer\n+ self._deserialize = deserializer\n+ self.api_version = \"2018-01-31\"\n+\n+ self.config = config\n+\n+ def list(\n+ self, scope, expand=None, skiptoken=None, custom_headers=None, raw=False, **operation_config):\n+ \"\"\"Returns the price sheet associated with subscription guid, for a scope\n+ by billing period.\n+\n+ :param scope: The scope of the price sheet. The scope can be\n+ '/subscriptions/{subscriptionId}' for a subscription, or\n+ '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodId}'\n+ for a billing period.\n+ :type scope: str\n+ :param expand: May be used to expand the properties/meterDetails\n+ within a price sheet. By default, these fields are not included when\n+ returning price sheet.\n+ :type expand: str\n+ :param skiptoken: Skiptoken is only used if a previous operation\n+ returned a partial result. If a previous response contains a nextLink\n+ element, the value of the nextLink element will include a skiptoken\n+ parameter that specifies a starting point to use for subsequent calls.\n+ :type skiptoken: str\n+ :param dict custom_headers: headers that will be added to the request\n+ :param bool raw: returns the direct response alongside the\n+ deserialized response\n+ :param operation_config: :ref:`Operation configuration\n+ overrides`.\n+ :return: An iterator like instance of PriceSheet\n+ :rtype:\n+ ~azure.mgmt.consumption.models.PriceSheetPaged[~azure.mgmt.consumption.models.PriceSheet]\n+ :raises:\n+ :class:`ErrorResponseException`\n+ \"\"\"\n+ def internal_paging(next_link=None, raw=False):\n+\n+ if not next_link:\n+ # Construct URL\n+ url = '/{scope}/providers/Microsoft.Consumption/pricesheets/default'\n+ path_format_arguments = {\n+ 'scope': self._serialize.url(\"scope\", scope, 'str', skip_quote=True)\n+ }\n+ url = self._client.format_url(url, **path_format_arguments)\n+\n+ # Construct parameters\n+ query_parameters = {}\n+ if expand is not None:\n+ query_parameters['$expand'] = self._serialize.query(\"expand\", expand, 'str')\n+ if skiptoken is not None:\n+ query_parameters['$skiptoken'] = self._serialize.query(\"skiptoken\", skiptoken, 'str')\n+ query_parameters['api-version'] = self._serialize.query(\"self.api_version\", self.api_version, 'str')\n+\n+ else:\n+ url = next_link\n+ query_parameters = {}\n+\n+ # Construct headers\n+ header_parameters = {}\n+ header_parameters['Content-Type'] = 'application/json; charset=utf-8'\n+ if self.config.generate_client_request_id:\n+ header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())\n+ if custom_headers:\n+ header_parameters.update(custom_headers)\n+ if self.config.accept_language is not None:\n+ header_parameters['accept-language'] = self._serialize.header(\"self.config.accept_language\", self.config.accept_language, 'str')\n+\n+ # Construct and send request\n+ request = self._client.get(url, query_parameters)\n+ response = self._client.send(\n+ request, header_parameters, stream=False, **operation_config)\n+\n+ if response.status_code not in [200]:\n+ raise models.ErrorResponseException(self._deserialize, response)\n+\n+ return response\n+\n+ # Deserialize response\n+ deserialized = models.PriceSheetPaged(internal_paging, self._deserialize.dependencies)\n+\n+ if raw:\n+ header_dict = {}\n+ client_raw_response = models.PriceSheetPaged(internal_paging, self._deserialize.dependencies, header_dict)\n+ return client_raw_response\n+\n+ return deserialized"},{"sha":"300e09f55c73071474db4e279693c0d4eef7d4db","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py","status":"modified","additions":3,"deletions":3,"changes":6,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -22,7 +22,7 @@ class ReservationsDetailsOperations(object):\n :param config: Configuration of service client.\n :param serializer: An object model serializer.\n :param deserializer: An objec model deserializer.\n- :ivar api_version: Version of the API to be used with the client request. The current version is 2017-11-30. Constant value: \"2017-11-30\".\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n \"\"\"\n \n models = models\n@@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer):\n self._client = client\n self._serialize = serializer\n self._deserialize = deserializer\n- self.api_version = \"2017-11-30\"\n+ self.api_version = \"2018-01-31\"\n \n self.config = config\n \n@@ -92,7 +92,7 @@ def internal_paging(next_link=None, raw=False):\n # Construct and send request\n request = self._client.get(url, query_parameters)\n response = self._client.send(\n- request, header_parameters, **operation_config)\n+ request, header_parameters, stream=False, **operation_config)\n \n if response.status_code not in [200]:\n raise models.ErrorResponseException(self._deserialize, response)"},{"sha":"2c5124d9e9e4263cb4b1279bd8347fb627d199c5","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py","status":"modified","additions":3,"deletions":3,"changes":6,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -22,7 +22,7 @@ class ReservationsSummariesOperations(object):\n :param config: Configuration of service client.\n :param serializer: An object model serializer.\n :param deserializer: An objec model deserializer.\n- :ivar api_version: Version of the API to be used with the client request. The current version is 2017-11-30. Constant value: \"2017-11-30\".\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n \"\"\"\n \n models = models\n@@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer):\n self._client = client\n self._serialize = serializer\n self._deserialize = deserializer\n- self.api_version = \"2017-11-30\"\n+ self.api_version = \"2018-01-31\"\n \n self.config = config\n \n@@ -96,7 +96,7 @@ def internal_paging(next_link=None, raw=False):\n # Construct and send request\n request = self._client.get(url, query_parameters)\n response = self._client.send(\n- request, header_parameters, **operation_config)\n+ request, header_parameters, stream=False, **operation_config)\n \n if response.status_code not in [200]:\n raise models.ErrorResponseException(self._deserialize, response)"},{"sha":"69abfd9386466b0d517e293a16264e8082e42147","filename":"azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py","status":"modified","additions":4,"deletions":4,"changes":8,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -22,7 +22,7 @@ class UsageDetailsOperations(object):\n :param config: Configuration of service client.\n :param serializer: An object model serializer.\n :param deserializer: An objec model deserializer.\n- :ivar api_version: Version of the API to be used with the client request. The current version is 2017-11-30. Constant value: \"2017-11-30\".\n+ :ivar api_version: Version of the API to be used with the client request. The current version is 2018-01-31. Constant value: \"2018-01-31\".\n \"\"\"\n \n models = models\n@@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer):\n self._client = client\n self._serialize = serializer\n self._deserialize = deserializer\n- self.api_version = \"2017-11-30\"\n+ self.api_version = \"2018-01-31\"\n \n self.config = config\n \n@@ -44,7 +44,7 @@ def list(\n :param scope: The scope of the usage details. The scope can be\n '/subscriptions/{subscriptionId}' for a subscription, or\n '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'\n- for a billing perdiod.\n+ for a billing period.\n :type scope: str\n :param expand: May be used to expand the\n properties/additionalProperties or properties/meterDetails within a\n@@ -115,7 +115,7 @@ def internal_paging(next_link=None, raw=False):\n # Construct and send request\n request = self._client.get(url, query_parameters)\n response = self._client.send(\n- request, header_parameters, **operation_config)\n+ request, header_parameters, stream=False, **operation_config)\n \n if response.status_code not in [200]:\n raise models.ErrorResponseException(self._deserialize, response)"},{"sha":"7bae806554140ef811329cd7f7e3a8e337d580fe","filename":"azure-mgmt-consumption/azure/mgmt/consumption/version.py","status":"modified","additions":1,"deletions":1,"changes":2,"blob_url":"https://github.com/Azure/azure-sdk-for-python/blob/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/version.py","raw_url":"https://github.com/Azure/azure-sdk-for-python/raw/042b7a5840ff471776bb64e46b50950ee9f84430/azure-mgmt-consumption/azure/mgmt/consumption/version.py","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-python/contents/azure-mgmt-consumption/azure/mgmt/consumption/version.py?ref=042b7a5840ff471776bb64e46b50950ee9f84430","patch":"@@ -9,5 +9,5 @@\n # regenerated.\n # --------------------------------------------------------------------------\n \n-VERSION = \"1.1.0\"\n+VERSION = \"2018-01-31\"\n "}]} + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_get_or_create_pull.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_get_or_create_pull.txt new file mode 100644 index 000000000000..70d25dd0519d --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_get_or_create_pull.txt @@ -0,0 +1,22 @@ +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/pulls +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"title": "Title", "body": "Body", "base": "b2", "head": "b1"} +422 +[('Date', 'Thu, 17 May 2018 21:27:38 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '209'), ('Server', 'GitHub.com'), ('Status', '422 Unprocessable Entity'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4772'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.087848'), ('X-GitHub-Request-Id', '1715:97B6:61F22E:7EE5EA:5AFDF3CA')] +{"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"No commits between b2 and b1"}],"documentation_url":"https://developer.github.com/v3/pulls/#create-a-pull-request"} + +https +POST +api.github.com +None +/repos/lmazuel/TestingRepo/pulls +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'} +{"title": "Title", "body": "Body", "base": "b2", "head": "b1"} +422 +[('Date', 'Thu, 17 May 2018 21:27:39 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '209'), ('Server', 'GitHub.com'), ('Status', '422 Unprocessable Entity'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4771'), ('X-RateLimit-Reset', '1526593184'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.118070'), ('X-GitHub-Request-Id', '1716:97B8:C24888:FB581B:5AFDF3CA')] +{"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"No commits between b2 and b1"}],"documentation_url":"https://developer.github.com/v3/pulls/#create-a-pull-request"} + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_get_user.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_get_user.txt new file mode 100644 index 000000000000..059d39112e47 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_get_user.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:39 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4770'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"77a0c498bc6360506f9e7a4dd33857df"'), ('Last-Modified', 'Tue, 08 May 2018 04:10:43 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.048690'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1717:97B6:61F247:7EE60C:5AFDF3CB')] +{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":46,"public_gists":14,"followers":30,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-05-08T04:10:43Z","private_gists":1,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41216,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_manage_git_folder.txt b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_manage_git_folder.txt new file mode 100644 index 000000000000..e994d3de5241 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/ReplayData/GithubTools.test_manage_git_folder.txt @@ -0,0 +1,33 @@ +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:39 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4769'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"77a0c498bc6360506f9e7a4dd33857df"'), ('Last-Modified', 'Tue, 08 May 2018 04:10:43 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.070117'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '1719:97B6:61F253:7EE61B:5AFDF3CB')] +{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":46,"public_gists":14,"followers":30,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-05-08T04:10:43Z","private_gists":1,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41216,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:42 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4768'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"77a0c498bc6360506f9e7a4dd33857df"'), ('Last-Modified', 'Tue, 08 May 2018 04:10:43 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.054549'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '171C:97B6:61F309:7EE6FD:5AFDF3CE')] +{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":46,"public_gists":14,"followers":30,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-05-08T04:10:43Z","private_gists":1,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41216,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + +https +GET +api.github.com +None +/user +{'Authorization': 'token private_token_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Date', 'Thu, 17 May 2018 21:27:46 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Server', 'GitHub.com'), ('Status', '200 OK'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4767'), ('X-RateLimit-Reset', '1526593184'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('ETag', 'W/"77a0c498bc6360506f9e7a4dd33857df"'), ('Last-Modified', 'Tue, 08 May 2018 04:10:43 GMT'), ('X-OAuth-Scopes', 'repo, user'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('Access-Control-Expose-Headers', 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '1; mode=block'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-Runtime-rack', '0.063164'), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', '171F:97B8:C24AB5:FB5AD5:5AFDF3D2')] +{"login":"lmazuel","id":1050156,"avatar_url":"https://avatars3.githubusercontent.com/u/1050156?v=4","gravatar_id":"","url":"https://api.github.com/users/lmazuel","html_url":"https://github.com/lmazuel","followers_url":"https://api.github.com/users/lmazuel/followers","following_url":"https://api.github.com/users/lmazuel/following{/other_user}","gists_url":"https://api.github.com/users/lmazuel/gists{/gist_id}","starred_url":"https://api.github.com/users/lmazuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmazuel/subscriptions","organizations_url":"https://api.github.com/users/lmazuel/orgs","repos_url":"https://api.github.com/users/lmazuel/repos","events_url":"https://api.github.com/users/lmazuel/events{/privacy}","received_events_url":"https://api.github.com/users/lmazuel/received_events","type":"User","site_admin":false,"name":"Laurent Mazuel","company":"Microsoft.","blog":"","location":"Redmond, WA, USA","email":"lmazuel@microsoft.com","hireable":null,"bio":"Azure SDK for Python","public_repos":46,"public_gists":14,"followers":30,"following":11,"created_at":"2011-09-14T12:44:37Z","updated_at":"2018-05-08T04:10:43Z","private_gists":1,"total_private_repos":4,"owned_private_repos":0,"disk_usage":41216,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}} + diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/__init__.py b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/conftest.py b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/conftest.py new file mode 100644 index 000000000000..869626a022c2 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/conftest.py @@ -0,0 +1,44 @@ +"""Configuration of fixtures for pytest""" +import logging +import os +import sys +import types + +from github import Github + +import pytest + +_LOGGER = logging.getLogger(__name__) + +collect_ignore = [] +if sys.version_info < (3, 6): + # Might do something more generic later + collect_ignore.append("test_bot_framework.py") + collect_ignore.append("test_git_tools.py") + collect_ignore.append("test_github_tools.py") + +_context = { + 'login': "login", + 'password': "password", + 'oauth_token': os.environ.get('GH_TOKEN', 'oauth_token') +} +_test_context_module = types.ModuleType( + 'GithubCredentials', + 'Module created to provide a context for tests' +) +_test_context_module.__dict__.update(_context) +sys.modules['GithubCredentials'] = _test_context_module + + +@pytest.fixture +def github_token(): + """Return the Github token to use for real tests.""" + if not 'GH_TOKEN' in os.environ: + _LOGGER.warning('GH_TOKEN must be defined for this test') + return "faketoken" + return os.environ['GH_TOKEN'] + +@pytest.fixture +def github_client(github_token): + """Return a Github client with configured token.""" + return Github(github_token) diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/test_bot_framework.py b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/test_bot_framework.py new file mode 100644 index 000000000000..d7d407bc970e --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/test_bot_framework.py @@ -0,0 +1,215 @@ +import os.path +from unittest import mock + +import pytest +from github.tests import Framework + +from azure_devtools.ci_tools.bot_framework import BotHandler, order, build_from_issue_comment, build_from_issues + +class BotFrameworkTest(Framework.TestCase): + + def setUp(self): + self.maxDiff = None # Big diff to come + self.recordMode = False # turn to True to record + self.tokenAuthMode = True + self.replayDataFolder = os.path.join(os.path.dirname(__file__), "ReplayData") + super(BotFrameworkTest, self).setUp() + + def test_webhook_data(self): + github_token = self.oauth_token + repo = self.g.get_repo("lmazuel/TestingRepo") + + fake_webhook = { + 'action': 'opened', # What is the comment state? + 'repository': { + 'full_name': repo.full_name # On what repo is this command? + }, + 'issue': { + 'number': 16, # On what issue is this comment? + 'body': "@AutorestCI help" # Message? + }, + 'sender': { + 'login': "lmazuel" # Who wrote the command? + }, + } + webhook_data = build_from_issues(github_token, fake_webhook) + assert webhook_data.text == "@AutorestCI help" + assert webhook_data.issue.number == 16 + assert webhook_data.repo.full_name == repo.full_name + + fake_webhook = { + 'action': 'created', # What is the comment state? + 'repository': { + 'full_name': repo.full_name # On what repo is this command? + }, + 'issue': { + 'number': 16 # On what issue is this comment? + }, + 'sender': { + 'login': "lmazuel" # Who wrote the command? + }, + 'comment': { + 'id': 365120206, + 'body': "@AutorestCI help" # Message? + } + } + webhook_data = build_from_issue_comment(github_token, fake_webhook) + assert webhook_data.text == "@AutorestCI help" + assert webhook_data.issue.number == 16 + assert webhook_data.repo.full_name == repo.full_name + + def test_bot_help(self): + github_token = self.oauth_token + repo = self.g.get_repo("lmazuel/TestingRepo") + issue = repo.get_issue(16) + + class BotHelp: + @order + def command1(self, issue): + pass + @order + def command2(self, issue): + pass + def notacommand(self): + pass + + bot = BotHandler(BotHelp(), "AutorestCI", github_token) + + fake_webhook = { + 'action': 'opened', # What is the comment state? + 'repository': { + 'full_name': issue.repository.full_name # On what repo is this command? + }, + 'issue': { + 'number': issue.number, # On what issue is this comment? + 'body': "@AutorestCI help" # Message? + }, + 'sender': { + 'login': "lmazuel" # Who wrote the command? + }, + } + + response = bot.issues(fake_webhook) + assert "this help message" in response["message"] + assert "command1" in response["message"] + assert "notacommand" not in response["message"] + + help_comment = list(issue.get_comments())[-1] + assert "this help message" in help_comment.body + assert "command1" in help_comment.body + assert "notacommand" not in help_comment.body + + # Clean + help_comment.delete() + + def test_bot_basic_command(self): + github_token = self.oauth_token + repo = self.g.get_repo("lmazuel/TestingRepo") + issue = repo.get_issue(17) + + class BotCommand: + @order + def command1(self, issue, param1): + assert issue.number == 17 + return "I did something with "+param1 + + bot = BotHandler(BotCommand(), "AutorestCI", github_token) + + fake_webhook = { + 'action': 'opened', # What is the comment state? + 'repository': { + 'full_name': issue.repository.full_name # On what repo is this command? + }, + 'issue': { + 'number': issue.number, # On what issue is this comment? + 'body': "@AutorestCI command1 myparameter" # Message? + }, + 'sender': { + 'login': "lmazuel" # Who wrote the command? + }, + } + + response = bot.issues(fake_webhook) + assert response["message"] == "I did something with myparameter" + + help_comment = list(issue.get_comments())[-1] + assert "I did something with myparameter" in help_comment.body + + # Clean + help_comment.delete() + + @mock.patch('traceback.format_exc') + def test_bot_basic_failure(self, format_exc): + format_exc.return_value = 'something to do with an exception' + + github_token = self.oauth_token + repo = self.g.get_repo("lmazuel/TestingRepo") + issue = repo.get_issue(18) + + class BotCommand: + @order + def command1(self, issue, param1): + assert issue.number == 18 + raise ValueError("Not happy") + + bot = BotHandler(BotCommand(), "AutorestCI", github_token) + + fake_webhook = { + 'action': 'opened', # What is the comment state? + 'repository': { + 'full_name': issue.repository.full_name # On what repo is this command? + }, + 'issue': { + 'number': issue.number, # On what issue is this comment? + 'body': "@AutorestCI command1 myparameter" # Message? + }, + 'sender': { + 'login': "lmazuel" # Who wrote the command? + }, + } + + response = bot.issues(fake_webhook) + assert response['message'] == 'Nothing for me or exception' + + help_comment = list(issue.get_comments())[-1] + assert "something to do with an exception" in help_comment.body + assert "```python" in help_comment.body + + # Clean + help_comment.delete() + + + def test_bot_unknown_command(self): + github_token = self.oauth_token + repo = self.g.get_repo("lmazuel/TestingRepo") + issue = repo.get_issue(19) + + class BotCommand: + pass + + bot = BotHandler(BotCommand(), "AutorestCI", github_token) + + fake_webhook = { + 'action': 'opened', # What is the comment state? + 'repository': { + 'full_name': issue.repository.full_name # On what repo is this command? + }, + 'issue': { + 'number': issue.number, # On what issue is this comment? + 'body': "@AutorestCI command1 myparameter" # Message? + }, + 'sender': { + 'login': "lmazuel" # Who wrote the command? + }, + } + + response = bot.issues(fake_webhook) + assert "I didn't understand your command" in response['message'] + assert "command1 myparameter" in response['message'] + + help_comment = list(issue.get_comments())[-1] + assert "I didn't understand your command" in help_comment.body + assert "command1 myparameter" in help_comment.body + + # Clean + help_comment.delete() diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/test_git_tools.py b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/test_git_tools.py new file mode 100644 index 000000000000..432824f611b1 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/test_git_tools.py @@ -0,0 +1,72 @@ +from pathlib import Path +import tempfile + +from git import Repo + +from azure_devtools.ci_tools.git_tools import ( + do_commit, + get_files_in_commit +) + +def test_do_commit(): + finished = False # Authorize PermissionError on cleanup + try: + with tempfile.TemporaryDirectory() as temp_dir: + Repo.clone_from('https://github.com/lmazuel/TestingRepo.git', temp_dir) + repo = Repo(temp_dir) + + result = do_commit(repo, 'Test {hexsha}', 'testing', 'fakehexsha') + assert not result + assert 'fakehexsha' not in repo.head.commit.message + assert repo.active_branch.name == 'master' + + file_path = Path(temp_dir, 'file.txt') + file_path.write_text('Something') + + result = do_commit(repo, 'Test {hexsha}', 'testing', 'fakehexsha') + assert result + assert repo.head.commit.message == 'Test fakehexsha' + assert repo.active_branch.name == 'testing' + assert 'file.txt' in repo.head.commit.stats.files + + file_path.write_text('New content') + + result = do_commit(repo, 'Now it is {hexsha}', 'newbranch', 'new-fakehexsha') + assert result + assert repo.head.commit.message == 'Now it is new-fakehexsha' + assert repo.active_branch.name == 'newbranch' + assert 'file.txt' in repo.head.commit.stats.files + + file_path.unlink() + file_path.write_text('New content') + + result = do_commit(repo, 'Now it is {hexsha}', 'fakebranch', 'hexsha_not_used') + assert not result + assert repo.head.commit.message == 'Now it is new-fakehexsha' + assert repo.active_branch.name == 'newbranch' + + finished = True + except PermissionError: + if finished: + return + raise + +def test_get_files_in_commit(): + finished = False # Authorize PermissionError on cleanup + try: + with tempfile.TemporaryDirectory() as temp_dir: + Repo.clone_from('https://github.com/lmazuel/swagger-to-sdk.git', temp_dir) + + files = get_files_in_commit(temp_dir, "b40451e55b26e3db61ea17bd751181cbf91f60c5") + + assert files == [ + 'swaggertosdk/generate_package.py', + 'swaggertosdk/python_sdk_tools.py', + 'swaggertosdk/restapi/sdkbot.py' + ] + + finished = True + except PermissionError: + if finished: + return + raise diff --git a/tools/azure-devtools/src/azure_devtools/ci_tools/tests/test_github_tools.py b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/test_github_tools.py new file mode 100644 index 000000000000..a6829810be80 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/ci_tools/tests/test_github_tools.py @@ -0,0 +1,382 @@ +import os.path +from pathlib import Path +from subprocess import CalledProcessError +import tempfile +from unittest import mock + +import pytest + +from git import Repo, GitCommandError +from github import GithubException +from github.tests import Framework + +from azure_devtools.ci_tools.github_tools import ( + exception_to_github, + user_from_token, + configure_user, + clone_to_path, + manage_git_folder, + do_pr, + get_files, + create_comment, + GithubLink, + DashboardCommentableObject, + DashboardComment, + get_or_create_pull +) + +class GithubTools(Framework.TestCase): + + def setUp(self): + self.maxDiff = None # Big diff to come + self.recordMode = False # turn to True to record + self.tokenAuthMode = True + self.replayDataFolder = os.path.join(os.path.dirname(__file__), "ReplayData") + super(GithubTools, self).setUp() + + @mock.patch('traceback.format_exc') + def test_exception_to_github(self, format_exc): + format_exc.return_value = 'something to do with an exception' + + # Prepare + repo = self.g.get_repo("lmazuel/TestingRepo") + issue = repo.get_issue(13) + + # Act + with exception_to_github(issue) as error: + pass + + assert error.comment is None + + # Act + with exception_to_github(issue) as error: + "Test".fakemethod(12) # pylint: disable=no-member + + # Test + assert error.comment is not None + assert "Encountered an unknown error" in error.comment.body + + # Clean my mess + error.comment.delete() + + # Act + with exception_to_github(issue, "Python bot") as error: + "Test".fakemethod(12) # pylint: disable=no-member + + # Test + assert error.comment is not None + assert "Encountered an unknown error: (Python bot)" in error.comment.body + + # Clean my mess + error.comment.delete() + + # Act + with exception_to_github(issue, "Python bot") as error: + raise CalledProcessError( + 2, + ["autorest", "readme.md"], + "Error line 1\nError line 2" + ) + + # Test + assert error.comment is not None + assert "Encountered a Subprocess error: (Python bot)" in error.comment.body + assert "Error line 1" in error.comment.body + + # Clean my mess + error.comment.delete() + + # Act + with exception_to_github(issue, "Python bot") as error: + raise CalledProcessError( + 2, + ["autorest", "readme.md"], + ) + + # Test + assert error.comment is not None + assert "Encountered a Subprocess error: (Python bot)" in error.comment.body + assert "no output" in error.comment.body + + # Clean my mess + error.comment.delete() + + def test_get_or_create_pull(self): + repo = self.g.get_repo("lmazuel/TestingRepo") + + # b1 and b2 should exist and be the same + with pytest.raises(GithubException): + get_or_create_pull(repo, "Title", "Body", "b1", "b2") + + prresult = get_or_create_pull(repo, "Title", "Body", "b1", "b2", none_if_no_commit=True) + assert prresult is None + + @mock.patch('traceback.format_exc') + def test_dashboard(self, format_exc): + format_exc.return_value = 'something to do with an exception' + + # Prepare + repo = self.g.get_repo("lmazuel/TestingRepo") + issue = repo.get_issue(15) + initial_size = len(list(issue.get_comments())) + header = "# MYHEADER" + + dashboard = DashboardCommentableObject(issue, header) + + with exception_to_github(dashboard, "Python bot") as error: + "Test".fakemethod(12) # pylint: disable=no-member + + after_size = len(list(issue.get_comments())) + assert after_size == initial_size + 1 + + assert error.comment is not None + assert "Encountered an unknown error" in error.comment.body + + dashboard.create_comment("New text comment") + after_size_2 = len(list(issue.get_comments())) + assert after_size == after_size_2 + + # Clean my mess + error.comment.delete() + + def test_get_user(self): + github_token = self.oauth_token + user = user_from_token(github_token) + assert user.login == 'lmazuel' + + def test_get_files(self): + repo = self.g.get_repo("Azure/azure-sdk-for-python") + pr = repo.get_pull(1833) + files = get_files(pr) + assert "azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py" in [f.filename for f in files] + + commit = repo.get_commit("042b7a5840ff471776bb64e46b50950ee9f84430") + files = get_files(commit) + assert "azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py" in [f.filename for f in files] + + def test_create_comment(self): + repo = self.g.get_repo("lmazuel/TestingRepo") + issue = repo.get_issue(14) + comment = create_comment(issue, "This is a test") + comment.delete() + + pull = repo.get_pull(2) + comment = create_comment(pull, "This is a test") + comment.delete() + + def test_configure(self): + github_token = self.oauth_token + finished = False + try: + with tempfile.TemporaryDirectory() as temp_dir: + try: + Repo.clone_from('https://github.com/lmazuel/TestingRepo.git', temp_dir) + repo = Repo(temp_dir) + + # If it's not throwing, I'm happy enough + configure_user(github_token, repo) + + assert repo.git.config('--get', 'user.name') == 'Laurent Mazuel' + except Exception as err: + print(err) + pytest.fail(err) + else: + finished = True + except PermissionError: + if finished: + return + raise + + def test_clone_path(self): + github_token = self.oauth_token + finished = False # Authorize PermissionError on cleanup + try: + with tempfile.TemporaryDirectory() as temp_dir: + clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo") + assert (Path(temp_dir) / Path("README.md")).exists() + + finished = True + except PermissionError: + if not finished: + raise + + finished = False # Authorize PermissionError on cleanup + try: + with tempfile.TemporaryDirectory() as temp_dir: + clone_to_path(github_token, temp_dir, "https://github.com/lmazuel/TestingRepo") + assert (Path(temp_dir) / Path("README.md")).exists() + + finished = True + except PermissionError: + if not finished: + raise + + finished = False # Authorize PermissionError on cleanup + try: + with tempfile.TemporaryDirectory() as temp_dir: + clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo", "lmazuel-patch-1") + assert (Path(temp_dir) / Path("README.md")).exists() + + finished = True + except PermissionError: + if not finished: + raise + + finished = False # Authorize PermissionError on cleanup + try: + with tempfile.TemporaryDirectory() as temp_dir: + with pytest.raises(GitCommandError): + clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo", "fakebranch") + + finished = True + except (PermissionError, FileNotFoundError): + if not finished: + raise + + finished = False # Authorize PermissionError on cleanup + # PR 2 must be open, or the test means nothing + try: + with tempfile.TemporaryDirectory() as temp_dir: + clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo", pr_number=2) + assert (Path(temp_dir) / Path("README.md")).exists() + + finished = True + except (PermissionError, FileNotFoundError): + if not finished: + raise + + finished = False # Authorize PermissionError on cleanup + # PR 1 must be MERGED, or the test means nothing + try: + with tempfile.TemporaryDirectory() as temp_dir: + clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo", pr_number=1) + assert (Path(temp_dir) / Path("README.md")).exists() + + finished = True + except (PermissionError, FileNotFoundError): + if not finished: + raise + + finished = False # Authorize PermissionError on cleanup + # PR 2 must be opened, or the test means nothing + repo = self.g.get_repo("lmazuel/TestingRepo") + pr = repo.get_pull(2) + try: + with tempfile.TemporaryDirectory() as temp_dir: + clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo", branch_or_commit=pr.merge_commit_sha, pr_number=2) + assert (Path(temp_dir) / Path("README.md")).stat().st_size >= 107 # File in the PR + + finished = True + except (PermissionError, FileNotFoundError): + if not finished: + raise + + finished = False # Authorize PermissionError on cleanup + try: + with tempfile.TemporaryDirectory() as temp_dir: + with pytest.raises(GitCommandError): + clone_to_path(github_token, temp_dir, "lmazuel/TestingRepo", pr_number=123456789) + + finished = True + except (PermissionError, FileNotFoundError): + if not finished: + raise + + def test_manage_git_folder(self): + github_token = self.oauth_token + finished = False # Authorize PermissionError on cleanup + try: + with tempfile.TemporaryDirectory() as temp_dir, \ + manage_git_folder(github_token, temp_dir, "lmazuel/TestingRepo") as rest_repo: + + assert (Path(rest_repo) / Path("README.md")).exists() + + finished = True + except (PermissionError, FileNotFoundError): + if not finished: + raise + + finished = False # Authorize PermissionError on cleanup + try: + with tempfile.TemporaryDirectory() as temp_dir, \ + manage_git_folder(github_token, temp_dir, "lmazuel/TestingRepo@lmazuel-patch-1") as rest_repo: + + assert (Path(rest_repo) / Path("README.md")).exists() + assert "lmazuel-patch-1" in str(Repo(rest_repo).active_branch) + + finished = True + except (PermissionError, FileNotFoundError): + if not finished: + raise + + finished = False # Authorize PermissionError on cleanup + try: + with tempfile.TemporaryDirectory() as temp_dir, \ + manage_git_folder(github_token, temp_dir, "lmazuel/TestingRepo", pr_number=1) as rest_repo: + + assert (Path(rest_repo) / Path("README.md")).exists() + with pytest.raises(TypeError) as err: + Repo(rest_repo).active_branch + assert "HEAD is a detached symbolic reference" in str(err) + + finished = True + except (PermissionError, FileNotFoundError): + if not finished: + raise + + def test_do_pr(self): + github_token = self.oauth_token + # Should do nothing + do_pr(None, 'bad', 'bad', 'bad', 'bad') + + # Should do nothing + do_pr(github_token, 'bad', None, 'bad', 'bad') + + # FIXME - more tests + + +def test_github_link(): + inputstr = "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/billing/resource-manager/readme.md" + link = GithubLink.from_string(inputstr) + assert link.gitid == "Azure/azure-rest-api-specs" + assert link.branch_or_commit == "master" + assert link.link_type == "raw" + assert link.path == "specification/billing/resource-manager/readme.md" + assert str(link) == inputstr + raw_link = link.as_raw_link() + assert isinstance(raw_link, GithubLink) + assert str(raw_link) == str(link) + + inputstr = "https://github.com/Azure/azure-rest-api-specs/blob/master/specification/billing/resource-manager/readme.md" + link = GithubLink.from_string(inputstr) + assert link.gitid == "Azure/azure-rest-api-specs" + assert link.branch_or_commit == "master" + assert link.link_type == "blob" + assert link.path == "specification/billing/resource-manager/readme.md" + assert str(link) == inputstr + raw_link = link.as_raw_link() + assert isinstance(raw_link, GithubLink) + assert str(raw_link) == "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/billing/resource-manager/readme.md" + + inputstr = "https://github.com/Azure/azure-rest-api-specs/tree/master/specification/billing/resource-manager" + link = GithubLink.from_string(inputstr) + assert link.gitid == "Azure/azure-rest-api-specs" + assert link.branch_or_commit == "master" + assert link.link_type == "tree" + assert link.path == "specification/billing/resource-manager" + assert str(link) == inputstr + with pytest.raises(ValueError): + link.as_raw_link() + + inputstr = "https://token@github.com/Azure/azure-rest-api-specs/blob/master/specification/billing/resource-manager/readme.md" + link = GithubLink.from_string(inputstr) + assert link.token == "token" + assert link.gitid == "Azure/azure-rest-api-specs" + assert link.branch_or_commit == "master" + assert link.link_type == "blob" + assert link.path == "specification/billing/resource-manager/readme.md" + assert str(link) == inputstr + raw_link = link.as_raw_link() + assert isinstance(raw_link, GithubLink) + # Raw link with token does not use token in URL, since it has to be provided as Authorization: token + assert str(raw_link) == "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/billing/resource-manager/readme.md" diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/__init__.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/__init__.py new file mode 100644 index 000000000000..b90b5aaa96b8 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/__init__.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from .base import IntegrationTestBase, ReplayableTest, LiveTest +from .exceptions import AzureTestError +from .decorators import live_only, record_only, AllowLargeResponse +from .patches import mock_in_unit_test, patch_time_sleep_api, patch_long_run_operation_delay +from .preparers import AbstractPreparer, SingleValueReplacer +from .recording_processors import ( + RecordingProcessor, SubscriptionRecordingProcessor, + LargeRequestBodyProcessor, LargeResponseBodyProcessor, LargeResponseBodyReplacer, + OAuthRequestResponsesFilter, DeploymentNameReplacer, GeneralNameReplacer, AccessTokenReplacer, RequestUrlNormalizer, +) +from .utilities import create_random_name, get_sha1_hash + +__all__ = ['IntegrationTestBase', 'ReplayableTest', 'LiveTest', + 'AzureTestError', + 'mock_in_unit_test', 'patch_time_sleep_api', 'patch_long_run_operation_delay', + 'AbstractPreparer', 'SingleValueReplacer', 'AllowLargeResponse', + 'RecordingProcessor', 'SubscriptionRecordingProcessor', + 'LargeRequestBodyProcessor', 'LargeResponseBodyProcessor', 'LargeResponseBodyReplacer', + 'OAuthRequestResponsesFilter', 'DeploymentNameReplacer', 'GeneralNameReplacer', + 'AccessTokenReplacer', 'RequestUrlNormalizer', + 'live_only', 'record_only', + 'create_random_name', 'get_sha1_hash'] +__version__ = '0.5.2' diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/base.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/base.py new file mode 100644 index 000000000000..81d90f96a46c --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/base.py @@ -0,0 +1,214 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from __future__ import print_function +import unittest +import os +import inspect +import tempfile +import shutil +import logging +import threading +import six +import vcr + +from .config import TestConfig +from .const import ENV_TEST_DIAGNOSE +from .utilities import create_random_name +from .decorators import live_only + + +class IntegrationTestBase(unittest.TestCase): + def __init__(self, method_name): + super(IntegrationTestBase, self).__init__(method_name) + self.diagnose = os.environ.get(ENV_TEST_DIAGNOSE, None) == 'True' + self.logger = logging.getLogger('azure_devtools.scenario_tests') + + def create_random_name(self, prefix, length): # pylint: disable=no-self-use + return create_random_name(prefix=prefix, length=length) + + def create_temp_file(self, size_kb, full_random=False): + """ Create a temporary file for testing. The test harness will delete the file during tearing down. """ + fd, path = tempfile.mkstemp() + os.close(fd) + self.addCleanup(lambda: os.remove(path)) + + with open(path, mode='r+b') as f: + if full_random: + chunk = os.urandom(1024) + else: + chunk = bytearray([0] * 1024) + for _ in range(size_kb): + f.write(chunk) + + return path + + def create_temp_dir(self): + """ + Create a temporary directory for testing. The test harness will delete the directory during tearing down. + """ + temp_dir = tempfile.mkdtemp() + self.addCleanup(lambda: shutil.rmtree(temp_dir, ignore_errors=True)) + + return temp_dir + + @classmethod + def set_env(cls, key, val): + os.environ[key] = val + + @classmethod + def pop_env(cls, key): + return os.environ.pop(key, None) + + +@live_only() +class LiveTest(IntegrationTestBase): + pass + + +class ReplayableTest(IntegrationTestBase): # pylint: disable=too-many-instance-attributes + FILTER_HEADERS = [ + 'authorization', + 'client-request-id', + 'retry-after', + 'x-ms-client-request-id', + 'x-ms-correlation-request-id', + 'x-ms-ratelimit-remaining-subscription-reads', + 'x-ms-request-id', + 'x-ms-routing-request-id', + 'x-ms-gateway-service-instanceid', + 'x-ms-ratelimit-remaining-tenant-reads', + 'x-ms-served-by', + 'x-ms-authorization-auxiliary' + ] + + def __init__(self, # pylint: disable=too-many-arguments + method_name, config_file=None, recording_dir=None, recording_name=None, recording_processors=None, + replay_processors=None, recording_patches=None, replay_patches=None): + super(ReplayableTest, self).__init__(method_name) + + self.recording_processors = recording_processors or [] + self.replay_processors = replay_processors or [] + + self.recording_patches = recording_patches or [] + self.replay_patches = replay_patches or [] + + self.config = TestConfig(config_file=config_file) + + self.disable_recording = False + + test_file_path = inspect.getfile(self.__class__) + recording_dir = recording_dir or os.path.join(os.path.dirname(test_file_path), 'recordings') + self.is_live = self.config.record_mode + + self.vcr = vcr.VCR( + cassette_library_dir=recording_dir, + before_record_request=self._process_request_recording, + before_record_response=self._process_response_recording, + decode_compressed_response=True, + record_mode='once' if not self.is_live else 'all', + filter_headers=self.FILTER_HEADERS + ) + self.vcr.register_matcher('query', self._custom_request_query_matcher) + + self.recording_file = os.path.join( + recording_dir, + '{}.yaml'.format(recording_name or method_name) + ) + if self.is_live and os.path.exists(self.recording_file): + os.remove(self.recording_file) + + self.in_recording = self.is_live or not os.path.exists(self.recording_file) + self.test_resources_count = 0 + self.original_env = os.environ.copy() + + def setUp(self): + super(ReplayableTest, self).setUp() + + # set up cassette + cm = self.vcr.use_cassette(self.recording_file) + self.cassette = cm.__enter__() + self.addCleanup(cm.__exit__) + + # set up mock patches + if self.in_recording: + for patch in self.recording_patches: + patch(self) + else: + for patch in self.replay_patches: + patch(self) + + def tearDown(self): + os.environ = self.original_env + # Autorest.Python 2.x + assert not [t for t in threading.enumerate() if t.name.startswith("AzureOperationPoller")], \ + "You need to call 'result' or 'wait' on all AzureOperationPoller you have created" + # Autorest.Python 3.x + assert not [t for t in threading.enumerate() if t.name.startswith("LROPoller")], \ + "You need to call 'result' or 'wait' on all LROPoller you have created" + + def _process_request_recording(self, request): + if self.disable_recording: + return None + + if self.in_recording: + for processor in self.recording_processors: + request = processor.process_request(request) + if not request: + break + else: + for processor in self.replay_processors: + request = processor.process_request(request) + if not request: + break + + return request + + def _process_response_recording(self, response): + from .utilities import is_text_payload + if self.in_recording: + # make header name lower case and filter unwanted headers + headers = {} + for key in response['headers']: + if key.lower() not in self.FILTER_HEADERS: + headers[key.lower()] = response['headers'][key] + response['headers'] = headers + + body = response['body']['string'] + if is_text_payload(response) and body and not isinstance(body, six.string_types): + response['body']['string'] = body.decode('utf-8') + + for processor in self.recording_processors: + response = processor.process_response(response) + if not response: + break + else: + for processor in self.replay_processors: + response = processor.process_response(response) + if not response: + break + + return response + + @classmethod + def _custom_request_query_matcher(cls, r1, r2): + """ Ensure method, path, and query parameters match. """ + from six.moves.urllib_parse import urlparse, parse_qs # pylint: disable=import-error,relative-import + + url1 = urlparse(r1.uri) + url2 = urlparse(r2.uri) + + q1 = parse_qs(url1.query) + q2 = parse_qs(url2.query) + shared_keys = set(q1.keys()).intersection(set(q2.keys())) + + if len(shared_keys) != len(q1) or len(shared_keys) != len(q2): + return False + + for key in shared_keys: + if q1[key][0].lower() != q2[key][0].lower(): + return False + + return True diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/config.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/config.py new file mode 100644 index 000000000000..ac6ac6f91c0a --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/config.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import configargparse + +from .const import ENV_LIVE_TEST + + +class TestConfig(object): # pylint: disable=too-few-public-methods + def __init__(self, parent_parsers=None, config_file=None): + parent_parsers = parent_parsers or [] + self.parser = configargparse.ArgumentParser(parents=parent_parsers) + self.parser.add_argument( + '-c', '--config', is_config_file=True, default=config_file, + help='Path to a configuration file in YAML format.' + ) + self.parser.add_argument( + '-l', '--live-mode', action='store_true', dest='live_mode', + env_var=ENV_LIVE_TEST, + help='Activate "live" recording mode for tests.' + ) + self.args = self.parser.parse_args([]) + + @property + def record_mode(self): + return self.args.live_mode diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/const.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/const.py new file mode 100644 index 000000000000..e27e7289a021 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/const.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# Replaced mock values +MOCKED_SUBSCRIPTION_ID = '00000000-0000-0000-0000-000000000000' +MOCKED_TENANT_ID = '00000000-0000-0000-0000-000000000000' + +# Configuration environment variable +ENV_COMMAND_COVERAGE = 'AZURE_TEST_COMMAND_COVERAGE' +ENV_LIVE_TEST = 'AZURE_TEST_RUN_LIVE' +ENV_SKIP_ASSERT = 'AZURE_TEST_SKIP_ASSERT' +ENV_TEST_DIAGNOSE = 'AZURE_TEST_DIAGNOSE' diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/decorators.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/decorators.py new file mode 100644 index 000000000000..b31d8ee29dae --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/decorators.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import functools +import unittest +from .const import ENV_LIVE_TEST +from .utilities import trim_kwargs_from_test_function + + +def live_only(): + return unittest.skipUnless( + os.environ.get(ENV_LIVE_TEST, False), + 'This is a live only test. A live test will bypass all vcrpy components.') + + +def record_only(): + return unittest.skipUnless( + not os.environ.get(ENV_LIVE_TEST, False), + 'This test is excluded from being run live. To force a recording, please remove the recording file.') + + +class AllowLargeResponse(object): # pylint: disable=too-few-public-methods + + def __init__(self, size_kb=1024): + self.size_kb = size_kb + + def __call__(self, fn): + def _preparer_wrapper(test_class_instance, **kwargs): + from azure_devtools.scenario_tests import LargeResponseBodyProcessor + large_resp_body = next((r for r in test_class_instance.recording_processors + if isinstance(r, LargeResponseBodyProcessor)), None) + if large_resp_body: + large_resp_body._max_response_body = self.size_kb # pylint: disable=protected-access + + trim_kwargs_from_test_function(fn, kwargs) + + fn(test_class_instance, **kwargs) + + setattr(_preparer_wrapper, '__is_preparer', True) + functools.update_wrapper(_preparer_wrapper, fn) + return _preparer_wrapper diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/exceptions.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/exceptions.py new file mode 100644 index 000000000000..bdebae0b44e8 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/exceptions.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +class AzureTestError(Exception): + def __init__(self, error_message): + message = 'An error caused by the Azure test harness failed the test: {}' + super(AzureTestError, self).__init__(message.format(error_message)) diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/patches.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/patches.py new file mode 100644 index 000000000000..74c27927c29c --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/patches.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from .exceptions import AzureTestError + + +def patch_time_sleep_api(unit_test): + def _time_sleep_skip(*_): + return + + mock_in_unit_test(unit_test, 'time.sleep', _time_sleep_skip) + + +def patch_long_run_operation_delay(unit_test): + def _shortcut_long_run_operation(*args, **kwargs): # pylint: disable=unused-argument + return + + mock_in_unit_test(unit_test, + 'msrestazure.azure_operation.AzureOperationPoller._delay', + _shortcut_long_run_operation) + + +def mock_in_unit_test(unit_test, target, replacement): + try: + import unittest.mock as mock + except ImportError: + import mock + import unittest + + if not isinstance(unit_test, unittest.TestCase): + raise AzureTestError('Patches can be only called from a unit test') + + mp = mock.patch(target, replacement) + mp.__enter__() + unit_test.addCleanup(mp.__exit__) diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py new file mode 100644 index 000000000000..b10d8c949b68 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py @@ -0,0 +1,122 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import contextlib +import functools + +from .base import ReplayableTest +from .utilities import create_random_name, is_text_payload, trim_kwargs_from_test_function +from .recording_processors import RecordingProcessor + + +# Core Utility + +class AbstractPreparer(object): + def __init__(self, name_prefix, name_len, disable_recording=False): + self.name_prefix = name_prefix + self.name_len = name_len + self.resource_moniker = None + self.resource_random_name = None + self.test_class_instance = None + self.live_test = False + self.disable_recording = disable_recording + + def __call__(self, fn): + def _preparer_wrapper(test_class_instance, **kwargs): + self.live_test = not isinstance(test_class_instance, ReplayableTest) + self.test_class_instance = test_class_instance + + if self.live_test or test_class_instance.in_recording: + resource_name = self.random_name + if not self.live_test and isinstance(self, RecordingProcessor): + test_class_instance.recording_processors.append(self) + else: + resource_name = self.moniker + + with self.override_disable_recording(): + parameter_update = self.create_resource( + resource_name, + **kwargs + ) + + if parameter_update: + kwargs.update(parameter_update) + + trim_kwargs_from_test_function(fn, kwargs) + + try: + fn(test_class_instance, **kwargs) + finally: + # Russian Doll - the last declared resource to be deleted first. + self.remove_resource_with_record_override(resource_name, **kwargs) + + setattr(_preparer_wrapper, '__is_preparer', True) + functools.update_wrapper(_preparer_wrapper, fn) + return _preparer_wrapper + + @contextlib.contextmanager + def override_disable_recording(self): + if hasattr(self.test_class_instance, 'disable_recording'): + orig_enabled = self.test_class_instance.disable_recording + self.test_class_instance.disable_recording = self.disable_recording + yield + self.test_class_instance.disable_recording = orig_enabled + else: + yield + + @property + def moniker(self): + if not self.resource_moniker: + self.test_class_instance.test_resources_count += 1 + self.resource_moniker = '{}{:06}'.format(self.name_prefix, + self.test_class_instance.test_resources_count) + return self.resource_moniker + + def create_random_name(self): + return create_random_name(self.name_prefix, self.name_len) + + @property + def random_name(self): + if not self.resource_random_name: + self.resource_random_name = self.create_random_name() + return self.resource_random_name + + def create_resource(self, name, **kwargs): # pylint: disable=unused-argument,no-self-use + return {} + + def remove_resource(self, name, **kwargs): # pylint: disable=unused-argument + pass + + def remove_resource_with_record_override(self, name, **kwargs): + with self.override_disable_recording(): + self.remove_resource(name, **kwargs) + + +class SingleValueReplacer(RecordingProcessor): + # pylint: disable=no-member + def process_request(self, request): + from six.moves.urllib_parse import quote_plus # pylint: disable=import-error,relative-import + if self.random_name in request.uri: + request.uri = request.uri.replace(self.random_name, self.moniker) + elif quote_plus(self.random_name) in request.uri: + request.uri = request.uri.replace(quote_plus(self.random_name), + quote_plus(self.moniker)) + + if is_text_payload(request) and request.body: + body = str(request.body, 'utf-8') if isinstance(request.body, bytes) else str(request.body) + if self.random_name in body: + request.body = body.replace(self.random_name, self.moniker) + + return request + + def process_response(self, response): + if is_text_payload(response) and response['body']['string']: + response['body']['string'] = response['body']['string'].replace(self.random_name, + self.moniker) + + self.replace_header(response, 'location', self.random_name, self.moniker) + self.replace_header(response, 'azure-asyncoperation', self.random_name, self.moniker) + + return response diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py new file mode 100644 index 000000000000..cfbc6b3cfd96 --- /dev/null +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py @@ -0,0 +1,200 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from .utilities import is_text_payload, is_json_payload + + +class RecordingProcessor(object): + def process_request(self, request): # pylint: disable=no-self-use + return request + + def process_response(self, response): # pylint: disable=no-self-use + return response + + @classmethod + def replace_header(cls, entity, header, old, new): + cls.replace_header_fn(entity, header, lambda v: v.replace(old, new)) + + @classmethod + def replace_header_fn(cls, entity, header, replace_fn): + # Loop over the headers to find the one we want case insensitively, + # but we don't want to modify the case of original header key. + for key, values in entity['headers'].items(): + if key.lower() == header.lower(): + entity['headers'][key] = [replace_fn(v) for v in values] + + +class SubscriptionRecordingProcessor(RecordingProcessor): + def __init__(self, replacement): + self._replacement = replacement + + def process_request(self, request): + request.uri = self._replace_subscription_id(request.uri) + + if is_text_payload(request) and request.body: + request.body = self._replace_subscription_id(request.body.decode()).encode() + + return request + + def process_response(self, response): + if is_text_payload(response) and response['body']['string']: + response['body']['string'] = self._replace_subscription_id(response['body']['string']) + + self.replace_header_fn(response, 'location', self._replace_subscription_id) + self.replace_header_fn(response, 'azure-asyncoperation', self._replace_subscription_id) + + return response + + def _replace_subscription_id(self, val): + import re + # subscription presents in all api call + retval = re.sub('/(subscriptions)/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', + r'/\1/{}'.format(self._replacement), + val, + flags=re.IGNORECASE) + + # subscription is also used in graph call + retval = re.sub('https://(graph.windows.net)/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', + r'https://\1/{}'.format(self._replacement), + retval, + flags=re.IGNORECASE) + return retval + + +class LargeRequestBodyProcessor(RecordingProcessor): + def __init__(self, max_request_body=128): + self._max_request_body = max_request_body + + def process_request(self, request): + if is_text_payload(request) and request.body and len(request.body) > self._max_request_body * 1024: + request.body = '!!! The request body has been omitted from the recording because its ' \ + 'size {} is larger than {}KB. !!!'.format(len(request.body), + self._max_request_body) + + return request + + +class LargeResponseBodyProcessor(RecordingProcessor): + control_flag = '' + + def __init__(self, max_response_body=128): + self._max_response_body = max_response_body + + def process_response(self, response): + if is_text_payload(response): + length = len(response['body']['string'] or '') + if length > self._max_response_body * 1024: + + if is_json_payload(response): + from .decorators import AllowLargeResponse # pylint: disable=cyclic-import + raise ValueError("The json response body exceeds the default limit of {}kb. Use '@{}' " + "on your test method to increase the limit or update test logics to avoid " + "big payloads".format(self._max_response_body, AllowLargeResponse.__name__)) + + response['body']['string'] = \ + "!!! The response body has been omitted from the recording because it is larger " \ + "than {} KB. It will be replaced with blank content of {} bytes while replay. " \ + "{}{}".format(self._max_response_body, length, self.control_flag, length) + return response + + +class LargeResponseBodyReplacer(RecordingProcessor): + def process_response(self, response): + if is_text_payload(response) and not is_json_payload(response): + import six + body = response['body']['string'] + + # backward compatibility. under 2.7 response body is unicode, under 3.5 response body is + # bytes. when set the value back, the same type must be used. + body_is_string = isinstance(body, six.string_types) + + content_in_string = (response['body']['string'] or b'').decode('utf-8') + index = content_in_string.find(LargeResponseBodyProcessor.control_flag) + + if index > -1: + length = int(content_in_string[index + len(LargeResponseBodyProcessor.control_flag):]) + if body_is_string: + response['body']['string'] = '0' * length + else: + response['body']['string'] = bytes([0] * length) + + return response + + +class OAuthRequestResponsesFilter(RecordingProcessor): + """Remove oauth authentication requests and responses from recording.""" + + def process_request(self, request): + # filter request like: + # GET https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/token + # POST https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token + import re + if not re.match('https://login.microsoftonline.com/([^/]+)/oauth2(?:/v2.0)?/token', request.uri): + return request + return None + + +class DeploymentNameReplacer(RecordingProcessor): + """Replace the random deployment name with a fixed mock name.""" + + def process_request(self, request): + import re + request.uri = re.sub('/deployments/([^/?]+)', '/deployments/mock-deployment', request.uri) + return request + + +class AccessTokenReplacer(RecordingProcessor): + """Replace the access token for service principal authentication in a response body.""" + + def __init__(self, replacement='fake_token'): + self._replacement = replacement + + def process_response(self, response): + import json + try: + body = json.loads(response['body']['string']) + body['access_token'] = self._replacement + except (KeyError, ValueError): + return response + response['body']['string'] = json.dumps(body) + return response + + +class GeneralNameReplacer(RecordingProcessor): + def __init__(self): + self.names_name = [] + + def register_name_pair(self, old, new): + self.names_name.append((old, new)) + + def process_request(self, request): + for old, new in self.names_name: + request.uri = request.uri.replace(old, new) + + if is_text_payload(request) and request.body: + body = str(request.body) + if old in body: + request.body = body.replace(old, new) + + return request + + def process_response(self, response): + for old, new in self.names_name: + if is_text_payload(response) and response['body']['string']: + response['body']['string'] = response['body']['string'].replace(old, new) + + self.replace_header(response, 'location', old, new) + self.replace_header(response, 'azure-asyncoperation', old, new) + + return response + + +class RequestUrlNormalizer(RecordingProcessor): + """URL parsing fix to account for '//' vs '/' in different versions of python""" + + def process_request(self, request): + import re + request.uri = re.sub('(? length: + raise ValueError('The length of the prefix must not be longer than random name length') + + padding_size = length - len(prefix) + if padding_size < 4: + raise ValueError('The randomized part of the name is shorter than 4, which may not be able to offer enough ' + 'randomness') + + random_bytes = os.urandom(int(math.ceil(float(padding_size) / 8) * 5)) + random_padding = base64.b32encode(random_bytes)[:padding_size] + + return str(prefix + random_padding.decode().lower()) + + +def get_sha1_hash(file_path): + sha1 = hashlib.sha256() + with open(file_path, 'rb') as f: + while True: + data = f.read(65536) + if not data: + break + sha1.update(data) + + return sha1.hexdigest() + + +def _get_content_type(entity): + # 'headers' is a field of 'request', but it is a dict-key in 'response' + headers = getattr(entity, 'headers', None) + if headers is None: + headers = entity.get('headers') + + content_type = None + if headers: + content_type = headers.get('content-type', None) + if content_type: + # content-type could an array from response, let us extract it out + content_type = content_type[0] if isinstance(content_type, list) else content_type + content_type = content_type.split(";")[0].lower() + return content_type + + +def is_text_payload(entity): + text_content_list = ['application/json', 'application/xml', 'text/', 'application/test-content'] + + content_type = _get_content_type(entity) + if content_type: + return any(content_type.startswith(x) for x in text_content_list) + return True + + +def is_json_payload(entity): + return _get_content_type(entity) == 'application/json' + + +def trim_kwargs_from_test_function(fn, kwargs): + # the next function is the actual test function. the kwargs need to be trimmed so + # that parameters which are not required will not be passed to it. + if not is_preparer_func(fn): + args, _, kw, _ = inspect.getargspec(fn) # pylint: disable=deprecated-method + if kw is None: + args = set(args) + for key in [k for k in kwargs if k not in args]: + del kwargs[key] + + +def is_preparer_func(fn): + return getattr(fn, '__is_preparer', False) diff --git a/azure-sdk-tools/changelog_generics.rst b/tools/azure-sdk-tools/changelog_generics.rst similarity index 100% rename from azure-sdk-tools/changelog_generics.rst rename to tools/azure-sdk-tools/changelog_generics.rst diff --git a/tools/azure-sdk-tools/dev_requirements.txt b/tools/azure-sdk-tools/dev_requirements.txt new file mode 100644 index 000000000000..252afe5ae37a --- /dev/null +++ b/tools/azure-sdk-tools/dev_requirements.txt @@ -0,0 +1 @@ +-e ../azure-devtools \ No newline at end of file diff --git a/azure-sdk-tools/devtools_testutils/__init__.py b/tools/azure-sdk-tools/devtools_testutils/__init__.py similarity index 100% rename from azure-sdk-tools/devtools_testutils/__init__.py rename to tools/azure-sdk-tools/devtools_testutils/__init__.py diff --git a/azure-sdk-tools/devtools_testutils/config.py b/tools/azure-sdk-tools/devtools_testutils/config.py similarity index 100% rename from azure-sdk-tools/devtools_testutils/config.py rename to tools/azure-sdk-tools/devtools_testutils/config.py diff --git a/azure-sdk-tools/devtools_testutils/mgmt_settings_fake.py b/tools/azure-sdk-tools/devtools_testutils/mgmt_settings_fake.py similarity index 100% rename from azure-sdk-tools/devtools_testutils/mgmt_settings_fake.py rename to tools/azure-sdk-tools/devtools_testutils/mgmt_settings_fake.py diff --git a/azure-sdk-tools/devtools_testutils/mgmt_testcase.py b/tools/azure-sdk-tools/devtools_testutils/mgmt_testcase.py similarity index 100% rename from azure-sdk-tools/devtools_testutils/mgmt_testcase.py rename to tools/azure-sdk-tools/devtools_testutils/mgmt_testcase.py diff --git a/azure-sdk-tools/devtools_testutils/resource_testcase.py b/tools/azure-sdk-tools/devtools_testutils/resource_testcase.py similarity index 100% rename from azure-sdk-tools/devtools_testutils/resource_testcase.py rename to tools/azure-sdk-tools/devtools_testutils/resource_testcase.py diff --git a/tools/azure-sdk-tools/devtools_testutils/setup.py b/tools/azure-sdk-tools/devtools_testutils/setup.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/azure-sdk-tools/devtools_testutils/storage_testcase.py b/tools/azure-sdk-tools/devtools_testutils/storage_testcase.py similarity index 100% rename from azure-sdk-tools/devtools_testutils/storage_testcase.py rename to tools/azure-sdk-tools/devtools_testutils/storage_testcase.py diff --git a/azure-sdk-tools/packaging_tools/__init__.py b/tools/azure-sdk-tools/packaging_tools/__init__.py similarity index 100% rename from azure-sdk-tools/packaging_tools/__init__.py rename to tools/azure-sdk-tools/packaging_tools/__init__.py diff --git a/azure-sdk-tools/packaging_tools/__main__.py b/tools/azure-sdk-tools/packaging_tools/__main__.py similarity index 100% rename from azure-sdk-tools/packaging_tools/__main__.py rename to tools/azure-sdk-tools/packaging_tools/__main__.py diff --git a/azure-sdk-tools/packaging_tools/change_log.py b/tools/azure-sdk-tools/packaging_tools/change_log.py similarity index 100% rename from azure-sdk-tools/packaging_tools/change_log.py rename to tools/azure-sdk-tools/packaging_tools/change_log.py diff --git a/azure-sdk-tools/packaging_tools/code_report.py b/tools/azure-sdk-tools/packaging_tools/code_report.py similarity index 100% rename from azure-sdk-tools/packaging_tools/code_report.py rename to tools/azure-sdk-tools/packaging_tools/code_report.py diff --git a/azure-sdk-tools/packaging_tools/conf.py b/tools/azure-sdk-tools/packaging_tools/conf.py similarity index 100% rename from azure-sdk-tools/packaging_tools/conf.py rename to tools/azure-sdk-tools/packaging_tools/conf.py diff --git a/azure-sdk-tools/packaging_tools/drop_tools.py b/tools/azure-sdk-tools/packaging_tools/drop_tools.py similarity index 100% rename from azure-sdk-tools/packaging_tools/drop_tools.py rename to tools/azure-sdk-tools/packaging_tools/drop_tools.py diff --git a/azure-sdk-tools/packaging_tools/generate_package.py b/tools/azure-sdk-tools/packaging_tools/generate_package.py similarity index 100% rename from azure-sdk-tools/packaging_tools/generate_package.py rename to tools/azure-sdk-tools/packaging_tools/generate_package.py diff --git a/azure-sdk-tools/packaging_tools/pypi.py b/tools/azure-sdk-tools/packaging_tools/pypi.py similarity index 100% rename from azure-sdk-tools/packaging_tools/pypi.py rename to tools/azure-sdk-tools/packaging_tools/pypi.py diff --git a/azure-sdk-tools/packaging_tools/templates/HISTORY.rst b/tools/azure-sdk-tools/packaging_tools/templates/HISTORY.rst similarity index 100% rename from azure-sdk-tools/packaging_tools/templates/HISTORY.rst rename to tools/azure-sdk-tools/packaging_tools/templates/HISTORY.rst diff --git a/azure-sdk-tools/packaging_tools/templates/MANIFEST.in b/tools/azure-sdk-tools/packaging_tools/templates/MANIFEST.in similarity index 100% rename from azure-sdk-tools/packaging_tools/templates/MANIFEST.in rename to tools/azure-sdk-tools/packaging_tools/templates/MANIFEST.in diff --git a/azure-sdk-tools/packaging_tools/templates/README.rst b/tools/azure-sdk-tools/packaging_tools/templates/README.rst similarity index 100% rename from azure-sdk-tools/packaging_tools/templates/README.rst rename to tools/azure-sdk-tools/packaging_tools/templates/README.rst diff --git a/azure-sdk-tools/packaging_tools/templates/__init__.py b/tools/azure-sdk-tools/packaging_tools/templates/__init__.py similarity index 100% rename from azure-sdk-tools/packaging_tools/templates/__init__.py rename to tools/azure-sdk-tools/packaging_tools/templates/__init__.py diff --git a/tools/azure-sdk-tools/packaging_tools/templates/setup.cfg b/tools/azure-sdk-tools/packaging_tools/templates/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/tools/azure-sdk-tools/packaging_tools/templates/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-sdk-tools/packaging_tools/templates/setup.py b/tools/azure-sdk-tools/packaging_tools/templates/setup.py similarity index 100% rename from azure-sdk-tools/packaging_tools/templates/setup.py rename to tools/azure-sdk-tools/packaging_tools/templates/setup.py diff --git a/azure-sdk-tools/packaging_tools/update_pr.py b/tools/azure-sdk-tools/packaging_tools/update_pr.py similarity index 100% rename from azure-sdk-tools/packaging_tools/update_pr.py rename to tools/azure-sdk-tools/packaging_tools/update_pr.py diff --git a/azure-sdk-tools/packaging_tools/venvtools.py b/tools/azure-sdk-tools/packaging_tools/venvtools.py similarity index 100% rename from azure-sdk-tools/packaging_tools/venvtools.py rename to tools/azure-sdk-tools/packaging_tools/venvtools.py diff --git a/azure-sdk-tools/sdk_packaging.toml b/tools/azure-sdk-tools/sdk_packaging.toml similarity index 100% rename from azure-sdk-tools/sdk_packaging.toml rename to tools/azure-sdk-tools/sdk_packaging.toml diff --git a/azure-sdk-tools/setup.py b/tools/azure-sdk-tools/setup.py similarity index 100% rename from azure-sdk-tools/setup.py rename to tools/azure-sdk-tools/setup.py diff --git a/azure-sdk-tools/tests/test_python_sdk_tools.py b/tools/azure-sdk-tools/tests/test_python_sdk_tools.py similarity index 100% rename from azure-sdk-tools/tests/test_python_sdk_tools.py rename to tools/azure-sdk-tools/tests/test_python_sdk_tools.py