com.azure.resourcemanager.hybridcompute.fluent.models.LicenseProfileMachineInstanceViewInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-hybridcompute Show documentation
Show all versions of azure-resourcemanager-hybridcompute Show documentation
This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2024-05.
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.hybridcompute.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.management.exception.ManagementError;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.hybridcompute.models.LicenseProfileProductType;
import com.azure.resourcemanager.hybridcompute.models.LicenseProfileSubscriptionStatus;
import com.azure.resourcemanager.hybridcompute.models.LicenseStatus;
import com.azure.resourcemanager.hybridcompute.models.ProductFeature;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;
/**
* License Profile Instance View in Machine Properties.
*/
@Fluent
public final class LicenseProfileMachineInstanceViewInner
implements JsonSerializable {
/*
* Indicates the license status of the OS.
*/
private LicenseStatus licenseStatus;
/*
* Indicates the license channel.
*/
private String licenseChannel;
/*
* The softwareAssurance property.
*/
private LicenseProfileMachineInstanceViewSoftwareAssurance innerSoftwareAssurance;
/*
* Properties for the Machine ESU profile.
*/
private LicenseProfileMachineInstanceViewEsuPropertiesInner esuProfile;
/*
* Hybrid Compute Product Profile properties
*/
private LicenseProfileArmProductProfileProperties innerProductProfile;
/**
* Creates an instance of LicenseProfileMachineInstanceViewInner class.
*/
public LicenseProfileMachineInstanceViewInner() {
}
/**
* Get the licenseStatus property: Indicates the license status of the OS.
*
* @return the licenseStatus value.
*/
public LicenseStatus licenseStatus() {
return this.licenseStatus;
}
/**
* Get the licenseChannel property: Indicates the license channel.
*
* @return the licenseChannel value.
*/
public String licenseChannel() {
return this.licenseChannel;
}
/**
* Get the innerSoftwareAssurance property: The softwareAssurance property.
*
* @return the innerSoftwareAssurance value.
*/
private LicenseProfileMachineInstanceViewSoftwareAssurance innerSoftwareAssurance() {
return this.innerSoftwareAssurance;
}
/**
* Get the esuProfile property: Properties for the Machine ESU profile.
*
* @return the esuProfile value.
*/
public LicenseProfileMachineInstanceViewEsuPropertiesInner esuProfile() {
return this.esuProfile;
}
/**
* Set the esuProfile property: Properties for the Machine ESU profile.
*
* @param esuProfile the esuProfile value to set.
* @return the LicenseProfileMachineInstanceViewInner object itself.
*/
public LicenseProfileMachineInstanceViewInner
withEsuProfile(LicenseProfileMachineInstanceViewEsuPropertiesInner esuProfile) {
this.esuProfile = esuProfile;
return this;
}
/**
* Get the innerProductProfile property: Hybrid Compute Product Profile properties.
*
* @return the innerProductProfile value.
*/
private LicenseProfileArmProductProfileProperties innerProductProfile() {
return this.innerProductProfile;
}
/**
* Get the softwareAssuranceCustomer property: Specifies if this machine is licensed as part of a Software Assurance
* agreement.
*
* @return the softwareAssuranceCustomer value.
*/
public Boolean softwareAssuranceCustomer() {
return this.innerSoftwareAssurance() == null ? null : this.innerSoftwareAssurance().softwareAssuranceCustomer();
}
/**
* Set the softwareAssuranceCustomer property: Specifies if this machine is licensed as part of a Software Assurance
* agreement.
*
* @param softwareAssuranceCustomer the softwareAssuranceCustomer value to set.
* @return the LicenseProfileMachineInstanceViewInner object itself.
*/
public LicenseProfileMachineInstanceViewInner withSoftwareAssuranceCustomer(Boolean softwareAssuranceCustomer) {
if (this.innerSoftwareAssurance() == null) {
this.innerSoftwareAssurance = new LicenseProfileMachineInstanceViewSoftwareAssurance();
}
this.innerSoftwareAssurance().withSoftwareAssuranceCustomer(softwareAssuranceCustomer);
return this;
}
/**
* Get the subscriptionStatus property: Indicates the subscription status of the product.
*
* @return the subscriptionStatus value.
*/
public LicenseProfileSubscriptionStatus subscriptionStatus() {
return this.innerProductProfile() == null ? null : this.innerProductProfile().subscriptionStatus();
}
/**
* Set the subscriptionStatus property: Indicates the subscription status of the product.
*
* @param subscriptionStatus the subscriptionStatus value to set.
* @return the LicenseProfileMachineInstanceViewInner object itself.
*/
public LicenseProfileMachineInstanceViewInner
withSubscriptionStatus(LicenseProfileSubscriptionStatus subscriptionStatus) {
if (this.innerProductProfile() == null) {
this.innerProductProfile = new LicenseProfileArmProductProfileProperties();
}
this.innerProductProfile().withSubscriptionStatus(subscriptionStatus);
return this;
}
/**
* Get the productType property: Indicates the product type of the license.
*
* @return the productType value.
*/
public LicenseProfileProductType productType() {
return this.innerProductProfile() == null ? null : this.innerProductProfile().productType();
}
/**
* Set the productType property: Indicates the product type of the license.
*
* @param productType the productType value to set.
* @return the LicenseProfileMachineInstanceViewInner object itself.
*/
public LicenseProfileMachineInstanceViewInner withProductType(LicenseProfileProductType productType) {
if (this.innerProductProfile() == null) {
this.innerProductProfile = new LicenseProfileArmProductProfileProperties();
}
this.innerProductProfile().withProductType(productType);
return this;
}
/**
* Get the enrollmentDate property: The timestamp in UTC when the user enrolls the feature.
*
* @return the enrollmentDate value.
*/
public OffsetDateTime enrollmentDate() {
return this.innerProductProfile() == null ? null : this.innerProductProfile().enrollmentDate();
}
/**
* Get the billingStartDate property: The timestamp in UTC when the billing starts.
*
* @return the billingStartDate value.
*/
public OffsetDateTime billingStartDate() {
return this.innerProductProfile() == null ? null : this.innerProductProfile().billingStartDate();
}
/**
* Get the disenrollmentDate property: The timestamp in UTC when the user disenrolled the feature.
*
* @return the disenrollmentDate value.
*/
public OffsetDateTime disenrollmentDate() {
return this.innerProductProfile() == null ? null : this.innerProductProfile().disenrollmentDate();
}
/**
* Get the billingEndDate property: The timestamp in UTC when the billing ends.
*
* @return the billingEndDate value.
*/
public OffsetDateTime billingEndDate() {
return this.innerProductProfile() == null ? null : this.innerProductProfile().billingEndDate();
}
/**
* Get the error property: The errors that were encountered during the feature enrollment or disenrollment.
*
* @return the error value.
*/
public ManagementError error() {
return this.innerProductProfile() == null ? null : this.innerProductProfile().error();
}
/**
* Get the productFeatures property: The list of product features.
*
* @return the productFeatures value.
*/
public List productFeatures() {
return this.innerProductProfile() == null ? null : this.innerProductProfile().productFeatures();
}
/**
* Set the productFeatures property: The list of product features.
*
* @param productFeatures the productFeatures value to set.
* @return the LicenseProfileMachineInstanceViewInner object itself.
*/
public LicenseProfileMachineInstanceViewInner withProductFeatures(List productFeatures) {
if (this.innerProductProfile() == null) {
this.innerProductProfile = new LicenseProfileArmProductProfileProperties();
}
this.innerProductProfile().withProductFeatures(productFeatures);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerSoftwareAssurance() != null) {
innerSoftwareAssurance().validate();
}
if (esuProfile() != null) {
esuProfile().validate();
}
if (innerProductProfile() != null) {
innerProductProfile().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("esuProfile", this.esuProfile);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of LicenseProfileMachineInstanceViewInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of LicenseProfileMachineInstanceViewInner if the JsonReader was pointing to an instance of
* it, or null if it was pointing to JSON null.
* @throws IOException If an error occurs while reading the LicenseProfileMachineInstanceViewInner.
*/
public static LicenseProfileMachineInstanceViewInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
LicenseProfileMachineInstanceViewInner deserializedLicenseProfileMachineInstanceViewInner
= new LicenseProfileMachineInstanceViewInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("licenseStatus".equals(fieldName)) {
deserializedLicenseProfileMachineInstanceViewInner.licenseStatus
= LicenseStatus.fromString(reader.getString());
} else if ("licenseChannel".equals(fieldName)) {
deserializedLicenseProfileMachineInstanceViewInner.licenseChannel = reader.getString();
} else if ("softwareAssurance".equals(fieldName)) {
deserializedLicenseProfileMachineInstanceViewInner.innerSoftwareAssurance
= LicenseProfileMachineInstanceViewSoftwareAssurance.fromJson(reader);
} else if ("esuProfile".equals(fieldName)) {
deserializedLicenseProfileMachineInstanceViewInner.esuProfile
= LicenseProfileMachineInstanceViewEsuPropertiesInner.fromJson(reader);
} else if ("productProfile".equals(fieldName)) {
deserializedLicenseProfileMachineInstanceViewInner.innerProductProfile
= LicenseProfileArmProductProfileProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedLicenseProfileMachineInstanceViewInner;
});
}
}