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

com.azure.resourcemanager.botservice.implementation.PrivateEndpointConnectionImpl Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for BotService Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Bot Service is a platform for creating smart conversational agents. Package tag package-2021-03-01.

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

package com.azure.resourcemanager.botservice.implementation;

import com.azure.core.util.Context;
import com.azure.resourcemanager.botservice.fluent.models.PrivateEndpointConnectionInner;
import com.azure.resourcemanager.botservice.models.PrivateEndpoint;
import com.azure.resourcemanager.botservice.models.PrivateEndpointConnection;
import com.azure.resourcemanager.botservice.models.PrivateEndpointConnectionProvisioningState;
import com.azure.resourcemanager.botservice.models.PrivateLinkServiceConnectionState;
import java.util.Collections;
import java.util.List;

public final class PrivateEndpointConnectionImpl
    implements PrivateEndpointConnection, PrivateEndpointConnection.Definition {
    private PrivateEndpointConnectionInner innerObject;

    private final com.azure.resourcemanager.botservice.BotServiceManager serviceManager;

    PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject,
        com.azure.resourcemanager.botservice.BotServiceManager 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 PrivateEndpoint privateEndpoint() {
        return this.innerModel().privateEndpoint();
    }

    public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() {
        return this.innerModel().privateLinkServiceConnectionState();
    }

    public PrivateEndpointConnectionProvisioningState provisioningState() {
        return this.innerModel().provisioningState();
    }

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

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

    private com.azure.resourcemanager.botservice.BotServiceManager manager() {
        return this.serviceManager;
    }

    private String resourceGroupName;

    private String resourceName;

    private String privateEndpointConnectionName;

    public PrivateEndpointConnectionImpl withExistingBotService(String resourceGroupName, String resourceName) {
        this.resourceGroupName = resourceGroupName;
        this.resourceName = resourceName;
        return this;
    }

    public PrivateEndpointConnection create() {
        this.innerObject = serviceManager.serviceClient()
            .getPrivateEndpointConnections()
            .createWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, this.innerModel(),
                Context.NONE)
            .getValue();
        return this;
    }

    public PrivateEndpointConnection create(Context context) {
        this.innerObject = serviceManager.serviceClient()
            .getPrivateEndpointConnections()
            .createWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, this.innerModel(),
                context)
            .getValue();
        return this;
    }

    PrivateEndpointConnectionImpl(String name, com.azure.resourcemanager.botservice.BotServiceManager serviceManager) {
        this.innerObject = new PrivateEndpointConnectionInner();
        this.serviceManager = serviceManager;
        this.privateEndpointConnectionName = name;
    }

    public PrivateEndpointConnection refresh() {
        this.innerObject = serviceManager.serviceClient()
            .getPrivateEndpointConnections()
            .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, Context.NONE)
            .getValue();
        return this;
    }

    public PrivateEndpointConnection refresh(Context context) {
        this.innerObject = serviceManager.serviceClient()
            .getPrivateEndpointConnections()
            .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context)
            .getValue();
        return this;
    }

    public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) {
        this.innerModel().withPrivateEndpoint(privateEndpoint);
        return this;
    }

    public PrivateEndpointConnectionImpl
        withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) {
        this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState);
        return this;
    }

    public PrivateEndpointConnectionImpl withGroupIds(List groupIds) {
        this.innerModel().withGroupIds(groupIds);
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy