com.microsoft.graph.beta.generated.models.networkaccess.Profile Maven / Gradle / Ivy
package com.microsoft.graph.beta.models.networkaccess;
import com.microsoft.graph.beta.models.Entity;
import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.ParseNode;
import com.microsoft.kiota.serialization.SerializationWriter;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@jakarta.annotation.Generated("com.microsoft.kiota")
public class Profile extends Entity implements Parsable {
/**
* Instantiates a new {@link Profile} and sets the default values.
*/
public Profile() {
super();
}
/**
* Creates a new instance of the appropriate class based on discriminator value
* @param parseNode The parse node to use to read the discriminator value and create the object
* @return a {@link Profile}
*/
@jakarta.annotation.Nonnull
public static Profile createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) {
Objects.requireNonNull(parseNode);
final ParseNode mappingValueNode = parseNode.getChildNode("@odata.type");
if (mappingValueNode != null) {
final String mappingValue = mappingValueNode.getStringValue();
switch (mappingValue) {
case "#microsoft.graph.networkaccess.filteringProfile": return new FilteringProfile();
case "#microsoft.graph.networkaccess.forwardingProfile": return new ForwardingProfile();
}
}
return new Profile();
}
/**
* Gets the description property value. Description.
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getDescription() {
return this.backingStore.get("description");
}
/**
* The deserialization information for the current model
* @return a {@link Map>}
*/
@jakarta.annotation.Nonnull
public Map> getFieldDeserializers() {
final HashMap> deserializerMap = new HashMap>(super.getFieldDeserializers());
deserializerMap.put("description", (n) -> { this.setDescription(n.getStringValue()); });
deserializerMap.put("lastModifiedDateTime", (n) -> { this.setLastModifiedDateTime(n.getOffsetDateTimeValue()); });
deserializerMap.put("name", (n) -> { this.setName(n.getStringValue()); });
deserializerMap.put("policies", (n) -> { this.setPolicies(n.getCollectionOfObjectValues(PolicyLink::createFromDiscriminatorValue)); });
deserializerMap.put("state", (n) -> { this.setState(n.getEnumValue(Status::forValue)); });
deserializerMap.put("version", (n) -> { this.setVersion(n.getStringValue()); });
return deserializerMap;
}
/**
* Gets the lastModifiedDateTime property value. Profile last modified time.
* @return a {@link OffsetDateTime}
*/
@jakarta.annotation.Nullable
public OffsetDateTime getLastModifiedDateTime() {
return this.backingStore.get("lastModifiedDateTime");
}
/**
* Gets the name property value. Profile name.
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getName() {
return this.backingStore.get("name");
}
/**
* Gets the policies property value. Traffic forwarding policies associated with this profile.
* @return a {@link java.util.List}
*/
@jakarta.annotation.Nullable
public java.util.List getPolicies() {
return this.backingStore.get("policies");
}
/**
* Gets the state property value. The state property
* @return a {@link Status}
*/
@jakarta.annotation.Nullable
public Status getState() {
return this.backingStore.get("state");
}
/**
* Gets the version property value. Profile version.
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getVersion() {
return this.backingStore.get("version");
}
/**
* Serializes information the current object
* @param writer Serialization writer to use to serialize this model
*/
public void serialize(@jakarta.annotation.Nonnull final SerializationWriter writer) {
Objects.requireNonNull(writer);
super.serialize(writer);
writer.writeStringValue("description", this.getDescription());
writer.writeOffsetDateTimeValue("lastModifiedDateTime", this.getLastModifiedDateTime());
writer.writeStringValue("name", this.getName());
writer.writeCollectionOfObjectValues("policies", this.getPolicies());
writer.writeEnumValue("state", this.getState());
writer.writeStringValue("version", this.getVersion());
}
/**
* Sets the description property value. Description.
* @param value Value to set for the description property.
*/
public void setDescription(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("description", value);
}
/**
* Sets the lastModifiedDateTime property value. Profile last modified time.
* @param value Value to set for the lastModifiedDateTime property.
*/
public void setLastModifiedDateTime(@jakarta.annotation.Nullable final OffsetDateTime value) {
this.backingStore.set("lastModifiedDateTime", value);
}
/**
* Sets the name property value. Profile name.
* @param value Value to set for the name property.
*/
public void setName(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("name", value);
}
/**
* Sets the policies property value. Traffic forwarding policies associated with this profile.
* @param value Value to set for the policies property.
*/
public void setPolicies(@jakarta.annotation.Nullable final java.util.List value) {
this.backingStore.set("policies", value);
}
/**
* Sets the state property value. The state property
* @param value Value to set for the state property.
*/
public void setState(@jakarta.annotation.Nullable final Status value) {
this.backingStore.set("state", value);
}
/**
* Sets the version property value. Profile version.
* @param value Value to set for the version property.
*/
public void setVersion(@jakarta.annotation.Nullable final String value) {
this.backingStore.set("version", value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy