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

com.azure.resourcemanager.azurestackhci.implementation.HciUpdateImpl Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2024-04.

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.azurestackhci.implementation;

import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.azurestackhci.fluent.models.HciUpdateInner;
import com.azure.resourcemanager.azurestackhci.models.AvailabilityType;
import com.azure.resourcemanager.azurestackhci.models.HciUpdate;
import com.azure.resourcemanager.azurestackhci.models.HealthState;
import com.azure.resourcemanager.azurestackhci.models.PackageVersionInfo;
import com.azure.resourcemanager.azurestackhci.models.PrecheckResult;
import com.azure.resourcemanager.azurestackhci.models.ProvisioningState;
import com.azure.resourcemanager.azurestackhci.models.RebootRequirement;
import com.azure.resourcemanager.azurestackhci.models.State;
import com.azure.resourcemanager.azurestackhci.models.UpdatePrerequisite;
import java.time.OffsetDateTime;
import java.util.Collections;
import java.util.List;

public final class HciUpdateImpl implements HciUpdate, HciUpdate.Definition, HciUpdate.Update {
    private HciUpdateInner innerObject;

    private final com.azure.resourcemanager.azurestackhci.AzureStackHciManager 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 SystemData systemData() {
        return this.innerModel().systemData();
    }

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

    public OffsetDateTime installedDate() {
        return this.innerModel().installedDate();
    }

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

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

    public State state() {
        return this.innerModel().state();
    }

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

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

    public RebootRequirement rebootRequired() {
        return this.innerModel().rebootRequired();
    }

    public HealthState healthState() {
        return this.innerModel().healthState();
    }

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

    public OffsetDateTime healthCheckDate() {
        return this.innerModel().healthCheckDate();
    }

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

    public Float packageSizeInMb() {
        return this.innerModel().packageSizeInMb();
    }

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

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

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

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

    public AvailabilityType availabilityType() {
        return this.innerModel().availabilityType();
    }

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

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

    public Float progressPercentage() {
        return this.innerModel().progressPercentage();
    }

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

    public Region region() {
        return Region.fromName(this.regionName());
    }

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

    public String resourceGroupName() {
        return resourceGroupName;
    }

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

    private com.azure.resourcemanager.azurestackhci.AzureStackHciManager manager() {
        return this.serviceManager;
    }

    private String resourceGroupName;

    private String clusterName;

    private String updateName;

    public HciUpdateImpl withExistingCluster(String resourceGroupName, String clusterName) {
        this.resourceGroupName = resourceGroupName;
        this.clusterName = clusterName;
        return this;
    }

    public HciUpdate create() {
        this.innerObject = serviceManager.serviceClient()
            .getUpdates()
            .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), Context.NONE)
            .getValue();
        return this;
    }

    public HciUpdate create(Context context) {
        this.innerObject = serviceManager.serviceClient()
            .getUpdates()
            .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), context)
            .getValue();
        return this;
    }

    HciUpdateImpl(String name, com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) {
        this.innerObject = new HciUpdateInner();
        this.serviceManager = serviceManager;
        this.updateName = name;
    }

    public HciUpdateImpl update() {
        return this;
    }

    public HciUpdate apply() {
        this.innerObject = serviceManager.serviceClient()
            .getUpdates()
            .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), Context.NONE)
            .getValue();
        return this;
    }

    public HciUpdate apply(Context context) {
        this.innerObject = serviceManager.serviceClient()
            .getUpdates()
            .putWithResponse(resourceGroupName, clusterName, updateName, this.innerModel(), context)
            .getValue();
        return this;
    }

    HciUpdateImpl(HciUpdateInner innerObject,
        com.azure.resourcemanager.azurestackhci.AzureStackHciManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
        this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
        this.clusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "clusters");
        this.updateName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "updates");
    }

    public HciUpdate refresh() {
        this.innerObject = serviceManager.serviceClient()
            .getUpdates()
            .getWithResponse(resourceGroupName, clusterName, updateName, Context.NONE)
            .getValue();
        return this;
    }

    public HciUpdate refresh(Context context) {
        this.innerObject = serviceManager.serviceClient()
            .getUpdates()
            .getWithResponse(resourceGroupName, clusterName, updateName, context)
            .getValue();
        return this;
    }

    public void post() {
        serviceManager.updates().post(resourceGroupName, clusterName, updateName);
    }

    public void post(Context context) {
        serviceManager.updates().post(resourceGroupName, clusterName, updateName, context);
    }

    public HciUpdateImpl withRegion(Region location) {
        this.innerModel().withLocation(location.toString());
        return this;
    }

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

    public HciUpdateImpl withInstalledDate(OffsetDateTime installedDate) {
        this.innerModel().withInstalledDate(installedDate);
        return this;
    }

    public HciUpdateImpl withDescription(String description) {
        this.innerModel().withDescription(description);
        return this;
    }

    public HciUpdateImpl withMinSbeVersionRequired(String minSbeVersionRequired) {
        this.innerModel().withMinSbeVersionRequired(minSbeVersionRequired);
        return this;
    }

    public HciUpdateImpl withState(State state) {
        this.innerModel().withState(state);
        return this;
    }

    public HciUpdateImpl withPrerequisites(List prerequisites) {
        this.innerModel().withPrerequisites(prerequisites);
        return this;
    }

    public HciUpdateImpl withComponentVersions(List componentVersions) {
        this.innerModel().withComponentVersions(componentVersions);
        return this;
    }

    public HciUpdateImpl withRebootRequired(RebootRequirement rebootRequired) {
        this.innerModel().withRebootRequired(rebootRequired);
        return this;
    }

    public HciUpdateImpl withHealthState(HealthState healthState) {
        this.innerModel().withHealthState(healthState);
        return this;
    }

    public HciUpdateImpl withHealthCheckResult(List healthCheckResult) {
        this.innerModel().withHealthCheckResult(healthCheckResult);
        return this;
    }

    public HciUpdateImpl withHealthCheckDate(OffsetDateTime healthCheckDate) {
        this.innerModel().withHealthCheckDate(healthCheckDate);
        return this;
    }

    public HciUpdateImpl withPackagePath(String packagePath) {
        this.innerModel().withPackagePath(packagePath);
        return this;
    }

    public HciUpdateImpl withPackageSizeInMb(Float packageSizeInMb) {
        this.innerModel().withPackageSizeInMb(packageSizeInMb);
        return this;
    }

    public HciUpdateImpl withDisplayName(String displayName) {
        this.innerModel().withDisplayName(displayName);
        return this;
    }

    public HciUpdateImpl withVersion(String version) {
        this.innerModel().withVersion(version);
        return this;
    }

    public HciUpdateImpl withPublisher(String publisher) {
        this.innerModel().withPublisher(publisher);
        return this;
    }

    public HciUpdateImpl withReleaseLink(String releaseLink) {
        this.innerModel().withReleaseLink(releaseLink);
        return this;
    }

    public HciUpdateImpl withAvailabilityType(AvailabilityType availabilityType) {
        this.innerModel().withAvailabilityType(availabilityType);
        return this;
    }

    public HciUpdateImpl withPackageType(String packageType) {
        this.innerModel().withPackageType(packageType);
        return this;
    }

    public HciUpdateImpl withAdditionalProperties(String additionalProperties) {
        this.innerModel().withAdditionalProperties(additionalProperties);
        return this;
    }

    public HciUpdateImpl withProgressPercentage(Float progressPercentage) {
        this.innerModel().withProgressPercentage(progressPercentage);
        return this;
    }

    public HciUpdateImpl withNotifyMessage(String notifyMessage) {
        this.innerModel().withNotifyMessage(notifyMessage);
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy