// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.recoveryservicessiterecovery.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.time.OffsetDateTime;
import java.util.List;

/** InMageRcmFailback provider specific details. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "instanceType")
@JsonTypeName("InMageRcmFailback")
@Fluent
public final class InMageRcmFailbackReplicationDetails extends ReplicationProviderSpecificSettings {
    /*
     * The virtual machine internal identifier.
     */
    @JsonProperty(value = "internalIdentifier", access = JsonProperty.Access.WRITE_ONLY)
    private String internalIdentifier;

    /*
     * The ARM Id of the azure VM.
     */
    @JsonProperty(value = "azureVirtualMachineId", access = JsonProperty.Access.WRITE_ONLY)
    private String azureVirtualMachineId;

    /*
     * The multi VM group name.
     */
    @JsonProperty(value = "multiVmGroupName", access = JsonProperty.Access.WRITE_ONLY)
    private String multiVmGroupName;

    /*
     * The reprotect agent Id.
     */
    @JsonProperty(value = "reprotectAgentId", access = JsonProperty.Access.WRITE_ONLY)
    private String reprotectAgentId;

    /*
     * The reprotect agent name.
     */
    @JsonProperty(value = "reprotectAgentName", access = JsonProperty.Access.WRITE_ONLY)
    private String reprotectAgentName;

    /*
     * The type of the OS on the VM.
     */
    @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY)
    private String osType;

    /*
     * The log storage account ARM Id.
     */
    @JsonProperty(value = "logStorageAccountId", access = JsonProperty.Access.WRITE_ONLY)
    private String logStorageAccountId;

    /*
     * The target vCenter Id.
     */
    @JsonProperty(value = "targetvCenterId", access = JsonProperty.Access.WRITE_ONLY)
    private String targetvCenterId;

    /*
     * The target datastore name.
     */
    @JsonProperty(value = "targetDataStoreName", access = JsonProperty.Access.WRITE_ONLY)
    private String targetDataStoreName;

    /*
     * The target VM name.
     */
    @JsonProperty(value = "targetVmName", access = JsonProperty.Access.WRITE_ONLY)
    private String targetVmName;

    /*
     * The initial replication progress percentage.
     */
    @JsonProperty(value = "initialReplicationProgressPercentage", access = JsonProperty.Access.WRITE_ONLY)
    private Integer initialReplicationProgressPercentage;

    /*
     * The initial replication processed bytes. This includes sum of total bytes transferred and matched bytes on all
     * selected disks in source VM.
     */
    @JsonProperty(value = "initialReplicationProcessedBytes", access = JsonProperty.Access.WRITE_ONLY)
    private Long initialReplicationProcessedBytes;

    /*
     * The initial replication transferred bytes from source VM to target for all selected disks on source VM.
     */
    @JsonProperty(value = "initialReplicationTransferredBytes", access = JsonProperty.Access.WRITE_ONLY)
    private Long initialReplicationTransferredBytes;

    /*
     * The initial replication progress health.
     */
    @JsonProperty(value = "initialReplicationProgressHealth", access = JsonProperty.Access.WRITE_ONLY)
    private VmReplicationProgressHealth initialReplicationProgressHealth;

    /*
     * The resync progress percentage.
     */
    @JsonProperty(value = "resyncProgressPercentage", access = JsonProperty.Access.WRITE_ONLY)
    private Integer resyncProgressPercentage;

    /*
     * The resync processed bytes. This includes sum of total bytes transferred and matched bytes on all selected disks
     * in source VM.
     */
    @JsonProperty(value = "resyncProcessedBytes", access = JsonProperty.Access.WRITE_ONLY)
    private Long resyncProcessedBytes;

    /*
     * The resync transferred bytes from source VM to target for all selected disks on source VM.
     */
    @JsonProperty(value = "resyncTransferredBytes", access = JsonProperty.Access.WRITE_ONLY)
    private Long resyncTransferredBytes;

    /*
     * The resync progress health.
     */
    @JsonProperty(value = "resyncProgressHealth", access = JsonProperty.Access.WRITE_ONLY)
    private VmReplicationProgressHealth resyncProgressHealth;

    /*
     * A value indicating whether resync is required.
     */
    @JsonProperty(value = "resyncRequired", access = JsonProperty.Access.WRITE_ONLY)
    private String resyncRequired;

    /*
     * The resync state.
     */
    @JsonProperty(value = "resyncState", access = JsonProperty.Access.WRITE_ONLY)
    private ResyncState resyncState;

    /*
     * The list of protected disks.
     */
    @JsonProperty(value = "protectedDisks")
    private List<InMageRcmFailbackProtectedDiskDetails> protectedDisks;

    /*
     * The mobility agent information.
     */
    @JsonProperty(value = "mobilityAgentDetails")
    private InMageRcmFailbackMobilityAgentDetails mobilityAgentDetails;

    /*
     * The network details.
     */
    @JsonProperty(value = "vmNics")
    private List<InMageRcmFailbackNicDetails> vmNics;

    /*
     * The last planned failover start time.
     */
    @JsonProperty(value = "lastPlannedFailoverStartTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime lastPlannedFailoverStartTime;

    /*
     * The last planned failover status.
     */
    @JsonProperty(value = "lastPlannedFailoverStatus", access = JsonProperty.Access.WRITE_ONLY)
    private PlannedFailoverStatus lastPlannedFailoverStatus;

    /*
     * The discovered VM information.
     */
    @JsonProperty(value = "discoveredVmDetails")
    private InMageRcmFailbackDiscoveredProtectedVmDetails discoveredVmDetails;

    /*
     * The policy Id used by the forward replication.
     */
    @JsonProperty(value = "lastUsedPolicyId", access = JsonProperty.Access.WRITE_ONLY)
    private String lastUsedPolicyId;

    /*
     * The policy friendly name used by the forward replication.
     */
    @JsonProperty(value = "lastUsedPolicyFriendlyName", access = JsonProperty.Access.WRITE_ONLY)
    private String lastUsedPolicyFriendlyName;

    /*
     * A value indicating whether agent registration was successful after failover.
     */
    @JsonProperty(value = "isAgentRegistrationSuccessfulAfterFailover", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean isAgentRegistrationSuccessfulAfterFailover;

    /** Creates an instance of InMageRcmFailbackReplicationDetails class. */
    public InMageRcmFailbackReplicationDetails() {
    }

    /**
     * Get the internalIdentifier property: The virtual machine internal identifier.
     *
     * @return the internalIdentifier value.
     */
    public String internalIdentifier() {
        return this.internalIdentifier;
    }

    /**
     * Get the azureVirtualMachineId property: The ARM Id of the azure VM.
     *
     * @return the azureVirtualMachineId value.
     */
    public String azureVirtualMachineId() {
        return this.azureVirtualMachineId;
    }

    /**
     * Get the multiVmGroupName property: The multi VM group name.
     *
     * @return the multiVmGroupName value.
     */
    public String multiVmGroupName() {
        return this.multiVmGroupName;
    }

    /**
     * Get the reprotectAgentId property: The reprotect agent Id.
     *
     * @return the reprotectAgentId value.
     */
    public String reprotectAgentId() {
        return this.reprotectAgentId;
    }

    /**
     * Get the reprotectAgentName property: The reprotect agent name.
     *
     * @return the reprotectAgentName value.
     */
    public String reprotectAgentName() {
        return this.reprotectAgentName;
    }

    /**
     * Get the osType property: The type of the OS on the VM.
     *
     * @return the osType value.
     */
    public String osType() {
        return this.osType;
    }

    /**
     * Get the logStorageAccountId property: The log storage account ARM Id.
     *
     * @return the logStorageAccountId value.
     */
    public String logStorageAccountId() {
        return this.logStorageAccountId;
    }

    /**
     * Get the targetvCenterId property: The target vCenter Id.
     *
     * @return the targetvCenterId value.
     */
    public String targetvCenterId() {
        return this.targetvCenterId;
    }

    /**
     * Get the targetDataStoreName property: The target datastore name.
     *
     * @return the targetDataStoreName value.
     */
    public String targetDataStoreName() {
        return this.targetDataStoreName;
    }

    /**
     * Get the targetVmName property: The target VM name.
     *
     * @return the targetVmName value.
     */
    public String targetVmName() {
        return this.targetVmName;
    }

    /**
     * Get the initialReplicationProgressPercentage property: The initial replication progress percentage.
     *
     * @return the initialReplicationProgressPercentage value.
     */
    public Integer initialReplicationProgressPercentage() {
        return this.initialReplicationProgressPercentage;
    }

    /**
     * Get the initialReplicationProcessedBytes property: The initial replication processed bytes. This includes sum of
     * total bytes transferred and matched bytes on all selected disks in source VM.
     *
     * @return the initialReplicationProcessedBytes value.
     */
    public Long initialReplicationProcessedBytes() {
        return this.initialReplicationProcessedBytes;
    }

    /**
     * Get the initialReplicationTransferredBytes property: The initial replication transferred bytes from source VM to
     * target for all selected disks on source VM.
     *
     * @return the initialReplicationTransferredBytes value.
     */
    public Long initialReplicationTransferredBytes() {
        return this.initialReplicationTransferredBytes;
    }

    /**
     * Get the initialReplicationProgressHealth property: The initial replication progress health.
     *
     * @return the initialReplicationProgressHealth value.
     */
    public VmReplicationProgressHealth initialReplicationProgressHealth() {
        return this.initialReplicationProgressHealth;
    }

    /**
     * Get the resyncProgressPercentage property: The resync progress percentage.
     *
     * @return the resyncProgressPercentage value.
     */
    public Integer resyncProgressPercentage() {
        return this.resyncProgressPercentage;
    }

    /**
     * Get the resyncProcessedBytes property: The resync processed bytes. This includes sum of total bytes transferred
     * and matched bytes on all selected disks in source VM.
     *
     * @return the resyncProcessedBytes value.
     */
    public Long resyncProcessedBytes() {
        return this.resyncProcessedBytes;
    }

    /**
     * Get the resyncTransferredBytes property: The resync transferred bytes from source VM to target for all selected
     * disks on source VM.
     *
     * @return the resyncTransferredBytes value.
     */
    public Long resyncTransferredBytes() {
        return this.resyncTransferredBytes;
    }

    /**
     * Get the resyncProgressHealth property: The resync progress health.
     *
     * @return the resyncProgressHealth value.
     */
    public VmReplicationProgressHealth resyncProgressHealth() {
        return this.resyncProgressHealth;
    }

    /**
     * Get the resyncRequired property: A value indicating whether resync is required.
     *
     * @return the resyncRequired value.
     */
    public String resyncRequired() {
        return this.resyncRequired;
    }

    /**
     * Get the resyncState property: The resync state.
     *
     * @return the resyncState value.
     */
    public ResyncState resyncState() {
        return this.resyncState;
    }

    /**
     * Get the protectedDisks property: The list of protected disks.
     *
     * @return the protectedDisks value.
     */
    public List<InMageRcmFailbackProtectedDiskDetails> protectedDisks() {
        return this.protectedDisks;
    }

    /**
     * Set the protectedDisks property: The list of protected disks.
     *
     * @param protectedDisks the protectedDisks value to set.
     * @return the InMageRcmFailbackReplicationDetails object itself.
     */
    public InMageRcmFailbackReplicationDetails withProtectedDisks(
        List<InMageRcmFailbackProtectedDiskDetails> protectedDisks) {
        this.protectedDisks = protectedDisks;
        return this;
    }

    /**
     * Get the mobilityAgentDetails property: The mobility agent information.
     *
     * @return the mobilityAgentDetails value.
     */
    public InMageRcmFailbackMobilityAgentDetails mobilityAgentDetails() {
        return this.mobilityAgentDetails;
    }

    /**
     * Set the mobilityAgentDetails property: The mobility agent information.
     *
     * @param mobilityAgentDetails the mobilityAgentDetails value to set.
     * @return the InMageRcmFailbackReplicationDetails object itself.
     */
    public InMageRcmFailbackReplicationDetails withMobilityAgentDetails(
        InMageRcmFailbackMobilityAgentDetails mobilityAgentDetails) {
        this.mobilityAgentDetails = mobilityAgentDetails;
        return this;
    }

    /**
     * Get the vmNics property: The network details.
     *
     * @return the vmNics value.
     */
    public List<InMageRcmFailbackNicDetails> vmNics() {
        return this.vmNics;
    }

    /**
     * Set the vmNics property: The network details.
     *
     * @param vmNics the vmNics value to set.
     * @return the InMageRcmFailbackReplicationDetails object itself.
     */
    public InMageRcmFailbackReplicationDetails withVmNics(List<InMageRcmFailbackNicDetails> vmNics) {
        this.vmNics = vmNics;
        return this;
    }

    /**
     * Get the lastPlannedFailoverStartTime property: The last planned failover start time.
     *
     * @return the lastPlannedFailoverStartTime value.
     */
    public OffsetDateTime lastPlannedFailoverStartTime() {
        return this.lastPlannedFailoverStartTime;
    }

    /**
     * Get the lastPlannedFailoverStatus property: The last planned failover status.
     *
     * @return the lastPlannedFailoverStatus value.
     */
    public PlannedFailoverStatus lastPlannedFailoverStatus() {
        return this.lastPlannedFailoverStatus;
    }

    /**
     * Get the discoveredVmDetails property: The discovered VM information.
     *
     * @return the discoveredVmDetails value.
     */
    public InMageRcmFailbackDiscoveredProtectedVmDetails discoveredVmDetails() {
        return this.discoveredVmDetails;
    }

    /**
     * Set the discoveredVmDetails property: The discovered VM information.
     *
     * @param discoveredVmDetails the discoveredVmDetails value to set.
     * @return the InMageRcmFailbackReplicationDetails object itself.
     */
    public InMageRcmFailbackReplicationDetails withDiscoveredVmDetails(
        InMageRcmFailbackDiscoveredProtectedVmDetails discoveredVmDetails) {
        this.discoveredVmDetails = discoveredVmDetails;
        return this;
    }

    /**
     * Get the lastUsedPolicyId property: The policy Id used by the forward replication.
     *
     * @return the lastUsedPolicyId value.
     */
    public String lastUsedPolicyId() {
        return this.lastUsedPolicyId;
    }

    /**
     * Get the lastUsedPolicyFriendlyName property: The policy friendly name used by the forward replication.
     *
     * @return the lastUsedPolicyFriendlyName value.
     */
    public String lastUsedPolicyFriendlyName() {
        return this.lastUsedPolicyFriendlyName;
    }

    /**
     * Get the isAgentRegistrationSuccessfulAfterFailover property: A value indicating whether agent registration was
     * successful after failover.
     *
     * @return the isAgentRegistrationSuccessfulAfterFailover value.
     */
    public Boolean isAgentRegistrationSuccessfulAfterFailover() {
        return this.isAgentRegistrationSuccessfulAfterFailover;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (protectedDisks() != null) {
            protectedDisks().forEach(e -> e.validate());
        }
        if (mobilityAgentDetails() != null) {
            mobilityAgentDetails().validate();
        }
        if (vmNics() != null) {
            vmNics().forEach(e -> e.validate());
        }
        if (discoveredVmDetails() != null) {
            discoveredVmDetails().validate();
        }
    }
}
