Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR containerregistry/resource-manager] [ACR] Auto Build Swagger: Added identity to registry properties #3491

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# --------------------------------------------------------------------------

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
Expand All @@ -19,6 +20,7 @@
from .operation_service_specification_definition_py3 import OperationServiceSpecificationDefinition
from .operation_definition_py3 import OperationDefinition
from .sku_py3 import Sku
from .registry_identity_py3 import RegistryIdentity
from .status_py3 import Status
from .storage_account_properties_py3 import StorageAccountProperties
from .registry_py3 import Registry
Expand Down Expand Up @@ -48,6 +50,7 @@
from .event_py3 import Event
from .resource_py3 import Resource
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
Expand All @@ -57,6 +60,7 @@
from .operation_service_specification_definition import OperationServiceSpecificationDefinition
from .operation_definition import OperationDefinition
from .sku import Sku
from .registry_identity import RegistryIdentity
from .status import Status
from .storage_account_properties import StorageAccountProperties
from .registry import Registry
Expand Down Expand Up @@ -104,6 +108,7 @@
)

__all__ = [
'ImportSourceCredentials',
'ImportSource',
'ImportImageParameters',
'RegistryNameCheckRequest',
Expand All @@ -113,6 +118,7 @@
'OperationServiceSpecificationDefinition',
'OperationDefinition',
'Sku',
'RegistryIdentity',
'Status',
'StorageAccountProperties',
'Registry',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ class ImportSource(Model):
: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.
: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.
Expand All @@ -38,11 +42,13 @@ class ImportSource(Model):
_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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


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

from msrest.serialization import Model


class 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
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ class ImportSource(Model):
: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.
: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.
Expand All @@ -38,11 +42,13 @@ class ImportSource(Model):
_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, **kwargs) -> None:
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class Registry(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
:param identity: The identity of the container registry.
:type identity:
~azure.mgmt.containerregistry.v2017_10_01.models.RegistryIdentity
:ivar login_server: The URL that can be used to log into the container
registry.
:vartype login_server: str
Expand Down Expand Up @@ -75,6 +78,7 @@ class Registry(Resource):
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'sku': {'key': 'sku', 'type': 'Sku'},
'identity': {'key': 'identity', 'type': 'RegistryIdentity'},
'login_server': {'key': 'properties.loginServer', 'type': 'str'},
'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
Expand All @@ -86,6 +90,7 @@ class Registry(Resource):
def __init__(self, **kwargs):
super(Registry, self).__init__(**kwargs)
self.sku = kwargs.get('sku', None)
self.identity = kwargs.get('identity', None)
self.login_server = None
self.creation_date = None
self.provisioning_state = None
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class RegistryIdentity(Model):
"""The identity of the container registry.

:param type: The type of identity used for the registry.
:type type: str
:param principal_id: The principal ID of registry identity.
:type principal_id: str
:param tenant_id: The tenant ID associated with the registry.
:type tenant_id: str
"""

_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'principal_id': {'key': 'principalId', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
}

def __init__(self, **kwargs):
super(RegistryIdentity, self).__init__(**kwargs)
self.type = kwargs.get('type', None)
self.principal_id = kwargs.get('principal_id', None)
self.tenant_id = kwargs.get('tenant_id', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class RegistryIdentity(Model):
"""The identity of the container registry.

:param type: The type of identity used for the registry.
:type type: str
:param principal_id: The principal ID of registry identity.
:type principal_id: str
:param tenant_id: The tenant ID associated with the registry.
:type tenant_id: str
"""

_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'principal_id': {'key': 'principalId', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
}

def __init__(self, *, type: str=None, principal_id: str=None, tenant_id: str=None, **kwargs) -> None:
super(RegistryIdentity, self).__init__(**kwargs)
self.type = type
self.principal_id = principal_id
self.tenant_id = tenant_id
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class Registry(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
:param identity: The identity of the container registry.
:type identity:
~azure.mgmt.containerregistry.v2017_10_01.models.RegistryIdentity
:ivar login_server: The URL that can be used to log into the container
registry.
:vartype login_server: str
Expand Down Expand Up @@ -75,6 +78,7 @@ class Registry(Resource):
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'sku': {'key': 'sku', 'type': 'Sku'},
'identity': {'key': 'identity', 'type': 'RegistryIdentity'},
'login_server': {'key': 'properties.loginServer', 'type': 'str'},
'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
Expand All @@ -83,9 +87,10 @@ class Registry(Resource):
'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:
def __init__(self, *, location: str, sku, tags=None, identity=None, admin_user_enabled: bool=False, storage_account=None, **kwargs) -> None:
super(Registry, self).__init__(location=location, tags=tags, **kwargs)
self.sku = sku
self.identity = identity
self.login_server = None
self.creation_date = None
self.provisioning_state = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class RegistryUpdateParameters(Model):
:type tags: dict[str, str]
:param sku: The SKU of the container registry.
:type sku: ~azure.mgmt.containerregistry.v2017_10_01.models.Sku
:param identity: The identity of the container registry.
:type identity:
~azure.mgmt.containerregistry.v2017_10_01.models.RegistryIdentity
:param admin_user_enabled: The value that indicates whether the admin user
is enabled.
:type admin_user_enabled: bool
Expand All @@ -33,6 +36,7 @@ class RegistryUpdateParameters(Model):
_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'sku': {'key': 'sku', 'type': 'Sku'},
'identity': {'key': 'identity', 'type': 'RegistryIdentity'},
'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'},
}
Expand All @@ -41,5 +45,6 @@ def __init__(self, **kwargs):
super(RegistryUpdateParameters, self).__init__(**kwargs)
self.tags = kwargs.get('tags', None)
self.sku = kwargs.get('sku', None)
self.identity = kwargs.get('identity', None)
self.admin_user_enabled = kwargs.get('admin_user_enabled', None)
self.storage_account = kwargs.get('storage_account', None)
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class RegistryUpdateParameters(Model):
:type tags: dict[str, str]
:param sku: The SKU of the container registry.
:type sku: ~azure.mgmt.containerregistry.v2017_10_01.models.Sku
:param identity: The identity of the container registry.
:type identity:
~azure.mgmt.containerregistry.v2017_10_01.models.RegistryIdentity
:param admin_user_enabled: The value that indicates whether the admin user
is enabled.
:type admin_user_enabled: bool
Expand All @@ -33,13 +36,15 @@ class RegistryUpdateParameters(Model):
_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'sku': {'key': 'sku', 'type': 'Sku'},
'identity': {'key': 'identity', 'type': 'RegistryIdentity'},
'admin_user_enabled': {'key': 'properties.adminUserEnabled', 'type': 'bool'},
'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccountProperties'},
}

def __init__(self, *, tags=None, sku=None, admin_user_enabled: bool=None, storage_account=None, **kwargs) -> None:
def __init__(self, *, tags=None, sku=None, identity=None, admin_user_enabled: bool=None, storage_account=None, **kwargs) -> None:
super(RegistryUpdateParameters, self).__init__(**kwargs)
self.tags = tags
self.sku = sku
self.identity = identity
self.admin_user_enabled = admin_user_enabled
self.storage_account = storage_account
Loading