All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.sql.implementation.RegionCapabilitiesImpl Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure Sql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt

The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.resourcemanager.sql.implementation;

import com.azure.core.management.Region;
import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl;
import com.azure.resourcemanager.sql.models.CapabilityStatus;
import com.azure.resourcemanager.sql.models.RegionCapabilities;
import com.azure.resourcemanager.sql.models.ServerVersionCapability;
import com.azure.resourcemanager.sql.fluent.models.LocationCapabilitiesInner;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/** Implementation for RegionCapabilities. */
public class RegionCapabilitiesImpl extends WrapperImpl implements RegionCapabilities {

    private Map supportedCapabilitiesMap;

    /**
     * Creates an instance of the region capabilities object.
     *
     * @param innerObject the inner object
     */
    public RegionCapabilitiesImpl(LocationCapabilitiesInner innerObject) {
        super(innerObject);
        supportedCapabilitiesMap = new HashMap<>();
        if (this.innerModel().supportedServerVersions() != null) {
            for (ServerVersionCapability serverVersionCapability : this.innerModel().supportedServerVersions()) {
                supportedCapabilitiesMap.put(serverVersionCapability.name(), serverVersionCapability);
            }
        }
    }

    @Override
    public Region region() {
        return Region.fromName(this.innerModel().name());
    }

    @Override
    public CapabilityStatus status() {
        return this.innerModel().status();
    }

    @Override
    public Map supportedCapabilitiesByServerVersion() {
        return Collections.unmodifiableMap(this.supportedCapabilitiesMap);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy