Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[AutoPR containerregistry/resource-manager] [ACR] Support Overriding …
…Task parameters, support for ContinuationToken [NEW preview API VERSION] (#5909)

* Generated from 7282ae69d0aa3259a8a074071aab9cc48006be83

Merge branch 'shahzzam/add-2019-06-01' of https://github.com/shahzzzam/azure-rest-api-specs into shahzzam/add-2019-06-01

* Generated from 701efa178e7cc3846724dbdb9c2cdf430c7009ce

address comments
  • Loading branch information
AutorestCI authored Jun 28, 2019
commit 1f5e4619d5e3a108fd305fa0be88e2240dd88a86
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._configuration import ContainerRegistryManagementClientConfiguration
from ._container_registry_management_client import ContainerRegistryManagementClient
__all__ = ['ContainerRegistryManagementClient', 'ContainerRegistryManagementClientConfiguration']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -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<msrestazure.azure_active_directory>`
: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
Original file line number Diff line number Diff line change
@@ -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_06_01_preview.operations.RegistriesOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.containerregistry.v2019_06_01_preview.operations.Operations
:ivar replications: Replications operations
:vartype replications: azure.mgmt.containerregistry.v2019_06_01_preview.operations.ReplicationsOperations
:ivar webhooks: Webhooks operations
:vartype webhooks: azure.mgmt.containerregistry.v2019_06_01_preview.operations.WebhooksOperations
:ivar runs: Runs operations
:vartype runs: azure.mgmt.containerregistry.v2019_06_01_preview.operations.RunsOperations
:ivar tasks: Tasks operations
:vartype tasks: azure.mgmt.containerregistry.v2019_06_01_preview.operations.TasksOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
: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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._container_registry_management_client_async import ContainerRegistryManagementClient
__all__ = ['ContainerRegistryManagementClient']
Original file line number Diff line number Diff line change
@@ -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.async_client import SDKClientAsync
from msrest import Serializer, Deserializer

from .._configuration import ContainerRegistryManagementClientConfiguration
from .operations_async import RegistriesOperations
from .operations_async import Operations
from .operations_async import ReplicationsOperations
from .operations_async import WebhooksOperations
from .operations_async import RunsOperations
from .operations_async import TasksOperations
from .. import models


class ContainerRegistryManagementClient(SDKClientAsync):
"""ContainerRegistryManagementClient

:ivar config: Configuration for client.
:vartype config: ContainerRegistryManagementClientConfiguration

:ivar registries: Registries operations
:vartype registries: azure.mgmt.containerregistry.v2019_06_01_preview.operations.RegistriesOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.containerregistry.v2019_06_01_preview.operations.Operations
:ivar replications: Replications operations
:vartype replications: azure.mgmt.containerregistry.v2019_06_01_preview.operations.ReplicationsOperations
:ivar webhooks: Webhooks operations
:vartype webhooks: azure.mgmt.containerregistry.v2019_06_01_preview.operations.WebhooksOperations
:ivar runs: Runs operations
:vartype runs: azure.mgmt.containerregistry.v2019_06_01_preview.operations.RunsOperations
:ivar tasks: Tasks operations
:vartype tasks: azure.mgmt.containerregistry.v2019_06_01_preview.operations.TasksOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
: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)

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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._registries_operations_async import RegistriesOperations
from ._operations_async import Operations
from ._replications_operations_async import ReplicationsOperations
from ._webhooks_operations_async import WebhooksOperations
from ._runs_operations_async import RunsOperations
from ._tasks_operations_async import TasksOperations

__all__ = [
'RegistriesOperations',
'Operations',
'ReplicationsOperations',
'WebhooksOperations',
'RunsOperations',
'TasksOperations',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# 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:
"""Operations async 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) -> None:

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<msrest:optionsforoperations>`.
:return: An iterator like instance of OperationDefinition
:rtype:
~azure.mgmt.containerregistry.v2019_06_01_preview.models.OperationDefinitionPaged[~azure.mgmt.containerregistry.v2019_06_01_preview.models.OperationDefinition]
:raises: :class:`CloudError<msrestazure.azure_exceptions.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

async def internal_paging_async(next_link=None):
request = prepare_request(next_link)

response = await self._client.async_send(request, stream=False, **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, async_command=internal_paging_async)

return deserialized
list.metadata = {'url': '/providers/Microsoft.ContainerRegistry/operations'}
Loading