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

com.azure.resourcemanager.network.implementation.PrivateDnsZoneGroupsImpl Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.44.0
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.resourcemanager.network.implementation;

import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.resourcemanager.network.NetworkManager;
import com.azure.resourcemanager.network.fluent.PrivateDnsZoneGroupsClient;
import com.azure.resourcemanager.network.fluent.models.PrivateDnsZoneGroupInner;
import com.azure.resourcemanager.network.models.PrivateDnsZoneGroup;
import com.azure.resourcemanager.network.models.PrivateDnsZoneGroups;
import com.azure.resourcemanager.network.models.PrivateEndpoint;
import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.IndependentChildrenImpl;
import com.azure.resourcemanager.resources.fluentcore.utils.PagedConverter;
import reactor.core.publisher.Mono;

public class PrivateDnsZoneGroupsImpl
    extends
    IndependentChildrenImpl<
        PrivateDnsZoneGroup, PrivateDnsZoneGroupImpl,
        PrivateDnsZoneGroupInner, PrivateDnsZoneGroupsClient,
        NetworkManager, PrivateEndpoint>
    implements
    PrivateDnsZoneGroups {

    private final PrivateEndpointImpl parent;

    protected PrivateDnsZoneGroupsImpl(PrivateEndpointImpl parent) {
        super(parent.manager().serviceClient().getPrivateDnsZoneGroups(), parent.manager());
        this.parent = parent;
    }

    @Override
    public Mono deleteByParentAsync(String groupName, String parentName, String name) {
        return this.innerModel().deleteAsync(groupName, parentName, name);
    }

    @Override
    public Mono getByParentAsync(String resourceGroup, String parentName, String name) {
        return this.innerModel().getAsync(resourceGroup, parentName, name).map(this::wrapModel);
    }

    @Override
    public PagedIterable listByParent(String resourceGroupName, String parentName) {
        return PagedConverter.mapPage(this.innerModel().list(parentName, resourceGroupName), this::wrapModel);
    }

    @Override
    protected PrivateDnsZoneGroupImpl wrapModel(String name) {
        return new PrivateDnsZoneGroupImpl(name, new PrivateDnsZoneGroupInner(), this.parent);
    }

    @Override
    protected PrivateDnsZoneGroupImpl wrapModel(PrivateDnsZoneGroupInner innerModel) {
        return new PrivateDnsZoneGroupImpl(innerModel.name(), innerModel, this.parent);
    }

    @Override
    public PrivateDnsZoneGroupImpl define(String name) {
        return this.wrapModel(name);
    }

    @Override
    public PagedIterable list() {
        return new PagedIterable<>(this.listAsync());
    }

    @Override
    public PagedFlux listAsync() {
        return PagedConverter.mapPage(this.innerModel().
            listAsync(parent.name(), parent.resourceGroupName()), this::wrapModel);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy