
com.azure.resourcemanager.billing.models.AppliedScopeProperties Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.billing.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* Properties specific to applied scope type. Not required if not applicable.
*/
@Fluent
public final class AppliedScopeProperties implements JsonSerializable {
/*
* Tenant ID where the savings plan where the benefit is applied.
*/
private String tenantId;
/*
* Fully-qualified identifier of the management group where the benefit is applied.
*/
private String managementGroupId;
/*
* Fully-qualified identifier of the subscription where the benefit is applied.
*/
private String subscriptionId;
/*
* Fully-qualified identifier of the resource group where the benefit is applied.
*/
private String resourceGroupId;
/*
* Display name
*/
private String displayName;
/**
* Creates an instance of AppliedScopeProperties class.
*/
public AppliedScopeProperties() {
}
/**
* Get the tenantId property: Tenant ID where the savings plan where the benefit is applied.
*
* @return the tenantId value.
*/
public String tenantId() {
return this.tenantId;
}
/**
* Set the tenantId property: Tenant ID where the savings plan where the benefit is applied.
*
* @param tenantId the tenantId value to set.
* @return the AppliedScopeProperties object itself.
*/
public AppliedScopeProperties withTenantId(String tenantId) {
this.tenantId = tenantId;
return this;
}
/**
* Get the managementGroupId property: Fully-qualified identifier of the management group where the benefit is
* applied.
*
* @return the managementGroupId value.
*/
public String managementGroupId() {
return this.managementGroupId;
}
/**
* Set the managementGroupId property: Fully-qualified identifier of the management group where the benefit is
* applied.
*
* @param managementGroupId the managementGroupId value to set.
* @return the AppliedScopeProperties object itself.
*/
public AppliedScopeProperties withManagementGroupId(String managementGroupId) {
this.managementGroupId = managementGroupId;
return this;
}
/**
* Get the subscriptionId property: Fully-qualified identifier of the subscription where the benefit is applied.
*
* @return the subscriptionId value.
*/
public String subscriptionId() {
return this.subscriptionId;
}
/**
* Set the subscriptionId property: Fully-qualified identifier of the subscription where the benefit is applied.
*
* @param subscriptionId the subscriptionId value to set.
* @return the AppliedScopeProperties object itself.
*/
public AppliedScopeProperties withSubscriptionId(String subscriptionId) {
this.subscriptionId = subscriptionId;
return this;
}
/**
* Get the resourceGroupId property: Fully-qualified identifier of the resource group where the benefit is applied.
*
* @return the resourceGroupId value.
*/
public String resourceGroupId() {
return this.resourceGroupId;
}
/**
* Set the resourceGroupId property: Fully-qualified identifier of the resource group where the benefit is applied.
*
* @param resourceGroupId the resourceGroupId value to set.
* @return the AppliedScopeProperties object itself.
*/
public AppliedScopeProperties withResourceGroupId(String resourceGroupId) {
this.resourceGroupId = resourceGroupId;
return this;
}
/**
* Get the displayName property: Display name.
*
* @return the displayName value.
*/
public String displayName() {
return this.displayName;
}
/**
* Set the displayName property: Display name.
*
* @param displayName the displayName value to set.
* @return the AppliedScopeProperties object itself.
*/
public AppliedScopeProperties withDisplayName(String displayName) {
this.displayName = displayName;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("tenantId", this.tenantId);
jsonWriter.writeStringField("managementGroupId", this.managementGroupId);
jsonWriter.writeStringField("subscriptionId", this.subscriptionId);
jsonWriter.writeStringField("resourceGroupId", this.resourceGroupId);
jsonWriter.writeStringField("displayName", this.displayName);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of AppliedScopeProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AppliedScopeProperties 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 AppliedScopeProperties.
*/
public static AppliedScopeProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AppliedScopeProperties deserializedAppliedScopeProperties = new AppliedScopeProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("tenantId".equals(fieldName)) {
deserializedAppliedScopeProperties.tenantId = reader.getString();
} else if ("managementGroupId".equals(fieldName)) {
deserializedAppliedScopeProperties.managementGroupId = reader.getString();
} else if ("subscriptionId".equals(fieldName)) {
deserializedAppliedScopeProperties.subscriptionId = reader.getString();
} else if ("resourceGroupId".equals(fieldName)) {
deserializedAppliedScopeProperties.resourceGroupId = reader.getString();
} else if ("displayName".equals(fieldName)) {
deserializedAppliedScopeProperties.displayName = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedAppliedScopeProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy