com.azure.resourcemanager.netapp.implementation.VolumeGroupDetailsImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-netapp Show documentation
Show all versions of azure-resourcemanager-netapp Show documentation
This package contains Microsoft Azure SDK for NetAppFiles Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-2024-03.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.netapp.implementation;
import com.azure.core.management.Region;
import com.azure.core.util.Context;
import com.azure.resourcemanager.netapp.fluent.models.VolumeGroupDetailsInner;
import com.azure.resourcemanager.netapp.models.VolumeGroupDetails;
import com.azure.resourcemanager.netapp.models.VolumeGroupMetadata;
import com.azure.resourcemanager.netapp.models.VolumeGroupVolumeProperties;
import java.util.Collections;
import java.util.List;
public final class VolumeGroupDetailsImpl implements VolumeGroupDetails, VolumeGroupDetails.Definition {
private VolumeGroupDetailsInner innerObject;
private final com.azure.resourcemanager.netapp.NetAppFilesManager serviceManager;
VolumeGroupDetailsImpl(VolumeGroupDetailsInner innerObject,
com.azure.resourcemanager.netapp.NetAppFilesManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
public String location() {
return this.innerModel().location();
}
public String id() {
return this.innerModel().id();
}
public String name() {
return this.innerModel().name();
}
public String type() {
return this.innerModel().type();
}
public String provisioningState() {
return this.innerModel().provisioningState();
}
public VolumeGroupMetadata groupMetadata() {
return this.innerModel().groupMetadata();
}
public List volumes() {
List inner = this.innerModel().volumes();
if (inner != null) {
return Collections.unmodifiableList(inner);
} else {
return Collections.emptyList();
}
}
public Region region() {
return Region.fromName(this.regionName());
}
public String regionName() {
return this.location();
}
public VolumeGroupDetailsInner innerModel() {
return this.innerObject;
}
private com.azure.resourcemanager.netapp.NetAppFilesManager manager() {
return this.serviceManager;
}
private String resourceGroupName;
private String accountName;
private String volumeGroupName;
public VolumeGroupDetailsImpl withExistingNetAppAccount(String resourceGroupName, String accountName) {
this.resourceGroupName = resourceGroupName;
this.accountName = accountName;
return this;
}
public VolumeGroupDetails create() {
this.innerObject = serviceManager.serviceClient()
.getVolumeGroups()
.create(resourceGroupName, accountName, volumeGroupName, this.innerModel(), Context.NONE);
return this;
}
public VolumeGroupDetails create(Context context) {
this.innerObject = serviceManager.serviceClient()
.getVolumeGroups()
.create(resourceGroupName, accountName, volumeGroupName, this.innerModel(), context);
return this;
}
VolumeGroupDetailsImpl(String name, com.azure.resourcemanager.netapp.NetAppFilesManager serviceManager) {
this.innerObject = new VolumeGroupDetailsInner();
this.serviceManager = serviceManager;
this.volumeGroupName = name;
}
public VolumeGroupDetails refresh() {
this.innerObject = serviceManager.serviceClient()
.getVolumeGroups()
.getWithResponse(resourceGroupName, accountName, volumeGroupName, Context.NONE)
.getValue();
return this;
}
public VolumeGroupDetails refresh(Context context) {
this.innerObject = serviceManager.serviceClient()
.getVolumeGroups()
.getWithResponse(resourceGroupName, accountName, volumeGroupName, context)
.getValue();
return this;
}
public VolumeGroupDetailsImpl withRegion(Region location) {
this.innerModel().withLocation(location.toString());
return this;
}
public VolumeGroupDetailsImpl withRegion(String location) {
this.innerModel().withLocation(location);
return this;
}
public VolumeGroupDetailsImpl withGroupMetadata(VolumeGroupMetadata groupMetadata) {
this.innerModel().withGroupMetadata(groupMetadata);
return this;
}
public VolumeGroupDetailsImpl withVolumes(List volumes) {
this.innerModel().withVolumes(volumes);
return this;
}
}