Skip to content

Commit

Permalink
Generated from 04ce66389fd67fae99ef30627fc19c928fc8118e
Browse files Browse the repository at this point in the history
Removed the Required attribute for the global parameters and corrected the ProvisioningState
  • Loading branch information
AutorestCI committed Jan 31, 2018
1 parent e85f3e5 commit 5f48352
Show file tree
Hide file tree
Showing 91 changed files with 4,374 additions and 1,222 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(

super(ContainerRegistryManagementClientConfiguration, self).__init__(base_url)

self.add_user_agent('containerregistrymanagementclient/{}'.format(VERSION))
self.add_user_agent('azure-mgmt-containerregistry/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ class OperationDefinition(Model):
}

def __init__(self, name=None, display=None):
super(OperationDefinition, self).__init__()
self.name = name
self.display = display
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class OperationDisplayDefinition(Model):
}

def __init__(self, provider=None, resource=None, operation=None, description=None):
super(OperationDisplayDefinition, self).__init__()
self.provider = provider
self.resource = resource
self.operation = operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ class RegenerateCredentialParameters(Model):
}

def __init__(self, name):
super(RegenerateCredentialParameters, self).__init__()
self.name = name
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class RegistryCreateParameters(Model):
}

def __init__(self, location, sku, storage_account, tags=None, admin_user_enabled=False):
super(RegistryCreateParameters, self).__init__()
self.tags = tags
self.location = location
self.sku = sku
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ class RegistryListCredentialsResult(Model):
}

def __init__(self, username=None, passwords=None):
super(RegistryListCredentialsResult, self).__init__()
self.username = username
self.passwords = passwords
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ class RegistryNameCheckRequest(Model):
type = "Microsoft.ContainerRegistry/registries"

def __init__(self, name):
super(RegistryNameCheckRequest, self).__init__()
self.name = name
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class RegistryNameStatus(Model):
}

def __init__(self, name_available=None, reason=None, message=None):
super(RegistryNameStatus, self).__init__()
self.name_available = name_available
self.reason = reason
self.message = message
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ class RegistryPassword(Model):
}

def __init__(self, name=None, value=None):
super(RegistryPassword, self).__init__()
self.name = name
self.value = value
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class RegistryUpdateParameters(Model):
}

def __init__(self, tags=None, admin_user_enabled=None, storage_account=None):
super(RegistryUpdateParameters, self).__init__()
self.tags = tags
self.admin_user_enabled = admin_user_enabled
self.storage_account = storage_account
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Resource(Model):
}

def __init__(self, location, tags=None):
super(Resource, self).__init__()
self.id = None
self.name = None
self.type = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ class Sku(Model):
}

def __init__(self, name):
super(Sku, self).__init__()
self.name = name
self.tier = None
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ class StorageAccountParameters(Model):
}

def __init__(self, name, access_key):
super(StorageAccountParameters, self).__init__()
self.name = name
self.access_key = access_key
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ class StorageAccountProperties(Model):
}

def __init__(self, name=None):
super(StorageAccountProperties, self).__init__()
self.name = name
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def internal_paging(next_link=None, raw=False):
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, **operation_config)
request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.exceptions import DeserializationError
from msrestazure.azure_operation import AzureOperationPoller

from .. import models
Expand Down Expand Up @@ -86,7 +87,7 @@ def check_name_availability(
# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, **operation_config)
request, header_parameters, body_content, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down Expand Up @@ -148,7 +149,7 @@ def get(

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand All @@ -166,29 +167,9 @@ def get(

return deserialized

def create(
self, resource_group_name, registry_name, registry_create_parameters, custom_headers=None, raw=False, **operation_config):
"""Creates a container registry with the specified parameters.

:param resource_group_name: The name of the resource group to which
the container registry belongs.
:type resource_group_name: str
:param registry_name: The name of the container registry.
:type registry_name: str
:param registry_create_parameters: The parameters for creating a
container registry.
:type registry_create_parameters:
~azure.mgmt.containerregistry.v2017_03_01.models.RegistryCreateParameters
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns Registry or
ClientRawResponse if raw=true
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_03_01.models.Registry]
or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
def _create_initial(
self, resource_group_name, registry_name, registry_create_parameters, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}'
path_format_arguments = {
Expand Down Expand Up @@ -216,19 +197,73 @@ def create(
body_content = self._serialize.body(registry_create_parameters, 'RegistryCreateParameters')

# Construct and send request
def long_running_send():
request = self._client.put(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)

request = self._client.put(url, query_parameters)
return self._client.send(
request, header_parameters, body_content, **operation_config)
if response.status_code not in [200, 202]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

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, **operation_config):
"""Creates a container registry with the specified parameters.
:param resource_group_name: The name of the resource group to which
the container registry belongs.
:type resource_group_name: str
:param registry_name: The name of the container registry.
:type registry_name: str
:param registry_create_parameters: The parameters for creating a
container registry.
:type registry_create_parameters:
~azure.mgmt.containerregistry.v2017_03_01.models.RegistryCreateParameters
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns Registry or
ClientRawResponse if raw=true
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_03_01.models.Registry]
or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._create_initial(
resource_group_name=resource_group_name,
registry_name=registry_name,
registry_create_parameters=registry_create_parameters,
custom_headers=custom_headers,
raw=True,
**operation_config
)
if raw:
return raw_result

# Construct and send request
def long_running_send():
return raw_result.response

def get_long_running_status(status_link, headers=None):

request = self._client.get(status_link)
if headers:
request.headers.update(headers)
header_parameters = {}
header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id']
return self._client.send(
request, header_parameters, **operation_config)
request, header_parameters, stream=False, **operation_config)

def get_long_running_output(response):

Expand All @@ -237,21 +272,14 @@ def get_long_running_output(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)
deserialized = self._deserialize('Registry', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized

if raw:
response = long_running_send()
return get_long_running_output(response)

long_running_operation_timeout = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
Expand Down Expand Up @@ -302,7 +330,7 @@ def delete(

# Construct and send request
request = self._client.delete(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200, 204]:
exp = CloudError(response)
Expand Down Expand Up @@ -365,7 +393,7 @@ def update(
# Construct and send request
request = self._client.patch(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, **operation_config)
request, header_parameters, body_content, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down Expand Up @@ -432,7 +460,7 @@ def internal_paging(next_link=None, raw=False):
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, **operation_config)
request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down Expand Up @@ -496,7 +524,7 @@ def internal_paging(next_link=None, raw=False):
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, **operation_config)
request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down Expand Up @@ -561,7 +589,7 @@ def list_credentials(

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down Expand Up @@ -637,7 +665,7 @@ def regenerate_credential(
# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, **operation_config)
request, header_parameters, body_content, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down
Loading

0 comments on commit 5f48352

Please sign in to comment.