# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for 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 datetime
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union

from ... import _serialization

if TYPE_CHECKING:
    from .. import models as _models


class AgentProperties(_serialization.Model):
    """The properties that determine the run agent configuration.

    :ivar cpu: The CPU configuration in terms of number of cores required for the run.
    :vartype cpu: int
    """

    _attribute_map = {
        "cpu": {"key": "cpu", "type": "int"},
    }

    def __init__(self, *, cpu: Optional[int] = None, **kwargs: Any) -> None:
        """
        :keyword cpu: The CPU configuration in terms of number of cores required for the run.
        :paramtype cpu: int
        """
        super().__init__(**kwargs)
        self.cpu = cpu


class Argument(_serialization.Model):
    """The properties of a run argument.

    All required parameters must be populated in order to send to server.

    :ivar name: The name of the argument. Required.
    :vartype name: str
    :ivar value: The value of the argument. Required.
    :vartype value: str
    :ivar is_secret: Flag to indicate whether the argument represents a secret and want to be
     removed from build logs.
    :vartype 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: Any) -> None:
        """
        :keyword name: The name of the argument. Required.
        :paramtype name: str
        :keyword value: The value of the argument. Required.
        :paramtype value: str
        :keyword is_secret: Flag to indicate whether the argument represents a secret and want to be
         removed from build logs.
        :paramtype is_secret: bool
        """
        super().__init__(**kwargs)
        self.name = name
        self.value = value
        self.is_secret = is_secret


class AuthInfo(_serialization.Model):
    """The authorization properties for accessing the source code repository.

    All required parameters must be populated in order to send to server.

    :ivar token_type: The type of Auth token. Required. Known values are: "PAT" and "OAuth".
    :vartype token_type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TokenType
    :ivar token: The access token used to access the source control provider. Required.
    :vartype token: str
    :ivar refresh_token: The refresh token used to refresh the access token.
    :vartype refresh_token: str
    :ivar scope: The scope of the access token.
    :vartype scope: str
    :ivar expires_in: Time in seconds that the token remains valid.
    :vartype 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: Union[str, "_models.TokenType"],
        token: str,
        refresh_token: Optional[str] = None,
        scope: Optional[str] = None,
        expires_in: Optional[int] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword token_type: The type of Auth token. Required. Known values are: "PAT" and "OAuth".
        :paramtype token_type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TokenType
        :keyword token: The access token used to access the source control provider. Required.
        :paramtype token: str
        :keyword refresh_token: The refresh token used to refresh the access token.
        :paramtype refresh_token: str
        :keyword scope: The scope of the access token.
        :paramtype scope: str
        :keyword expires_in: Time in seconds that the token remains valid.
        :paramtype expires_in: int
        """
        super().__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(_serialization.Model):
    """The authorization properties for accessing the source code repository.

    :ivar token_type: The type of Auth token. Known values are: "PAT" and "OAuth".
    :vartype token_type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TokenType
    :ivar token: The access token used to access the source control provider.
    :vartype token: str
    :ivar refresh_token: The refresh token used to refresh the access token.
    :vartype refresh_token: str
    :ivar scope: The scope of the access token.
    :vartype scope: str
    :ivar expires_in: Time in seconds that the token remains valid.
    :vartype 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: Optional[Union[str, "_models.TokenType"]] = None,
        token: Optional[str] = None,
        refresh_token: Optional[str] = None,
        scope: Optional[str] = None,
        expires_in: Optional[int] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword token_type: The type of Auth token. Known values are: "PAT" and "OAuth".
        :paramtype token_type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TokenType
        :keyword token: The access token used to access the source control provider.
        :paramtype token: str
        :keyword refresh_token: The refresh token used to refresh the access token.
        :paramtype refresh_token: str
        :keyword scope: The scope of the access token.
        :paramtype scope: str
        :keyword expires_in: Time in seconds that the token remains valid.
        :paramtype expires_in: int
        """
        super().__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(_serialization.Model):
    """Properties that describe a base image dependency.

    :ivar type: The type of the base image dependency. Known values are: "BuildTime" and "RunTime".
    :vartype type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependencyType
    :ivar registry: The registry login server.
    :vartype registry: str
    :ivar repository: The repository name.
    :vartype repository: str
    :ivar tag: The tag name.
    :vartype tag: str
    :ivar digest: The sha256-based digest of the image manifest.
    :vartype 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: Optional[Union[str, "_models.BaseImageDependencyType"]] = None,
        registry: Optional[str] = None,
        repository: Optional[str] = None,
        tag: Optional[str] = None,
        digest: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword type: The type of the base image dependency. Known values are: "BuildTime" and
         "RunTime".
        :paramtype type: str or
         ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageDependencyType
        :keyword registry: The registry login server.
        :paramtype registry: str
        :keyword repository: The repository name.
        :paramtype repository: str
        :keyword tag: The tag name.
        :paramtype tag: str
        :keyword digest: The sha256-based digest of the image manifest.
        :paramtype digest: str
        """
        super().__init__(**kwargs)
        self.type = type
        self.registry = registry
        self.repository = repository
        self.tag = tag
        self.digest = digest


class BaseImageTrigger(_serialization.Model):
    """The trigger based on base image dependency.

    All required parameters must be populated in order to send to server.

    :ivar base_image_trigger_type: The type of the auto trigger for base image dependency updates.
     Required. Known values are: "All" and "Runtime".
    :vartype base_image_trigger_type: str or
     ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerType
    :ivar status: The current status of trigger. Known values are: "Disabled" and "Enabled".
    :vartype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus
    :ivar name: The name of the trigger. Required.
    :vartype 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: Union[str, "_models.BaseImageTriggerType"],
        name: str,
        status: Optional[Union[str, "_models.TriggerStatus"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword base_image_trigger_type: The type of the auto trigger for base image dependency
         updates. Required. Known values are: "All" and "Runtime".
        :paramtype base_image_trigger_type: str or
         ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerType
        :keyword status: The current status of trigger. Known values are: "Disabled" and "Enabled".
        :paramtype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus
        :keyword name: The name of the trigger. Required.
        :paramtype name: str
        """
        super().__init__(**kwargs)
        self.base_image_trigger_type = base_image_trigger_type
        self.status = status
        self.name = name


class BaseImageTriggerUpdateParameters(_serialization.Model):
    """The properties for updating base image dependency trigger.

    All required parameters must be populated in order to send to server.

    :ivar base_image_trigger_type: The type of the auto trigger for base image dependency updates.
     Known values are: "All" and "Runtime".
    :vartype base_image_trigger_type: str or
     ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerType
    :ivar status: The current status of trigger. Known values are: "Disabled" and "Enabled".
    :vartype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus
    :ivar name: The name of the trigger. Required.
    :vartype 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: Optional[Union[str, "_models.BaseImageTriggerType"]] = None,
        status: Optional[Union[str, "_models.TriggerStatus"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword base_image_trigger_type: The type of the auto trigger for base image dependency
         updates. Known values are: "All" and "Runtime".
        :paramtype base_image_trigger_type: str or
         ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerType
        :keyword status: The current status of trigger. Known values are: "Disabled" and "Enabled".
        :paramtype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus
        :keyword name: The name of the trigger. Required.
        :paramtype name: str
        """
        super().__init__(**kwargs)
        self.base_image_trigger_type = base_image_trigger_type
        self.status = status
        self.name = name


class Credentials(_serialization.Model):
    """The parameters that describes a set of credentials that will be used when a run is invoked.

    :ivar source_registry: Describes the credential parameters for accessing the source registry.
    :vartype source_registry:
     ~azure.mgmt.containerregistry.v2019_04_01.models.SourceRegistryCredentials
    :ivar 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.
    :vartype 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: Optional["_models.SourceRegistryCredentials"] = None,
        custom_registries: Optional[Dict[str, "_models.CustomRegistryCredentials"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword source_registry: Describes the credential parameters for accessing the source
         registry.
        :paramtype source_registry:
         ~azure.mgmt.containerregistry.v2019_04_01.models.SourceRegistryCredentials
        :keyword 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.
        :paramtype custom_registries: dict[str,
         ~azure.mgmt.containerregistry.v2019_04_01.models.CustomRegistryCredentials]
        """
        super().__init__(**kwargs)
        self.source_registry = source_registry
        self.custom_registries = custom_registries


class CustomRegistryCredentials(_serialization.Model):
    """Describes the credentials that will be used to access a custom registry during a run.

    :ivar user_name: The username for logging into the custom registry.
    :vartype user_name: ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObject
    :ivar 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.
    :vartype password: ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObject
    :ivar 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.
    :vartype 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: Optional["_models.SecretObject"] = None,
        password: Optional["_models.SecretObject"] = None,
        identity: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword user_name: The username for logging into the custom registry.
        :paramtype user_name: ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObject
        :keyword 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.
        :paramtype password: ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObject
        :keyword 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.
        :paramtype identity: str
        """
        super().__init__(**kwargs)
        self.user_name = user_name
        self.password = password
        self.identity = identity


class RunRequest(_serialization.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, EncodedTaskRunRequest, FileTaskRunRequest, TaskRunRequest

    All required parameters must be populated in order to send to server.

    :ivar type: The type of the run request. Required.
    :vartype type: str
    :ivar is_archive_enabled: The value that indicates whether archiving is enabled for the run or
     not.
    :vartype is_archive_enabled: bool
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "is_archive_enabled": {"key": "isArchiveEnabled", "type": "bool"},
    }

    _subtype_map = {
        "type": {
            "DockerBuildRequest": "DockerBuildRequest",
            "EncodedTaskRunRequest": "EncodedTaskRunRequest",
            "FileTaskRunRequest": "FileTaskRunRequest",
            "TaskRunRequest": "TaskRunRequest",
        }
    }

    def __init__(self, *, is_archive_enabled: bool = False, **kwargs: Any) -> None:
        """
        :keyword is_archive_enabled: The value that indicates whether archiving is enabled for the run
         or not.
        :paramtype is_archive_enabled: bool
        """
        super().__init__(**kwargs)
        self.type: Optional[str] = None
        self.is_archive_enabled = is_archive_enabled


class DockerBuildRequest(RunRequest):
    """The parameters for a docker quick build.

    All required parameters must be populated in order to send to server.

    :ivar type: The type of the run request. Required.
    :vartype type: str
    :ivar is_archive_enabled: The value that indicates whether archiving is enabled for the run or
     not.
    :vartype is_archive_enabled: bool
    :ivar image_names: The fully qualified image names including the repository and tag.
    :vartype image_names: list[str]
    :ivar is_push_enabled: The value of this property indicates whether the image built should be
     pushed to the registry or not.
    :vartype is_push_enabled: bool
    :ivar no_cache: The value of this property indicates whether the image cache is enabled or not.
    :vartype no_cache: bool
    :ivar docker_file_path: The Docker file path relative to the source location. Required.
    :vartype docker_file_path: str
    :ivar target: The name of the target build stage for the docker build.
    :vartype target: str
    :ivar arguments: The collection of override arguments to be used when executing the run.
    :vartype arguments: list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument]
    :ivar timeout: Run timeout in seconds.
    :vartype timeout: int
    :ivar platform: The platform properties against which the run has to happen. Required.
    :vartype platform: ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties
    :ivar agent_configuration: The machine configuration of the run agent.
    :vartype agent_configuration: ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties
    :ivar 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.
    :vartype source_location: str
    :ivar credentials: The properties that describes a set of credentials that will be used when
     this run is invoked.
    :vartype 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 = {
        "type": {"key": "type", "type": "str"},
        "is_archive_enabled": {"key": "isArchiveEnabled", "type": "bool"},
        "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: "_models.PlatformProperties",
        is_archive_enabled: bool = False,
        image_names: Optional[List[str]] = None,
        is_push_enabled: bool = True,
        no_cache: bool = False,
        target: Optional[str] = None,
        arguments: Optional[List["_models.Argument"]] = None,
        timeout: int = 3600,
        agent_configuration: Optional["_models.AgentProperties"] = None,
        source_location: Optional[str] = None,
        credentials: Optional["_models.Credentials"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword is_archive_enabled: The value that indicates whether archiving is enabled for the run
         or not.
        :paramtype is_archive_enabled: bool
        :keyword image_names: The fully qualified image names including the repository and tag.
        :paramtype image_names: list[str]
        :keyword is_push_enabled: The value of this property indicates whether the image built should
         be pushed to the registry or not.
        :paramtype is_push_enabled: bool
        :keyword no_cache: The value of this property indicates whether the image cache is enabled or
         not.
        :paramtype no_cache: bool
        :keyword docker_file_path: The Docker file path relative to the source location. Required.
        :paramtype docker_file_path: str
        :keyword target: The name of the target build stage for the docker build.
        :paramtype target: str
        :keyword arguments: The collection of override arguments to be used when executing the run.
        :paramtype arguments: list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument]
        :keyword timeout: Run timeout in seconds.
        :paramtype timeout: int
        :keyword platform: The platform properties against which the run has to happen. Required.
        :paramtype platform: ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties
        :keyword agent_configuration: The machine configuration of the run agent.
        :paramtype agent_configuration:
         ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties
        :keyword 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.
        :paramtype source_location: str
        :keyword credentials: The properties that describes a set of credentials that will be used when
         this run is invoked.
        :paramtype credentials: ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials
        """
        super().__init__(is_archive_enabled=is_archive_enabled, **kwargs)
        self.type: str = "DockerBuildRequest"
        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


class TaskStepProperties(_serialization.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, EncodedTaskStep, FileTaskStep

    Variables are only populated by the server, and will be ignored when sending a request.

    All required parameters must be populated in order to send to server.

    :ivar type: The type of the step. Required. Known values are: "Docker", "FileTask", and
     "EncodedTask".
    :vartype type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.StepType
    :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]
    :ivar context_path: The URL(absolute or relative) of the source context for the task step.
    :vartype context_path: str
    :ivar context_access_token: The token (git PAT or SAS token of storage account blob) associated
     with the context for a step.
    :vartype context_access_token: str
    """

    _validation = {
        "type": {"required": True},
        "base_image_dependencies": {"readonly": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "base_image_dependencies": {"key": "baseImageDependencies", "type": "[BaseImageDependency]"},
        "context_path": {"key": "contextPath", "type": "str"},
        "context_access_token": {"key": "contextAccessToken", "type": "str"},
    }

    _subtype_map = {"type": {"Docker": "DockerBuildStep", "EncodedTask": "EncodedTaskStep", "FileTask": "FileTaskStep"}}

    def __init__(
        self, *, context_path: Optional[str] = None, context_access_token: Optional[str] = None, **kwargs: Any
    ) -> None:
        """
        :keyword context_path: The URL(absolute or relative) of the source context for the task step.
        :paramtype context_path: str
        :keyword context_access_token: The token (git PAT or SAS token of storage account blob)
         associated with the context for a step.
        :paramtype context_access_token: str
        """
        super().__init__(**kwargs)
        self.type: Optional[str] = None
        self.base_image_dependencies = None
        self.context_path = context_path
        self.context_access_token = context_access_token


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 server.

    :ivar type: The type of the step. Required. Known values are: "Docker", "FileTask", and
     "EncodedTask".
    :vartype type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.StepType
    :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]
    :ivar context_path: The URL(absolute or relative) of the source context for the task step.
    :vartype context_path: str
    :ivar context_access_token: The token (git PAT or SAS token of storage account blob) associated
     with the context for a step.
    :vartype context_access_token: str
    :ivar image_names: The fully qualified image names including the repository and tag.
    :vartype image_names: list[str]
    :ivar is_push_enabled: The value of this property indicates whether the image built should be
     pushed to the registry or not.
    :vartype is_push_enabled: bool
    :ivar no_cache: The value of this property indicates whether the image cache is enabled or not.
    :vartype no_cache: bool
    :ivar docker_file_path: The Docker file path relative to the source context. Required.
    :vartype docker_file_path: str
    :ivar target: The name of the target build stage for the docker build.
    :vartype target: str
    :ivar arguments: The collection of override arguments to be used when executing this build
     step.
    :vartype arguments: list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument]
    """

    _validation = {
        "type": {"required": True},
        "base_image_dependencies": {"readonly": True},
        "docker_file_path": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "base_image_dependencies": {"key": "baseImageDependencies", "type": "[BaseImageDependency]"},
        "context_path": {"key": "contextPath", "type": "str"},
        "context_access_token": {"key": "contextAccessToken", "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: Optional[str] = None,
        context_access_token: Optional[str] = None,
        image_names: Optional[List[str]] = None,
        is_push_enabled: bool = True,
        no_cache: bool = False,
        target: Optional[str] = None,
        arguments: Optional[List["_models.Argument"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword context_path: The URL(absolute or relative) of the source context for the task step.
        :paramtype context_path: str
        :keyword context_access_token: The token (git PAT or SAS token of storage account blob)
         associated with the context for a step.
        :paramtype context_access_token: str
        :keyword image_names: The fully qualified image names including the repository and tag.
        :paramtype image_names: list[str]
        :keyword is_push_enabled: The value of this property indicates whether the image built should
         be pushed to the registry or not.
        :paramtype is_push_enabled: bool
        :keyword no_cache: The value of this property indicates whether the image cache is enabled or
         not.
        :paramtype no_cache: bool
        :keyword docker_file_path: The Docker file path relative to the source context. Required.
        :paramtype docker_file_path: str
        :keyword target: The name of the target build stage for the docker build.
        :paramtype target: str
        :keyword arguments: The collection of override arguments to be used when executing this build
         step.
        :paramtype arguments: list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument]
        """
        super().__init__(context_path=context_path, context_access_token=context_access_token, **kwargs)
        self.type: str = "Docker"
        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


class TaskStepUpdateParameters(_serialization.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, EncodedTaskStepUpdateParameters, FileTaskStepUpdateParameters

    All required parameters must be populated in order to send to server.

    :ivar type: The type of the step. Required. Known values are: "Docker", "FileTask", and
     "EncodedTask".
    :vartype type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.StepType
    :ivar context_path: The URL(absolute or relative) of the source context for the task step.
    :vartype context_path: str
    :ivar context_access_token: The token (git PAT or SAS token of storage account blob) associated
     with the context for a step.
    :vartype context_access_token: str
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "context_path": {"key": "contextPath", "type": "str"},
        "context_access_token": {"key": "contextAccessToken", "type": "str"},
    }

    _subtype_map = {
        "type": {
            "Docker": "DockerBuildStepUpdateParameters",
            "EncodedTask": "EncodedTaskStepUpdateParameters",
            "FileTask": "FileTaskStepUpdateParameters",
        }
    }

    def __init__(
        self, *, context_path: Optional[str] = None, context_access_token: Optional[str] = None, **kwargs: Any
    ) -> None:
        """
        :keyword context_path: The URL(absolute or relative) of the source context for the task step.
        :paramtype context_path: str
        :keyword context_access_token: The token (git PAT or SAS token of storage account blob)
         associated with the context for a step.
        :paramtype context_access_token: str
        """
        super().__init__(**kwargs)
        self.type: Optional[str] = None
        self.context_path = context_path
        self.context_access_token = context_access_token


class DockerBuildStepUpdateParameters(TaskStepUpdateParameters):
    """The properties for updating a docker build step.

    All required parameters must be populated in order to send to server.

    :ivar type: The type of the step. Required. Known values are: "Docker", "FileTask", and
     "EncodedTask".
    :vartype type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.StepType
    :ivar context_path: The URL(absolute or relative) of the source context for the task step.
    :vartype context_path: str
    :ivar context_access_token: The token (git PAT or SAS token of storage account blob) associated
     with the context for a step.
    :vartype context_access_token: str
    :ivar image_names: The fully qualified image names including the repository and tag.
    :vartype image_names: list[str]
    :ivar is_push_enabled: The value of this property indicates whether the image built should be
     pushed to the registry or not.
    :vartype is_push_enabled: bool
    :ivar no_cache: The value of this property indicates whether the image cache is enabled or not.
    :vartype no_cache: bool
    :ivar docker_file_path: The Docker file path relative to the source context.
    :vartype docker_file_path: str
    :ivar arguments: The collection of override arguments to be used when executing this build
     step.
    :vartype arguments: list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument]
    :ivar target: The name of the target build stage for the docker build.
    :vartype target: str
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "context_path": {"key": "contextPath", "type": "str"},
        "context_access_token": {"key": "contextAccessToken", "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: Optional[str] = None,
        context_access_token: Optional[str] = None,
        image_names: Optional[List[str]] = None,
        is_push_enabled: Optional[bool] = None,
        no_cache: Optional[bool] = None,
        docker_file_path: Optional[str] = None,
        arguments: Optional[List["_models.Argument"]] = None,
        target: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword context_path: The URL(absolute or relative) of the source context for the task step.
        :paramtype context_path: str
        :keyword context_access_token: The token (git PAT or SAS token of storage account blob)
         associated with the context for a step.
        :paramtype context_access_token: str
        :keyword image_names: The fully qualified image names including the repository and tag.
        :paramtype image_names: list[str]
        :keyword is_push_enabled: The value of this property indicates whether the image built should
         be pushed to the registry or not.
        :paramtype is_push_enabled: bool
        :keyword no_cache: The value of this property indicates whether the image cache is enabled or
         not.
        :paramtype no_cache: bool
        :keyword docker_file_path: The Docker file path relative to the source context.
        :paramtype docker_file_path: str
        :keyword arguments: The collection of override arguments to be used when executing this build
         step.
        :paramtype arguments: list[~azure.mgmt.containerregistry.v2019_04_01.models.Argument]
        :keyword target: The name of the target build stage for the docker build.
        :paramtype target: str
        """
        super().__init__(context_path=context_path, context_access_token=context_access_token, **kwargs)
        self.type: str = "Docker"
        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


class EncodedTaskRunRequest(RunRequest):
    """The parameters for a quick task run request.

    All required parameters must be populated in order to send to server.

    :ivar type: The type of the run request. Required.
    :vartype type: str
    :ivar is_archive_enabled: The value that indicates whether archiving is enabled for the run or
     not.
    :vartype is_archive_enabled: bool
    :ivar encoded_task_content: Base64 encoded value of the template/definition file content.
     Required.
    :vartype encoded_task_content: str
    :ivar encoded_values_content: Base64 encoded value of the parameters/values file content.
    :vartype encoded_values_content: str
    :ivar values: The collection of overridable values that can be passed when running a task.
    :vartype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
    :ivar timeout: Run timeout in seconds.
    :vartype timeout: int
    :ivar platform: The platform properties against which the run has to happen. Required.
    :vartype platform: ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties
    :ivar agent_configuration: The machine configuration of the run agent.
    :vartype agent_configuration: ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties
    :ivar 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.
    :vartype source_location: str
    :ivar credentials: The properties that describes a set of credentials that will be used when
     this run is invoked.
    :vartype 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 = {
        "type": {"key": "type", "type": "str"},
        "is_archive_enabled": {"key": "isArchiveEnabled", "type": "bool"},
        "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: "_models.PlatformProperties",
        is_archive_enabled: bool = False,
        encoded_values_content: Optional[str] = None,
        values: Optional[List["_models.SetValue"]] = None,
        timeout: int = 3600,
        agent_configuration: Optional["_models.AgentProperties"] = None,
        source_location: Optional[str] = None,
        credentials: Optional["_models.Credentials"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword is_archive_enabled: The value that indicates whether archiving is enabled for the run
         or not.
        :paramtype is_archive_enabled: bool
        :keyword encoded_task_content: Base64 encoded value of the template/definition file content.
         Required.
        :paramtype encoded_task_content: str
        :keyword encoded_values_content: Base64 encoded value of the parameters/values file content.
        :paramtype encoded_values_content: str
        :keyword values: The collection of overridable values that can be passed when running a task.
        :paramtype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
        :keyword timeout: Run timeout in seconds.
        :paramtype timeout: int
        :keyword platform: The platform properties against which the run has to happen. Required.
        :paramtype platform: ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties
        :keyword agent_configuration: The machine configuration of the run agent.
        :paramtype agent_configuration:
         ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties
        :keyword 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.
        :paramtype source_location: str
        :keyword credentials: The properties that describes a set of credentials that will be used when
         this run is invoked.
        :paramtype credentials: ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials
        """
        super().__init__(is_archive_enabled=is_archive_enabled, **kwargs)
        self.type: str = "EncodedTaskRunRequest"
        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


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 server.

    :ivar type: The type of the step. Required. Known values are: "Docker", "FileTask", and
     "EncodedTask".
    :vartype type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.StepType
    :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]
    :ivar context_path: The URL(absolute or relative) of the source context for the task step.
    :vartype context_path: str
    :ivar context_access_token: The token (git PAT or SAS token of storage account blob) associated
     with the context for a step.
    :vartype context_access_token: str
    :ivar encoded_task_content: Base64 encoded value of the template/definition file content.
     Required.
    :vartype encoded_task_content: str
    :ivar encoded_values_content: Base64 encoded value of the parameters/values file content.
    :vartype encoded_values_content: str
    :ivar values: The collection of overridable values that can be passed when running a task.
    :vartype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
    """

    _validation = {
        "type": {"required": True},
        "base_image_dependencies": {"readonly": True},
        "encoded_task_content": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "base_image_dependencies": {"key": "baseImageDependencies", "type": "[BaseImageDependency]"},
        "context_path": {"key": "contextPath", "type": "str"},
        "context_access_token": {"key": "contextAccessToken", "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: Optional[str] = None,
        context_access_token: Optional[str] = None,
        encoded_values_content: Optional[str] = None,
        values: Optional[List["_models.SetValue"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword context_path: The URL(absolute or relative) of the source context for the task step.
        :paramtype context_path: str
        :keyword context_access_token: The token (git PAT or SAS token of storage account blob)
         associated with the context for a step.
        :paramtype context_access_token: str
        :keyword encoded_task_content: Base64 encoded value of the template/definition file content.
         Required.
        :paramtype encoded_task_content: str
        :keyword encoded_values_content: Base64 encoded value of the parameters/values file content.
        :paramtype encoded_values_content: str
        :keyword values: The collection of overridable values that can be passed when running a task.
        :paramtype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
        """
        super().__init__(context_path=context_path, context_access_token=context_access_token, **kwargs)
        self.type: str = "EncodedTask"
        self.encoded_task_content = encoded_task_content
        self.encoded_values_content = encoded_values_content
        self.values = values


class EncodedTaskStepUpdateParameters(TaskStepUpdateParameters):
    """The properties for updating encoded task step.

    All required parameters must be populated in order to send to server.

    :ivar type: The type of the step. Required. Known values are: "Docker", "FileTask", and
     "EncodedTask".
    :vartype type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.StepType
    :ivar context_path: The URL(absolute or relative) of the source context for the task step.
    :vartype context_path: str
    :ivar context_access_token: The token (git PAT or SAS token of storage account blob) associated
     with the context for a step.
    :vartype context_access_token: str
    :ivar encoded_task_content: Base64 encoded value of the template/definition file content.
    :vartype encoded_task_content: str
    :ivar encoded_values_content: Base64 encoded value of the parameters/values file content.
    :vartype encoded_values_content: str
    :ivar values: The collection of overridable values that can be passed when running a task.
    :vartype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "context_path": {"key": "contextPath", "type": "str"},
        "context_access_token": {"key": "contextAccessToken", "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: Optional[str] = None,
        context_access_token: Optional[str] = None,
        encoded_task_content: Optional[str] = None,
        encoded_values_content: Optional[str] = None,
        values: Optional[List["_models.SetValue"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword context_path: The URL(absolute or relative) of the source context for the task step.
        :paramtype context_path: str
        :keyword context_access_token: The token (git PAT or SAS token of storage account blob)
         associated with the context for a step.
        :paramtype context_access_token: str
        :keyword encoded_task_content: Base64 encoded value of the template/definition file content.
        :paramtype encoded_task_content: str
        :keyword encoded_values_content: Base64 encoded value of the parameters/values file content.
        :paramtype encoded_values_content: str
        :keyword values: The collection of overridable values that can be passed when running a task.
        :paramtype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
        """
        super().__init__(context_path=context_path, context_access_token=context_access_token, **kwargs)
        self.type: str = "EncodedTask"
        self.encoded_task_content = encoded_task_content
        self.encoded_values_content = encoded_values_content
        self.values = values


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 server.

    :ivar type: The type of the run request. Required.
    :vartype type: str
    :ivar is_archive_enabled: The value that indicates whether archiving is enabled for the run or
     not.
    :vartype is_archive_enabled: bool
    :ivar task_file_path: The template/definition file path relative to the source. Required.
    :vartype task_file_path: str
    :ivar values_file_path: The values/parameters file path relative to the source.
    :vartype values_file_path: str
    :ivar values: The collection of overridable values that can be passed when running a task.
    :vartype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
    :ivar timeout: Run timeout in seconds.
    :vartype timeout: int
    :ivar platform: The platform properties against which the run has to happen. Required.
    :vartype platform: ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties
    :ivar agent_configuration: The machine configuration of the run agent.
    :vartype agent_configuration: ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties
    :ivar 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.
    :vartype source_location: str
    :ivar credentials: The properties that describes a set of credentials that will be used when
     this run is invoked.
    :vartype 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 = {
        "type": {"key": "type", "type": "str"},
        "is_archive_enabled": {"key": "isArchiveEnabled", "type": "bool"},
        "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: "_models.PlatformProperties",
        is_archive_enabled: bool = False,
        values_file_path: Optional[str] = None,
        values: Optional[List["_models.SetValue"]] = None,
        timeout: int = 3600,
        agent_configuration: Optional["_models.AgentProperties"] = None,
        source_location: Optional[str] = None,
        credentials: Optional["_models.Credentials"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword is_archive_enabled: The value that indicates whether archiving is enabled for the run
         or not.
        :paramtype is_archive_enabled: bool
        :keyword task_file_path: The template/definition file path relative to the source. Required.
        :paramtype task_file_path: str
        :keyword values_file_path: The values/parameters file path relative to the source.
        :paramtype values_file_path: str
        :keyword values: The collection of overridable values that can be passed when running a task.
        :paramtype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
        :keyword timeout: Run timeout in seconds.
        :paramtype timeout: int
        :keyword platform: The platform properties against which the run has to happen. Required.
        :paramtype platform: ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties
        :keyword agent_configuration: The machine configuration of the run agent.
        :paramtype agent_configuration:
         ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties
        :keyword 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.
        :paramtype source_location: str
        :keyword credentials: The properties that describes a set of credentials that will be used when
         this run is invoked.
        :paramtype credentials: ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials
        """
        super().__init__(is_archive_enabled=is_archive_enabled, **kwargs)
        self.type: str = "FileTaskRunRequest"
        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


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 server.

    :ivar type: The type of the step. Required. Known values are: "Docker", "FileTask", and
     "EncodedTask".
    :vartype type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.StepType
    :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]
    :ivar context_path: The URL(absolute or relative) of the source context for the task step.
    :vartype context_path: str
    :ivar context_access_token: The token (git PAT or SAS token of storage account blob) associated
     with the context for a step.
    :vartype context_access_token: str
    :ivar task_file_path: The task template/definition file path relative to the source context.
     Required.
    :vartype task_file_path: str
    :ivar values_file_path: The task values/parameters file path relative to the source context.
    :vartype values_file_path: str
    :ivar values: The collection of overridable values that can be passed when running a task.
    :vartype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
    """

    _validation = {
        "type": {"required": True},
        "base_image_dependencies": {"readonly": True},
        "task_file_path": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "base_image_dependencies": {"key": "baseImageDependencies", "type": "[BaseImageDependency]"},
        "context_path": {"key": "contextPath", "type": "str"},
        "context_access_token": {"key": "contextAccessToken", "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: Optional[str] = None,
        context_access_token: Optional[str] = None,
        values_file_path: Optional[str] = None,
        values: Optional[List["_models.SetValue"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword context_path: The URL(absolute or relative) of the source context for the task step.
        :paramtype context_path: str
        :keyword context_access_token: The token (git PAT or SAS token of storage account blob)
         associated with the context for a step.
        :paramtype context_access_token: str
        :keyword task_file_path: The task template/definition file path relative to the source context.
         Required.
        :paramtype task_file_path: str
        :keyword values_file_path: The task values/parameters file path relative to the source context.
        :paramtype values_file_path: str
        :keyword values: The collection of overridable values that can be passed when running a task.
        :paramtype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
        """
        super().__init__(context_path=context_path, context_access_token=context_access_token, **kwargs)
        self.type: str = "FileTask"
        self.task_file_path = task_file_path
        self.values_file_path = values_file_path
        self.values = values


class FileTaskStepUpdateParameters(TaskStepUpdateParameters):
    """The properties of updating a task step.

    All required parameters must be populated in order to send to server.

    :ivar type: The type of the step. Required. Known values are: "Docker", "FileTask", and
     "EncodedTask".
    :vartype type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.StepType
    :ivar context_path: The URL(absolute or relative) of the source context for the task step.
    :vartype context_path: str
    :ivar context_access_token: The token (git PAT or SAS token of storage account blob) associated
     with the context for a step.
    :vartype context_access_token: str
    :ivar task_file_path: The task template/definition file path relative to the source context.
    :vartype task_file_path: str
    :ivar values_file_path: The values/parameters file path relative to the source context.
    :vartype values_file_path: str
    :ivar values: The collection of overridable values that can be passed when running a task.
    :vartype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "context_path": {"key": "contextPath", "type": "str"},
        "context_access_token": {"key": "contextAccessToken", "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: Optional[str] = None,
        context_access_token: Optional[str] = None,
        task_file_path: Optional[str] = None,
        values_file_path: Optional[str] = None,
        values: Optional[List["_models.SetValue"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword context_path: The URL(absolute or relative) of the source context for the task step.
        :paramtype context_path: str
        :keyword context_access_token: The token (git PAT or SAS token of storage account blob)
         associated with the context for a step.
        :paramtype context_access_token: str
        :keyword task_file_path: The task template/definition file path relative to the source context.
        :paramtype task_file_path: str
        :keyword values_file_path: The values/parameters file path relative to the source context.
        :paramtype values_file_path: str
        :keyword values: The collection of overridable values that can be passed when running a task.
        :paramtype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
        """
        super().__init__(context_path=context_path, context_access_token=context_access_token, **kwargs)
        self.type: str = "FileTask"
        self.task_file_path = task_file_path
        self.values_file_path = values_file_path
        self.values = values


class IdentityProperties(_serialization.Model):
    """Managed identity for the resource.

    :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: The identity type. Known values are: "SystemAssigned", "UserAssigned",
     "SystemAssigned, UserAssigned", and "None".
    :vartype type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.ResourceIdentityType
    :ivar 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}'.
    :vartype 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": "str"},
        "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserIdentityProperties}"},
    }

    def __init__(
        self,
        *,
        principal_id: Optional[str] = None,
        tenant_id: Optional[str] = None,
        type: Optional[Union[str, "_models.ResourceIdentityType"]] = None,
        user_assigned_identities: Optional[Dict[str, "_models.UserIdentityProperties"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword principal_id: The principal ID of resource identity.
        :paramtype principal_id: str
        :keyword tenant_id: The tenant ID of resource.
        :paramtype tenant_id: str
        :keyword type: The identity type. Known values are: "SystemAssigned", "UserAssigned",
         "SystemAssigned, UserAssigned", and "None".
        :paramtype type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.ResourceIdentityType
        :keyword 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}'.
        :paramtype user_assigned_identities: dict[str,
         ~azure.mgmt.containerregistry.v2019_04_01.models.UserIdentityProperties]
        """
        super().__init__(**kwargs)
        self.principal_id = principal_id
        self.tenant_id = tenant_id
        self.type = type
        self.user_assigned_identities = user_assigned_identities


class ImageDescriptor(_serialization.Model):
    """Properties for a registry image.

    :ivar registry: The registry login server.
    :vartype registry: str
    :ivar repository: The repository name.
    :vartype repository: str
    :ivar tag: The tag name.
    :vartype tag: str
    :ivar digest: The sha256-based digest of the image manifest.
    :vartype 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: Optional[str] = None,
        repository: Optional[str] = None,
        tag: Optional[str] = None,
        digest: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword registry: The registry login server.
        :paramtype registry: str
        :keyword repository: The repository name.
        :paramtype repository: str
        :keyword tag: The tag name.
        :paramtype tag: str
        :keyword digest: The sha256-based digest of the image manifest.
        :paramtype digest: str
        """
        super().__init__(**kwargs)
        self.registry = registry
        self.repository = repository
        self.tag = tag
        self.digest = digest


class ImageUpdateTrigger(_serialization.Model):
    """The image update trigger that caused a build.

    :ivar id: The unique ID of the trigger.
    :vartype id: str
    :ivar timestamp: The timestamp when the image update happened.
    :vartype timestamp: ~datetime.datetime
    :ivar images: The list of image updates that caused the build.
    :vartype 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: Optional[str] = None,  # pylint: disable=redefined-builtin
        timestamp: Optional[datetime.datetime] = None,
        images: Optional[List["_models.ImageDescriptor"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword id: The unique ID of the trigger.
        :paramtype id: str
        :keyword timestamp: The timestamp when the image update happened.
        :paramtype timestamp: ~datetime.datetime
        :keyword images: The list of image updates that caused the build.
        :paramtype images: list[~azure.mgmt.containerregistry.v2019_04_01.models.ImageDescriptor]
        """
        super().__init__(**kwargs)
        self.id = id
        self.timestamp = timestamp
        self.images = images


class PlatformProperties(_serialization.Model):
    """The platform properties against which the run has to happen.

    All required parameters must be populated in order to send to server.

    :ivar os: The operating system type required for the run. Required. Known values are: "Windows"
     and "Linux".
    :vartype os: str or ~azure.mgmt.containerregistry.v2019_04_01.models.OS
    :ivar architecture: The OS architecture. Known values are: "amd64", "x86", and "arm".
    :vartype architecture: str or ~azure.mgmt.containerregistry.v2019_04_01.models.Architecture
    :ivar variant: Variant of the CPU. Known values are: "v6", "v7", and "v8".
    :vartype 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: Union[str, "_models.OS"],
        architecture: Optional[Union[str, "_models.Architecture"]] = None,
        variant: Optional[Union[str, "_models.Variant"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword os: The operating system type required for the run. Required. Known values are:
         "Windows" and "Linux".
        :paramtype os: str or ~azure.mgmt.containerregistry.v2019_04_01.models.OS
        :keyword architecture: The OS architecture. Known values are: "amd64", "x86", and "arm".
        :paramtype architecture: str or ~azure.mgmt.containerregistry.v2019_04_01.models.Architecture
        :keyword variant: Variant of the CPU. Known values are: "v6", "v7", and "v8".
        :paramtype variant: str or ~azure.mgmt.containerregistry.v2019_04_01.models.Variant
        """
        super().__init__(**kwargs)
        self.os = os
        self.architecture = architecture
        self.variant = variant


class PlatformUpdateParameters(_serialization.Model):
    """The properties for updating the platform configuration.

    :ivar os: The operating system type required for the run. Known values are: "Windows" and
     "Linux".
    :vartype os: str or ~azure.mgmt.containerregistry.v2019_04_01.models.OS
    :ivar architecture: The OS architecture. Known values are: "amd64", "x86", and "arm".
    :vartype architecture: str or ~azure.mgmt.containerregistry.v2019_04_01.models.Architecture
    :ivar variant: Variant of the CPU. Known values are: "v6", "v7", and "v8".
    :vartype 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: Optional[Union[str, "_models.OS"]] = None,
        architecture: Optional[Union[str, "_models.Architecture"]] = None,
        variant: Optional[Union[str, "_models.Variant"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword os: The operating system type required for the run. Known values are: "Windows" and
         "Linux".
        :paramtype os: str or ~azure.mgmt.containerregistry.v2019_04_01.models.OS
        :keyword architecture: The OS architecture. Known values are: "amd64", "x86", and "arm".
        :paramtype architecture: str or ~azure.mgmt.containerregistry.v2019_04_01.models.Architecture
        :keyword variant: Variant of the CPU. Known values are: "v6", "v7", and "v8".
        :paramtype variant: str or ~azure.mgmt.containerregistry.v2019_04_01.models.Variant
        """
        super().__init__(**kwargs)
        self.os = os
        self.architecture = architecture
        self.variant = variant


class ProxyResource(_serialization.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: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.id = None
        self.name = None
        self.type = None


class Resource(_serialization.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 server.

    :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 location: The location of the resource. This cannot be changed after the resource is
     created. Required.
    :vartype location: str
    :ivar tags: The tags of the resource.
    :vartype 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: Optional[Dict[str, str]] = None, **kwargs: Any) -> None:
        """
        :keyword location: The location of the resource. This cannot be changed after the resource is
         created. Required.
        :paramtype location: str
        :keyword tags: The tags of the resource.
        :paramtype tags: dict[str, str]
        """
        super().__init__(**kwargs)
        self.id = None
        self.name = None
        self.type = None
        self.location = location
        self.tags = tags


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
    :ivar run_id: The unique identifier for the run.
    :vartype run_id: str
    :ivar status: The current status of the run. Known values are: "Queued", "Started", "Running",
     "Succeeded", "Failed", "Canceled", "Error", and "Timeout".
    :vartype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.RunStatus
    :ivar last_updated_time: The last updated time for the run.
    :vartype last_updated_time: ~datetime.datetime
    :ivar run_type: The type of run. Known values are: "QuickBuild", "QuickRun", "AutoBuild", and
     "AutoRun".
    :vartype run_type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.RunType
    :ivar create_time: The time the run was scheduled.
    :vartype create_time: ~datetime.datetime
    :ivar start_time: The time the run started.
    :vartype start_time: ~datetime.datetime
    :ivar finish_time: The time the run finished.
    :vartype finish_time: ~datetime.datetime
    :ivar output_images: The list of all images that were generated from the run. This is
     applicable if the run generates base image dependencies.
    :vartype output_images: list[~azure.mgmt.containerregistry.v2019_04_01.models.ImageDescriptor]
    :ivar task: The task against which run was scheduled.
    :vartype task: str
    :ivar image_update_trigger: The image update trigger that caused the run. This is applicable if
     the task has base image trigger configured.
    :vartype image_update_trigger:
     ~azure.mgmt.containerregistry.v2019_04_01.models.ImageUpdateTrigger
    :ivar source_trigger: The source trigger that caused the run.
    :vartype source_trigger:
     ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerDescriptor
    :ivar platform: The platform properties against which the run will happen.
    :vartype platform: ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties
    :ivar agent_configuration: The machine configuration of the run agent.
    :vartype agent_configuration: ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties
    :ivar source_registry_auth: The scope of the credentials that were used to login to the source
     registry during this run.
    :vartype source_registry_auth: str
    :ivar custom_registries: The list of custom registries that were logged in during this run.
    :vartype 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
    :ivar provisioning_state: The provisioning state of a run. Known values are: "Creating",
     "Updating", "Deleting", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or
     ~azure.mgmt.containerregistry.v2019_04_01.models.ProvisioningState
    :ivar is_archive_enabled: The value that indicates whether archiving is enabled or not.
    :vartype is_archive_enabled: bool
    :ivar timer_trigger: The timer trigger that caused the run.
    :vartype 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: Optional[str] = None,
        status: Optional[Union[str, "_models.RunStatus"]] = None,
        last_updated_time: Optional[datetime.datetime] = None,
        run_type: Optional[Union[str, "_models.RunType"]] = None,
        create_time: Optional[datetime.datetime] = None,
        start_time: Optional[datetime.datetime] = None,
        finish_time: Optional[datetime.datetime] = None,
        output_images: Optional[List["_models.ImageDescriptor"]] = None,
        task: Optional[str] = None,
        image_update_trigger: Optional["_models.ImageUpdateTrigger"] = None,
        source_trigger: Optional["_models.SourceTriggerDescriptor"] = None,
        platform: Optional["_models.PlatformProperties"] = None,
        agent_configuration: Optional["_models.AgentProperties"] = None,
        source_registry_auth: Optional[str] = None,
        custom_registries: Optional[List[str]] = None,
        provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None,
        is_archive_enabled: bool = False,
        timer_trigger: Optional["_models.TimerTriggerDescriptor"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword run_id: The unique identifier for the run.
        :paramtype run_id: str
        :keyword status: The current status of the run. Known values are: "Queued", "Started",
         "Running", "Succeeded", "Failed", "Canceled", "Error", and "Timeout".
        :paramtype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.RunStatus
        :keyword last_updated_time: The last updated time for the run.
        :paramtype last_updated_time: ~datetime.datetime
        :keyword run_type: The type of run. Known values are: "QuickBuild", "QuickRun", "AutoBuild",
         and "AutoRun".
        :paramtype run_type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.RunType
        :keyword create_time: The time the run was scheduled.
        :paramtype create_time: ~datetime.datetime
        :keyword start_time: The time the run started.
        :paramtype start_time: ~datetime.datetime
        :keyword finish_time: The time the run finished.
        :paramtype finish_time: ~datetime.datetime
        :keyword output_images: The list of all images that were generated from the run. This is
         applicable if the run generates base image dependencies.
        :paramtype output_images:
         list[~azure.mgmt.containerregistry.v2019_04_01.models.ImageDescriptor]
        :keyword task: The task against which run was scheduled.
        :paramtype task: str
        :keyword image_update_trigger: The image update trigger that caused the run. This is applicable
         if the task has base image trigger configured.
        :paramtype image_update_trigger:
         ~azure.mgmt.containerregistry.v2019_04_01.models.ImageUpdateTrigger
        :keyword source_trigger: The source trigger that caused the run.
        :paramtype source_trigger:
         ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerDescriptor
        :keyword platform: The platform properties against which the run will happen.
        :paramtype platform: ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties
        :keyword agent_configuration: The machine configuration of the run agent.
        :paramtype agent_configuration:
         ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties
        :keyword source_registry_auth: The scope of the credentials that were used to login to the
         source registry during this run.
        :paramtype source_registry_auth: str
        :keyword custom_registries: The list of custom registries that were logged in during this run.
        :paramtype custom_registries: list[str]
        :keyword provisioning_state: The provisioning state of a run. Known values are: "Creating",
         "Updating", "Deleting", "Succeeded", "Failed", and "Canceled".
        :paramtype provisioning_state: str or
         ~azure.mgmt.containerregistry.v2019_04_01.models.ProvisioningState
        :keyword is_archive_enabled: The value that indicates whether archiving is enabled or not.
        :paramtype is_archive_enabled: bool
        :keyword timer_trigger: The timer trigger that caused the run.
        :paramtype timer_trigger:
         ~azure.mgmt.containerregistry.v2019_04_01.models.TimerTriggerDescriptor
        """
        super().__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(_serialization.Model):
    """Properties that are enabled for Odata querying on runs.

    :ivar run_id: The unique identifier for the run.
    :vartype run_id: str
    :ivar run_type: The type of run. Known values are: "QuickBuild", "QuickRun", "AutoBuild", and
     "AutoRun".
    :vartype run_type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.RunType
    :ivar status: The current status of the run. Known values are: "Queued", "Started", "Running",
     "Succeeded", "Failed", "Canceled", "Error", and "Timeout".
    :vartype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.RunStatus
    :ivar create_time: The create time for a run.
    :vartype create_time: ~datetime.datetime
    :ivar finish_time: The time the run finished.
    :vartype finish_time: ~datetime.datetime
    :ivar 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.
    :vartype output_image_manifests: str
    :ivar is_archive_enabled: The value that indicates whether archiving is enabled or not.
    :vartype is_archive_enabled: bool
    :ivar task_name: The name of the task that the run corresponds to.
    :vartype 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: Optional[str] = None,
        run_type: Optional[Union[str, "_models.RunType"]] = None,
        status: Optional[Union[str, "_models.RunStatus"]] = None,
        create_time: Optional[datetime.datetime] = None,
        finish_time: Optional[datetime.datetime] = None,
        output_image_manifests: Optional[str] = None,
        is_archive_enabled: Optional[bool] = None,
        task_name: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword run_id: The unique identifier for the run.
        :paramtype run_id: str
        :keyword run_type: The type of run. Known values are: "QuickBuild", "QuickRun", "AutoBuild",
         and "AutoRun".
        :paramtype run_type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.RunType
        :keyword status: The current status of the run. Known values are: "Queued", "Started",
         "Running", "Succeeded", "Failed", "Canceled", "Error", and "Timeout".
        :paramtype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.RunStatus
        :keyword create_time: The create time for a run.
        :paramtype create_time: ~datetime.datetime
        :keyword finish_time: The time the run finished.
        :paramtype finish_time: ~datetime.datetime
        :keyword 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.
        :paramtype output_image_manifests: str
        :keyword is_archive_enabled: The value that indicates whether archiving is enabled or not.
        :paramtype is_archive_enabled: bool
        :keyword task_name: The name of the task that the run corresponds to.
        :paramtype task_name: str
        """
        super().__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(_serialization.Model):
    """The result of get log link operation.

    :ivar log_link: The link to logs for a run on a azure container registry.
    :vartype log_link: str
    """

    _attribute_map = {
        "log_link": {"key": "logLink", "type": "str"},
    }

    def __init__(self, *, log_link: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword log_link: The link to logs for a run on a azure container registry.
        :paramtype log_link: str
        """
        super().__init__(**kwargs)
        self.log_link = log_link


class RunListResult(_serialization.Model):
    """Collection of runs.

    :ivar value: The collection value.
    :vartype value: list[~azure.mgmt.containerregistry.v2019_04_01.models.Run]
    :ivar next_link: The URI that can be used to request the next set of paged results.
    :vartype next_link: str
    """

    _attribute_map = {
        "value": {"key": "value", "type": "[Run]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(
        self, *, value: Optional[List["_models.Run"]] = None, next_link: Optional[str] = None, **kwargs: Any
    ) -> None:
        """
        :keyword value: The collection value.
        :paramtype value: list[~azure.mgmt.containerregistry.v2019_04_01.models.Run]
        :keyword next_link: The URI that can be used to request the next set of paged results.
        :paramtype next_link: str
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = next_link


class RunUpdateParameters(_serialization.Model):
    """The set of run properties that can be updated.

    :ivar is_archive_enabled: The value that indicates whether archiving is enabled or not.
    :vartype is_archive_enabled: bool
    """

    _attribute_map = {
        "is_archive_enabled": {"key": "isArchiveEnabled", "type": "bool"},
    }

    def __init__(self, *, is_archive_enabled: Optional[bool] = None, **kwargs: Any) -> None:
        """
        :keyword is_archive_enabled: The value that indicates whether archiving is enabled or not.
        :paramtype is_archive_enabled: bool
        """
        super().__init__(**kwargs)
        self.is_archive_enabled = is_archive_enabled


class SecretObject(_serialization.Model):
    """Describes the properties of a secret object value.

    :ivar 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.
    :vartype value: str
    :ivar type: The type of the secret object which determines how the value of the secret object
     has to be
     interpreted. Known values are: "Opaque" and "Vaultsecret".
    :vartype 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: Optional[str] = None,
        type: Optional[Union[str, "_models.SecretObjectType"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword 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.
        :paramtype value: str
        :keyword type: The type of the secret object which determines how the value of the secret
         object has to be
         interpreted. Known values are: "Opaque" and "Vaultsecret".
        :paramtype type: str or ~azure.mgmt.containerregistry.v2019_04_01.models.SecretObjectType
        """
        super().__init__(**kwargs)
        self.value = value
        self.type = type


class SetValue(_serialization.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 server.

    :ivar name: The name of the overridable value. Required.
    :vartype name: str
    :ivar value: The overridable value. Required.
    :vartype value: str
    :ivar is_secret: Flag to indicate whether the value represents a secret or not.
    :vartype 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: Any) -> None:
        """
        :keyword name: The name of the overridable value. Required.
        :paramtype name: str
        :keyword value: The overridable value. Required.
        :paramtype value: str
        :keyword is_secret: Flag to indicate whether the value represents a secret or not.
        :paramtype is_secret: bool
        """
        super().__init__(**kwargs)
        self.name = name
        self.value = value
        self.is_secret = is_secret


class SourceProperties(_serialization.Model):
    """The properties of the source code repository.

    All required parameters must be populated in order to send to server.

    :ivar source_control_type: The type of source control service. Required. Known values are:
     "Github" and "VisualStudioTeamService".
    :vartype source_control_type: str or
     ~azure.mgmt.containerregistry.v2019_04_01.models.SourceControlType
    :ivar repository_url: The full URL to the source code repository. Required.
    :vartype repository_url: str
    :ivar branch: The branch name of the source code.
    :vartype branch: str
    :ivar source_control_auth_properties: The authorization properties for accessing the source
     code repository and to set up
     webhooks for notifications.
    :vartype 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: Union[str, "_models.SourceControlType"],
        repository_url: str,
        branch: Optional[str] = None,
        source_control_auth_properties: Optional["_models.AuthInfo"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword source_control_type: The type of source control service. Required. Known values are:
         "Github" and "VisualStudioTeamService".
        :paramtype source_control_type: str or
         ~azure.mgmt.containerregistry.v2019_04_01.models.SourceControlType
        :keyword repository_url: The full URL to the source code repository. Required.
        :paramtype repository_url: str
        :keyword branch: The branch name of the source code.
        :paramtype branch: str
        :keyword source_control_auth_properties: The authorization properties for accessing the source
         code repository and to set up
         webhooks for notifications.
        :paramtype source_control_auth_properties:
         ~azure.mgmt.containerregistry.v2019_04_01.models.AuthInfo
        """
        super().__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(_serialization.Model):
    """Describes the credential parameters for accessing the source registry.

    :ivar 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. Known values are: "None" and "Default".
    :vartype 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: Optional[Union[str, "_models.SourceRegistryLoginMode"]] = None, **kwargs: Any
    ) -> None:
        """
        :keyword 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. Known values are: "None" and "Default".
        :paramtype login_mode: str or
         ~azure.mgmt.containerregistry.v2019_04_01.models.SourceRegistryLoginMode
        """
        super().__init__(**kwargs)
        self.login_mode = login_mode


class SourceTrigger(_serialization.Model):
    """The properties of a source based trigger.

    All required parameters must be populated in order to send to server.

    :ivar source_repository: The properties that describes the source(code) for the task. Required.
    :vartype source_repository: ~azure.mgmt.containerregistry.v2019_04_01.models.SourceProperties
    :ivar source_trigger_events: The source event corresponding to the trigger. Required.
    :vartype source_trigger_events: list[str or
     ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerEvent]
    :ivar status: The current status of trigger. Known values are: "Disabled" and "Enabled".
    :vartype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus
    :ivar name: The name of the trigger. Required.
    :vartype 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: "_models.SourceProperties",
        source_trigger_events: List[Union[str, "_models.SourceTriggerEvent"]],
        name: str,
        status: Optional[Union[str, "_models.TriggerStatus"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword source_repository: The properties that describes the source(code) for the task.
         Required.
        :paramtype source_repository: ~azure.mgmt.containerregistry.v2019_04_01.models.SourceProperties
        :keyword source_trigger_events: The source event corresponding to the trigger. Required.
        :paramtype source_trigger_events: list[str or
         ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerEvent]
        :keyword status: The current status of trigger. Known values are: "Disabled" and "Enabled".
        :paramtype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus
        :keyword name: The name of the trigger. Required.
        :paramtype name: str
        """
        super().__init__(**kwargs)
        self.source_repository = source_repository
        self.source_trigger_events = source_trigger_events
        self.status = status
        self.name = name


class SourceTriggerDescriptor(_serialization.Model):
    """The source trigger that caused a run.

    :ivar id: The unique ID of the trigger.
    :vartype id: str
    :ivar event_type: The event type of the trigger.
    :vartype event_type: str
    :ivar commit_id: The unique ID that identifies a commit.
    :vartype commit_id: str
    :ivar pull_request_id: The unique ID that identifies pull request.
    :vartype pull_request_id: str
    :ivar repository_url: The repository URL.
    :vartype repository_url: str
    :ivar branch_name: The branch name in the repository.
    :vartype branch_name: str
    :ivar provider_type: The source control provider type.
    :vartype 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: Optional[str] = None,  # pylint: disable=redefined-builtin
        event_type: Optional[str] = None,
        commit_id: Optional[str] = None,
        pull_request_id: Optional[str] = None,
        repository_url: Optional[str] = None,
        branch_name: Optional[str] = None,
        provider_type: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword id: The unique ID of the trigger.
        :paramtype id: str
        :keyword event_type: The event type of the trigger.
        :paramtype event_type: str
        :keyword commit_id: The unique ID that identifies a commit.
        :paramtype commit_id: str
        :keyword pull_request_id: The unique ID that identifies pull request.
        :paramtype pull_request_id: str
        :keyword repository_url: The repository URL.
        :paramtype repository_url: str
        :keyword branch_name: The branch name in the repository.
        :paramtype branch_name: str
        :keyword provider_type: The source control provider type.
        :paramtype provider_type: str
        """
        super().__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(_serialization.Model):
    """The properties for updating a source based trigger.

    All required parameters must be populated in order to send to server.

    :ivar source_repository: The properties that describes the source(code) for the task.
    :vartype source_repository:
     ~azure.mgmt.containerregistry.v2019_04_01.models.SourceUpdateParameters
    :ivar source_trigger_events: The source event corresponding to the trigger.
    :vartype source_trigger_events: list[str or
     ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerEvent]
    :ivar status: The current status of trigger. Known values are: "Disabled" and "Enabled".
    :vartype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus
    :ivar name: The name of the trigger. Required.
    :vartype 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: Optional["_models.SourceUpdateParameters"] = None,
        source_trigger_events: Optional[List[Union[str, "_models.SourceTriggerEvent"]]] = None,
        status: Optional[Union[str, "_models.TriggerStatus"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword source_repository: The properties that describes the source(code) for the task.
        :paramtype source_repository:
         ~azure.mgmt.containerregistry.v2019_04_01.models.SourceUpdateParameters
        :keyword source_trigger_events: The source event corresponding to the trigger.
        :paramtype source_trigger_events: list[str or
         ~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerEvent]
        :keyword status: The current status of trigger. Known values are: "Disabled" and "Enabled".
        :paramtype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus
        :keyword name: The name of the trigger. Required.
        :paramtype name: str
        """
        super().__init__(**kwargs)
        self.source_repository = source_repository
        self.source_trigger_events = source_trigger_events
        self.status = status
        self.name = name


class SourceUpdateParameters(_serialization.Model):
    """The properties for updating the source code repository.

    :ivar source_control_type: The type of source control service. Known values are: "Github" and
     "VisualStudioTeamService".
    :vartype source_control_type: str or
     ~azure.mgmt.containerregistry.v2019_04_01.models.SourceControlType
    :ivar repository_url: The full URL to the source code repository.
    :vartype repository_url: str
    :ivar branch: The branch name of the source code.
    :vartype branch: str
    :ivar source_control_auth_properties: The authorization properties for accessing the source
     code repository and to set up
     webhooks for notifications.
    :vartype 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: Optional[Union[str, "_models.SourceControlType"]] = None,
        repository_url: Optional[str] = None,
        branch: Optional[str] = None,
        source_control_auth_properties: Optional["_models.AuthInfoUpdateParameters"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword source_control_type: The type of source control service. Known values are: "Github"
         and "VisualStudioTeamService".
        :paramtype source_control_type: str or
         ~azure.mgmt.containerregistry.v2019_04_01.models.SourceControlType
        :keyword repository_url: The full URL to the source code repository.
        :paramtype repository_url: str
        :keyword branch: The branch name of the source code.
        :paramtype branch: str
        :keyword source_control_auth_properties: The authorization properties for accessing the source
         code repository and to set up
         webhooks for notifications.
        :paramtype source_control_auth_properties:
         ~azure.mgmt.containerregistry.v2019_04_01.models.AuthInfoUpdateParameters
        """
        super().__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(_serialization.Model):
    """The properties of a response to source upload request.

    :ivar upload_url: The URL where the client can upload the source.
    :vartype upload_url: str
    :ivar relative_path: The relative path to the source. This is used to submit the subsequent
     queue build request.
    :vartype relative_path: str
    """

    _attribute_map = {
        "upload_url": {"key": "uploadUrl", "type": "str"},
        "relative_path": {"key": "relativePath", "type": "str"},
    }

    def __init__(self, *, upload_url: Optional[str] = None, relative_path: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword upload_url: The URL where the client can upload the source.
        :paramtype upload_url: str
        :keyword relative_path: The relative path to the source. This is used to submit the subsequent
         queue build request.
        :paramtype relative_path: str
        """
        super().__init__(**kwargs)
        self.upload_url = upload_url
        self.relative_path = relative_path


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 server.

    :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 location: The location of the resource. This cannot be changed after the resource is
     created. Required.
    :vartype location: str
    :ivar tags: The tags of the resource.
    :vartype tags: dict[str, str]
    :ivar identity: Identity for the resource.
    :vartype identity: ~azure.mgmt.containerregistry.v2019_04_01.models.IdentityProperties
    :ivar provisioning_state: The provisioning state of the task. Known values are: "Creating",
     "Updating", "Deleting", "Succeeded", "Failed", and "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.datetime
    :ivar status: The current status of task. Known values are: "Disabled" and "Enabled".
    :vartype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStatus
    :ivar platform: The platform properties against which the run has to happen.
    :vartype platform: ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties
    :ivar agent_configuration: The machine configuration of the run agent.
    :vartype agent_configuration: ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties
    :ivar timeout: Run timeout in seconds.
    :vartype timeout: int
    :ivar step: The properties of a task step.
    :vartype step: ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStepProperties
    :ivar trigger: The properties that describe all triggers for the task.
    :vartype trigger: ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerProperties
    :ivar credentials: The properties that describes a set of credentials that will be used when
     this run is invoked.
    :vartype 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},
        "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}"},
        "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,
        tags: Optional[Dict[str, str]] = None,
        identity: Optional["_models.IdentityProperties"] = None,
        status: Optional[Union[str, "_models.TaskStatus"]] = None,
        platform: Optional["_models.PlatformProperties"] = None,
        agent_configuration: Optional["_models.AgentProperties"] = None,
        timeout: int = 3600,
        step: Optional["_models.TaskStepProperties"] = None,
        trigger: Optional["_models.TriggerProperties"] = None,
        credentials: Optional["_models.Credentials"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword location: The location of the resource. This cannot be changed after the resource is
         created. Required.
        :paramtype location: str
        :keyword tags: The tags of the resource.
        :paramtype tags: dict[str, str]
        :keyword identity: Identity for the resource.
        :paramtype identity: ~azure.mgmt.containerregistry.v2019_04_01.models.IdentityProperties
        :keyword status: The current status of task. Known values are: "Disabled" and "Enabled".
        :paramtype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStatus
        :keyword platform: The platform properties against which the run has to happen.
        :paramtype platform: ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformProperties
        :keyword agent_configuration: The machine configuration of the run agent.
        :paramtype agent_configuration:
         ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties
        :keyword timeout: Run timeout in seconds.
        :paramtype timeout: int
        :keyword step: The properties of a task step.
        :paramtype step: ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStepProperties
        :keyword trigger: The properties that describe all triggers for the task.
        :paramtype trigger: ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerProperties
        :keyword credentials: The properties that describes a set of credentials that will be used when
         this run is invoked.
        :paramtype credentials: ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials
        """
        super().__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 TaskListResult(_serialization.Model):
    """The collection of tasks.

    :ivar value: The collection value.
    :vartype value: list[~azure.mgmt.containerregistry.v2019_04_01.models.Task]
    :ivar next_link: The URI that can be used to request the next set of paged results.
    :vartype next_link: str
    """

    _attribute_map = {
        "value": {"key": "value", "type": "[Task]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(
        self, *, value: Optional[List["_models.Task"]] = None, next_link: Optional[str] = None, **kwargs: Any
    ) -> None:
        """
        :keyword value: The collection value.
        :paramtype value: list[~azure.mgmt.containerregistry.v2019_04_01.models.Task]
        :keyword next_link: The URI that can be used to request the next set of paged results.
        :paramtype next_link: str
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = next_link


class TaskRunRequest(RunRequest):
    """The parameters for a task run request.

    All required parameters must be populated in order to send to server.

    :ivar type: The type of the run request. Required.
    :vartype type: str
    :ivar is_archive_enabled: The value that indicates whether archiving is enabled for the run or
     not.
    :vartype is_archive_enabled: bool
    :ivar task_name: The name of task against which run has to be queued. Required.
    :vartype task_name: str
    :ivar values: The collection of overridable values that can be passed when running a task.
    :vartype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
    """

    _validation = {
        "type": {"required": True},
        "task_name": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "is_archive_enabled": {"key": "isArchiveEnabled", "type": "bool"},
        "task_name": {"key": "taskName", "type": "str"},
        "values": {"key": "values", "type": "[SetValue]"},
    }

    def __init__(
        self,
        *,
        task_name: str,
        is_archive_enabled: bool = False,
        values: Optional[List["_models.SetValue"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword is_archive_enabled: The value that indicates whether archiving is enabled for the run
         or not.
        :paramtype is_archive_enabled: bool
        :keyword task_name: The name of task against which run has to be queued. Required.
        :paramtype task_name: str
        :keyword values: The collection of overridable values that can be passed when running a task.
        :paramtype values: list[~azure.mgmt.containerregistry.v2019_04_01.models.SetValue]
        """
        super().__init__(is_archive_enabled=is_archive_enabled, **kwargs)
        self.type: str = "TaskRunRequest"
        self.task_name = task_name
        self.values = values


class TaskUpdateParameters(_serialization.Model):
    """The parameters for updating a task.

    :ivar identity: Identity for the resource.
    :vartype identity: ~azure.mgmt.containerregistry.v2019_04_01.models.IdentityProperties
    :ivar tags: The ARM resource tags.
    :vartype tags: dict[str, str]
    :ivar status: The current status of task. Known values are: "Disabled" and "Enabled".
    :vartype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStatus
    :ivar platform: The platform properties against which the run has to happen.
    :vartype platform: ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformUpdateParameters
    :ivar agent_configuration: The machine configuration of the run agent.
    :vartype agent_configuration: ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties
    :ivar timeout: Run timeout in seconds.
    :vartype timeout: int
    :ivar step: The properties for updating a task step.
    :vartype step: ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStepUpdateParameters
    :ivar trigger: The properties for updating trigger properties.
    :vartype trigger: ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerUpdateParameters
    :ivar credentials: The parameters that describes a set of credentials that will be used when
     this run is invoked.
    :vartype credentials: ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials
    """

    _attribute_map = {
        "identity": {"key": "identity", "type": "IdentityProperties"},
        "tags": {"key": "tags", "type": "{str}"},
        "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"},
    }

    def __init__(
        self,
        *,
        identity: Optional["_models.IdentityProperties"] = None,
        tags: Optional[Dict[str, str]] = None,
        status: Optional[Union[str, "_models.TaskStatus"]] = None,
        platform: Optional["_models.PlatformUpdateParameters"] = None,
        agent_configuration: Optional["_models.AgentProperties"] = None,
        timeout: Optional[int] = None,
        step: Optional["_models.TaskStepUpdateParameters"] = None,
        trigger: Optional["_models.TriggerUpdateParameters"] = None,
        credentials: Optional["_models.Credentials"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword identity: Identity for the resource.
        :paramtype identity: ~azure.mgmt.containerregistry.v2019_04_01.models.IdentityProperties
        :keyword tags: The ARM resource tags.
        :paramtype tags: dict[str, str]
        :keyword status: The current status of task. Known values are: "Disabled" and "Enabled".
        :paramtype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStatus
        :keyword platform: The platform properties against which the run has to happen.
        :paramtype platform: ~azure.mgmt.containerregistry.v2019_04_01.models.PlatformUpdateParameters
        :keyword agent_configuration: The machine configuration of the run agent.
        :paramtype agent_configuration:
         ~azure.mgmt.containerregistry.v2019_04_01.models.AgentProperties
        :keyword timeout: Run timeout in seconds.
        :paramtype timeout: int
        :keyword step: The properties for updating a task step.
        :paramtype step: ~azure.mgmt.containerregistry.v2019_04_01.models.TaskStepUpdateParameters
        :keyword trigger: The properties for updating trigger properties.
        :paramtype trigger: ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerUpdateParameters
        :keyword credentials: The parameters that describes a set of credentials that will be used when
         this run is invoked.
        :paramtype credentials: ~azure.mgmt.containerregistry.v2019_04_01.models.Credentials
        """
        super().__init__(**kwargs)
        self.identity = identity
        self.tags = tags
        self.status = status
        self.platform = platform
        self.agent_configuration = agent_configuration
        self.timeout = timeout
        self.step = step
        self.trigger = trigger
        self.credentials = credentials


class TimerTrigger(_serialization.Model):
    """The properties of a timer trigger.

    All required parameters must be populated in order to send to server.

    :ivar schedule: The CRON expression for the task schedule. Required.
    :vartype schedule: str
    :ivar status: The current status of trigger. Known values are: "Disabled" and "Enabled".
    :vartype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus
    :ivar name: The name of the trigger. Required.
    :vartype 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: Optional[Union[str, "_models.TriggerStatus"]] = None, **kwargs: Any
    ) -> None:
        """
        :keyword schedule: The CRON expression for the task schedule. Required.
        :paramtype schedule: str
        :keyword status: The current status of trigger. Known values are: "Disabled" and "Enabled".
        :paramtype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus
        :keyword name: The name of the trigger. Required.
        :paramtype name: str
        """
        super().__init__(**kwargs)
        self.schedule = schedule
        self.status = status
        self.name = name


class TimerTriggerDescriptor(_serialization.Model):
    """TimerTriggerDescriptor.

    :ivar timer_trigger_name: The timer trigger name that caused the run.
    :vartype timer_trigger_name: str
    :ivar schedule_occurrence: The occurrence that triggered the run.
    :vartype schedule_occurrence: str
    """

    _attribute_map = {
        "timer_trigger_name": {"key": "timerTriggerName", "type": "str"},
        "schedule_occurrence": {"key": "scheduleOccurrence", "type": "str"},
    }

    def __init__(
        self, *, timer_trigger_name: Optional[str] = None, schedule_occurrence: Optional[str] = None, **kwargs: Any
    ) -> None:
        """
        :keyword timer_trigger_name: The timer trigger name that caused the run.
        :paramtype timer_trigger_name: str
        :keyword schedule_occurrence: The occurrence that triggered the run.
        :paramtype schedule_occurrence: str
        """
        super().__init__(**kwargs)
        self.timer_trigger_name = timer_trigger_name
        self.schedule_occurrence = schedule_occurrence


class TimerTriggerUpdateParameters(_serialization.Model):
    """The properties for updating a timer trigger.

    All required parameters must be populated in order to send to server.

    :ivar schedule: The CRON expression for the task schedule.
    :vartype schedule: str
    :ivar status: The current status of trigger. Known values are: "Disabled" and "Enabled".
    :vartype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus
    :ivar name: The name of the trigger. Required.
    :vartype 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: Optional[str] = None,
        status: Optional[Union[str, "_models.TriggerStatus"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword schedule: The CRON expression for the task schedule.
        :paramtype schedule: str
        :keyword status: The current status of trigger. Known values are: "Disabled" and "Enabled".
        :paramtype status: str or ~azure.mgmt.containerregistry.v2019_04_01.models.TriggerStatus
        :keyword name: The name of the trigger. Required.
        :paramtype name: str
        """
        super().__init__(**kwargs)
        self.schedule = schedule
        self.status = status
        self.name = name


class TriggerProperties(_serialization.Model):
    """The properties of a trigger.

    :ivar timer_triggers: The collection of timer triggers.
    :vartype timer_triggers: list[~azure.mgmt.containerregistry.v2019_04_01.models.TimerTrigger]
    :ivar source_triggers: The collection of triggers based on source code repository.
    :vartype source_triggers: list[~azure.mgmt.containerregistry.v2019_04_01.models.SourceTrigger]
    :ivar base_image_trigger: The trigger based on base image dependencies.
    :vartype 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: Optional[List["_models.TimerTrigger"]] = None,
        source_triggers: Optional[List["_models.SourceTrigger"]] = None,
        base_image_trigger: Optional["_models.BaseImageTrigger"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword timer_triggers: The collection of timer triggers.
        :paramtype timer_triggers: list[~azure.mgmt.containerregistry.v2019_04_01.models.TimerTrigger]
        :keyword source_triggers: The collection of triggers based on source code repository.
        :paramtype source_triggers:
         list[~azure.mgmt.containerregistry.v2019_04_01.models.SourceTrigger]
        :keyword base_image_trigger: The trigger based on base image dependencies.
        :paramtype base_image_trigger:
         ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTrigger
        """
        super().__init__(**kwargs)
        self.timer_triggers = timer_triggers
        self.source_triggers = source_triggers
        self.base_image_trigger = base_image_trigger


class TriggerUpdateParameters(_serialization.Model):
    """The properties for updating triggers.

    :ivar timer_triggers: The collection of timer triggers.
    :vartype timer_triggers:
     list[~azure.mgmt.containerregistry.v2019_04_01.models.TimerTriggerUpdateParameters]
    :ivar source_triggers: The collection of triggers based on source code repository.
    :vartype source_triggers:
     list[~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerUpdateParameters]
    :ivar base_image_trigger: The trigger based on base image dependencies.
    :vartype 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: Optional[List["_models.TimerTriggerUpdateParameters"]] = None,
        source_triggers: Optional[List["_models.SourceTriggerUpdateParameters"]] = None,
        base_image_trigger: Optional["_models.BaseImageTriggerUpdateParameters"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword timer_triggers: The collection of timer triggers.
        :paramtype timer_triggers:
         list[~azure.mgmt.containerregistry.v2019_04_01.models.TimerTriggerUpdateParameters]
        :keyword source_triggers: The collection of triggers based on source code repository.
        :paramtype source_triggers:
         list[~azure.mgmt.containerregistry.v2019_04_01.models.SourceTriggerUpdateParameters]
        :keyword base_image_trigger: The trigger based on base image dependencies.
        :paramtype base_image_trigger:
         ~azure.mgmt.containerregistry.v2019_04_01.models.BaseImageTriggerUpdateParameters
        """
        super().__init__(**kwargs)
        self.timer_triggers = timer_triggers
        self.source_triggers = source_triggers
        self.base_image_trigger = base_image_trigger


class UserIdentityProperties(_serialization.Model):
    """UserIdentityProperties.

    :ivar principal_id: The principal id of user assigned identity.
    :vartype principal_id: str
    :ivar client_id: The client id of user assigned identity.
    :vartype client_id: str
    """

    _attribute_map = {
        "principal_id": {"key": "principalId", "type": "str"},
        "client_id": {"key": "clientId", "type": "str"},
    }

    def __init__(self, *, principal_id: Optional[str] = None, client_id: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword principal_id: The principal id of user assigned identity.
        :paramtype principal_id: str
        :keyword client_id: The client id of user assigned identity.
        :paramtype client_id: str
        """
        super().__init__(**kwargs)
        self.principal_id = principal_id
        self.client_id = client_id
