Exemplo n.º 1
0
        public bool Equals(S3Settings other)
        {
            if (other == null)
            {
                return(false);
            }

            if (WasEnabled(other))
            {
                return(true);
            }

            if (other.AwsRegionName != AwsRegionName)
            {
                return(false);
            }

            if (other.BucketName != BucketName)
            {
                return(false);
            }

            if (other.RemoteFolderName != RemoteFolderName)
            {
                return(false);
            }

            if (other.CustomServerUrl != CustomServerUrl)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
 public virtual DynamicJsonValue ToJson()
 {
     return(new DynamicJsonValue
     {
         [nameof(BackupType)] = BackupType,
         [nameof(SnapshotSettings)] = SnapshotSettings?.ToJson(),
         [nameof(BackupEncryptionSettings)] = BackupEncryptionSettings?.ToJson(),
         [nameof(LocalSettings)] = LocalSettings?.ToJson(),
         [nameof(S3Settings)] = S3Settings?.ToJson(),
         [nameof(GlacierSettings)] = GlacierSettings?.ToJson(),
         [nameof(AzureSettings)] = AzureSettings?.ToJson(),
         [nameof(GoogleCloudSettings)] = GoogleCloudSettings?.ToJson(),
         [nameof(FtpSettings)] = FtpSettings?.ToJson()
     });
 }
Exemplo n.º 3
0
 public DynamicJsonValue ToJson()
 {
     return(new DynamicJsonValue
     {
         [nameof(TaskId)] = TaskId,
         [nameof(Disabled)] = Disabled,
         [nameof(Name)] = Name,
         [nameof(MentorNode)] = MentorNode,
         [nameof(BackupType)] = BackupType,
         [nameof(BackupEncryptionSettings)] = BackupEncryptionSettings?.ToJson(),
         [nameof(RetentionPolicy)] = RetentionPolicy?.ToJson(),
         [nameof(FullBackupFrequency)] = FullBackupFrequency,
         [nameof(IncrementalBackupFrequency)] = IncrementalBackupFrequency,
         [nameof(LocalSettings)] = LocalSettings?.ToJson(),
         [nameof(S3Settings)] = S3Settings?.ToJson(),
         [nameof(GlacierSettings)] = GlacierSettings?.ToJson(),
         [nameof(AzureSettings)] = AzureSettings?.ToJson(),
         [nameof(GoogleCloudSettings)] = GoogleCloudSettings?.ToJson(),
         [nameof(FtpSettings)] = FtpSettings?.ToJson()
     });
 }
Exemplo n.º 4
0
        internal S3Settings(S3Settings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            BucketName      = settings.BucketName;
            CustomServerUrl = settings.CustomServerUrl;
            AwsRegionName   = settings.AwsRegionName;
            AwsAccessKey    = settings.AwsAccessKey;
            AwsSecretKey    = settings.AwsSecretKey;
            AwsSessionToken = settings.AwsSessionToken;

            RemoteFolderName = settings.RemoteFolderName;
            Disabled         = settings.Disabled;

            if (settings.GetBackupConfigurationScript != null)
            {
                GetBackupConfigurationScript = new GetBackupConfigurationScript(settings.GetBackupConfigurationScript);
            }
        }