internal static void Validate(ComposeDeploymentUpgradeDescriptionWrapper description)
        {
            Requires.Argument <string>("DeploymentName", description.DeploymentName).NotNullOrWhiteSpace();
            Requires.Argument <UpgradePolicyDescription>("UpgradePolicyDescription", description.UpgradePolicyDescription).NotNull();

            description.UpgradePolicyDescription.Validate();
        }
        internal static unsafe ComposeDeploymentUpgradeDescriptionWrapper FromNative(IntPtr descriptionPtr)
        {
            if (descriptionPtr == IntPtr.Zero)
            {
                return(null);
            }

            var castedPtr = (NativeTypes.FABRIC_COMPOSE_DEPLOYMENT_UPGRADE_DESCRIPTION *)descriptionPtr;

            // Mandatory
            if (castedPtr->UpgradePolicyDescription == IntPtr.Zero)
            {
                return(null);
            }

            RollingUpgradePolicyDescription policy = null;

            var castedPolicyPtr = (NativeTypes.FABRIC_ROLLING_UPGRADE_POLICY_DESCRIPTION *)castedPtr->UpgradePolicyDescription;

            if (castedPolicyPtr->RollingUpgradeMode == NativeTypes.FABRIC_ROLLING_UPGRADE_MODE.FABRIC_ROLLING_UPGRADE_MODE_MONITORED)
            {
                policy = MonitoredRollingApplicationUpgradePolicyDescription.FromNative(castedPtr->UpgradePolicyDescription);
            }
            else
            {
                policy = RollingUpgradePolicyDescription.FromNative(castedPtr->UpgradePolicyDescription);
            }

            var result = new ComposeDeploymentUpgradeDescriptionWrapper(
                NativeTypes.FromNativeString(castedPtr->DeploymentName),
                NativeTypes.FromNativeStringList(castedPtr->ComposeFilePaths).ToArray(),
                policy
                );

            result.ContainerRegistryUserName   = NativeTypes.FromNativeString(castedPtr->ContainerRegistryUserName);
            result.ContainerRegistryPassword   = NativeTypes.FromNativeString(castedPtr->ContainerRegistryPassword);
            result.IsRegistryPasswordEncrypted = NativeTypes.FromBOOLEAN(castedPtr->IsRegistryPasswordEncrypted);

            return(result);
        }