
com.azure.resourcemanager.billing.models.IndirectRelationshipInfo 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;
/**
* Identifies the billing profile that is linked to another billing profile in indirect purchase motion.
*/
@Fluent
public class IndirectRelationshipInfo implements JsonSerializable {
/*
* The billing account name of the partner or the customer for an indirect motion.
*/
private String billingAccountName;
/*
* The billing profile name of the partner or the customer for an indirect motion.
*/
private String billingProfileName;
/*
* The display name of the partner or customer for an indirect motion.
*/
private String displayName;
/**
* Creates an instance of IndirectRelationshipInfo class.
*/
public IndirectRelationshipInfo() {
}
/**
* Get the billingAccountName property: The billing account name of the partner or the customer for an indirect
* motion.
*
* @return the billingAccountName value.
*/
public String billingAccountName() {
return this.billingAccountName;
}
/**
* Set the billingAccountName property: The billing account name of the partner or the customer for an indirect
* motion.
*
* @param billingAccountName the billingAccountName value to set.
* @return the IndirectRelationshipInfo object itself.
*/
public IndirectRelationshipInfo withBillingAccountName(String billingAccountName) {
this.billingAccountName = billingAccountName;
return this;
}
/**
* Get the billingProfileName property: The billing profile name of the partner or the customer for an indirect
* motion.
*
* @return the billingProfileName value.
*/
public String billingProfileName() {
return this.billingProfileName;
}
/**
* Set the billingProfileName property: The billing profile name of the partner or the customer for an indirect
* motion.
*
* @param billingProfileName the billingProfileName value to set.
* @return the IndirectRelationshipInfo object itself.
*/
public IndirectRelationshipInfo withBillingProfileName(String billingProfileName) {
this.billingProfileName = billingProfileName;
return this;
}
/**
* Get the displayName property: The display name of the partner or customer for an indirect motion.
*
* @return the displayName value.
*/
public String displayName() {
return this.displayName;
}
/**
* Set the displayName property: The display name of the partner or customer for an indirect motion.
*
* @param displayName the displayName value to set.
* @return the IndirectRelationshipInfo object itself.
*/
public IndirectRelationshipInfo 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("billingAccountName", this.billingAccountName);
jsonWriter.writeStringField("billingProfileName", this.billingProfileName);
jsonWriter.writeStringField("displayName", this.displayName);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of IndirectRelationshipInfo from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of IndirectRelationshipInfo 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 IndirectRelationshipInfo.
*/
public static IndirectRelationshipInfo fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
IndirectRelationshipInfo deserializedIndirectRelationshipInfo = new IndirectRelationshipInfo();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("billingAccountName".equals(fieldName)) {
deserializedIndirectRelationshipInfo.billingAccountName = reader.getString();
} else if ("billingProfileName".equals(fieldName)) {
deserializedIndirectRelationshipInfo.billingProfileName = reader.getString();
} else if ("displayName".equals(fieldName)) {
deserializedIndirectRelationshipInfo.displayName = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedIndirectRelationshipInfo;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy