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

package com.azure.resourcemanager.deploymentmanager.implementation;

import com.azure.resourcemanager.deploymentmanager.fluent.models.RolloutInner;
import com.azure.resourcemanager.deploymentmanager.models.Identity;
import com.azure.resourcemanager.deploymentmanager.models.Rollout;
import com.azure.resourcemanager.deploymentmanager.models.RolloutOperationInfo;
import com.azure.resourcemanager.deploymentmanager.models.Service;
import com.azure.resourcemanager.deploymentmanager.models.StepGroup;
import java.util.Collections;
import java.util.List;
import java.util.Map;

public final class RolloutImpl implements Rollout {
    private RolloutInner innerObject;

    private final com.azure.resourcemanager.deploymentmanager.DeploymentManager serviceManager;

    RolloutImpl(
        RolloutInner innerObject, com.azure.resourcemanager.deploymentmanager.DeploymentManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
    }

    public String id() {
        return this.innerModel().id();
    }

    public String name() {
        return this.innerModel().name();
    }

    public String type() {
        return this.innerModel().type();
    }

    public String location() {
        return this.innerModel().location();
    }

    public Map<String, String> tags() {
        Map<String, String> inner = this.innerModel().tags();
        if (inner != null) {
            return Collections.unmodifiableMap(inner);
        } else {
            return Collections.emptyMap();
        }
    }

    public Identity identity() {
        return this.innerModel().identity();
    }

    public String status() {
        return this.innerModel().status();
    }

    public Integer totalRetryAttempts() {
        return this.innerModel().totalRetryAttempts();
    }

    public RolloutOperationInfo operationInfo() {
        return this.innerModel().operationInfo();
    }

    public List<Service> services() {
        List<Service> inner = this.innerModel().services();
        if (inner != null) {
            return Collections.unmodifiableList(inner);
        } else {
            return Collections.emptyList();
        }
    }

    public String buildVersion() {
        return this.innerModel().buildVersion();
    }

    public String artifactSourceId() {
        return this.innerModel().artifactSourceId();
    }

    public String targetServiceTopologyId() {
        return this.innerModel().targetServiceTopologyId();
    }

    public List<StepGroup> stepGroups() {
        List<StepGroup> inner = this.innerModel().stepGroups();
        if (inner != null) {
            return Collections.unmodifiableList(inner);
        } else {
            return Collections.emptyList();
        }
    }

    public RolloutInner innerModel() {
        return this.innerObject;
    }

    private com.azure.resourcemanager.deploymentmanager.DeploymentManager manager() {
        return this.serviceManager;
    }
}
