![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphOrgContactInner 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.authorization.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* orgContact
*
* Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory
* entity types.
*/
@Fluent
public final class MicrosoftGraphOrgContactInner extends MicrosoftGraphDirectoryObjectInner {
/*
* The addresses property.
*/
private List addresses;
/*
* The companyName property.
*/
private String companyName;
/*
* The department property.
*/
private String department;
/*
* The displayName property.
*/
private String displayName;
/*
* The givenName property.
*/
private String givenName;
/*
* The jobTitle property.
*/
private String jobTitle;
/*
* The mail property.
*/
private String mail;
/*
* The mailNickname property.
*/
private String mailNickname;
/*
* The onPremisesLastSyncDateTime property.
*/
private OffsetDateTime onPremisesLastSyncDateTime;
/*
* The onPremisesProvisioningErrors property.
*/
private List onPremisesProvisioningErrors;
/*
* The onPremisesSyncEnabled property.
*/
private Boolean onPremisesSyncEnabled;
/*
* The phones property.
*/
private List phones;
/*
* The proxyAddresses property.
*/
private List proxyAddresses;
/*
* The surname property.
*/
private String surname;
/*
* The directReports property.
*/
private List directReports;
/*
* Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory
* entity types.
*/
private MicrosoftGraphDirectoryObjectInner manager;
/*
* The memberOf property.
*/
private List memberOf;
/*
* The transitiveMemberOf property.
*/
private List transitiveMemberOf;
/*
* Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory
* entity types.
*/
private Map additionalProperties;
/**
* Creates an instance of MicrosoftGraphOrgContactInner class.
*/
public MicrosoftGraphOrgContactInner() {
}
/**
* Get the addresses property: The addresses property.
*
* @return the addresses value.
*/
public List addresses() {
return this.addresses;
}
/**
* Set the addresses property: The addresses property.
*
* @param addresses the addresses value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withAddresses(List addresses) {
this.addresses = addresses;
return this;
}
/**
* Get the companyName property: The companyName property.
*
* @return the companyName value.
*/
public String companyName() {
return this.companyName;
}
/**
* Set the companyName property: The companyName property.
*
* @param companyName the companyName value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withCompanyName(String companyName) {
this.companyName = companyName;
return this;
}
/**
* Get the department property: The department property.
*
* @return the department value.
*/
public String department() {
return this.department;
}
/**
* Set the department property: The department property.
*
* @param department the department value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withDepartment(String department) {
this.department = department;
return this;
}
/**
* Get the displayName property: The displayName property.
*
* @return the displayName value.
*/
public String displayName() {
return this.displayName;
}
/**
* Set the displayName property: The displayName property.
*
* @param displayName the displayName value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withDisplayName(String displayName) {
this.displayName = displayName;
return this;
}
/**
* Get the givenName property: The givenName property.
*
* @return the givenName value.
*/
public String givenName() {
return this.givenName;
}
/**
* Set the givenName property: The givenName property.
*
* @param givenName the givenName value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withGivenName(String givenName) {
this.givenName = givenName;
return this;
}
/**
* Get the jobTitle property: The jobTitle property.
*
* @return the jobTitle value.
*/
public String jobTitle() {
return this.jobTitle;
}
/**
* Set the jobTitle property: The jobTitle property.
*
* @param jobTitle the jobTitle value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withJobTitle(String jobTitle) {
this.jobTitle = jobTitle;
return this;
}
/**
* Get the mail property: The mail property.
*
* @return the mail value.
*/
public String mail() {
return this.mail;
}
/**
* Set the mail property: The mail property.
*
* @param mail the mail value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withMail(String mail) {
this.mail = mail;
return this;
}
/**
* Get the mailNickname property: The mailNickname property.
*
* @return the mailNickname value.
*/
public String mailNickname() {
return this.mailNickname;
}
/**
* Set the mailNickname property: The mailNickname property.
*
* @param mailNickname the mailNickname value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withMailNickname(String mailNickname) {
this.mailNickname = mailNickname;
return this;
}
/**
* Get the onPremisesLastSyncDateTime property: The onPremisesLastSyncDateTime property.
*
* @return the onPremisesLastSyncDateTime value.
*/
public OffsetDateTime onPremisesLastSyncDateTime() {
return this.onPremisesLastSyncDateTime;
}
/**
* Set the onPremisesLastSyncDateTime property: The onPremisesLastSyncDateTime property.
*
* @param onPremisesLastSyncDateTime the onPremisesLastSyncDateTime value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withOnPremisesLastSyncDateTime(OffsetDateTime onPremisesLastSyncDateTime) {
this.onPremisesLastSyncDateTime = onPremisesLastSyncDateTime;
return this;
}
/**
* Get the onPremisesProvisioningErrors property: The onPremisesProvisioningErrors property.
*
* @return the onPremisesProvisioningErrors value.
*/
public List onPremisesProvisioningErrors() {
return this.onPremisesProvisioningErrors;
}
/**
* Set the onPremisesProvisioningErrors property: The onPremisesProvisioningErrors property.
*
* @param onPremisesProvisioningErrors the onPremisesProvisioningErrors value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner
withOnPremisesProvisioningErrors(List onPremisesProvisioningErrors) {
this.onPremisesProvisioningErrors = onPremisesProvisioningErrors;
return this;
}
/**
* Get the onPremisesSyncEnabled property: The onPremisesSyncEnabled property.
*
* @return the onPremisesSyncEnabled value.
*/
public Boolean onPremisesSyncEnabled() {
return this.onPremisesSyncEnabled;
}
/**
* Set the onPremisesSyncEnabled property: The onPremisesSyncEnabled property.
*
* @param onPremisesSyncEnabled the onPremisesSyncEnabled value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withOnPremisesSyncEnabled(Boolean onPremisesSyncEnabled) {
this.onPremisesSyncEnabled = onPremisesSyncEnabled;
return this;
}
/**
* Get the phones property: The phones property.
*
* @return the phones value.
*/
public List phones() {
return this.phones;
}
/**
* Set the phones property: The phones property.
*
* @param phones the phones value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withPhones(List phones) {
this.phones = phones;
return this;
}
/**
* Get the proxyAddresses property: The proxyAddresses property.
*
* @return the proxyAddresses value.
*/
public List proxyAddresses() {
return this.proxyAddresses;
}
/**
* Set the proxyAddresses property: The proxyAddresses property.
*
* @param proxyAddresses the proxyAddresses value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withProxyAddresses(List proxyAddresses) {
this.proxyAddresses = proxyAddresses;
return this;
}
/**
* Get the surname property: The surname property.
*
* @return the surname value.
*/
public String surname() {
return this.surname;
}
/**
* Set the surname property: The surname property.
*
* @param surname the surname value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withSurname(String surname) {
this.surname = surname;
return this;
}
/**
* Get the directReports property: The directReports property.
*
* @return the directReports value.
*/
public List directReports() {
return this.directReports;
}
/**
* Set the directReports property: The directReports property.
*
* @param directReports the directReports value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withDirectReports(List directReports) {
this.directReports = directReports;
return this;
}
/**
* Get the manager property: Represents an Azure Active Directory object. The directoryObject type is the base type
* for many other directory entity types.
*
* @return the manager value.
*/
public MicrosoftGraphDirectoryObjectInner manager() {
return this.manager;
}
/**
* Set the manager property: Represents an Azure Active Directory object. The directoryObject type is the base type
* for many other directory entity types.
*
* @param manager the manager value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withManager(MicrosoftGraphDirectoryObjectInner manager) {
this.manager = manager;
return this;
}
/**
* Get the memberOf property: The memberOf property.
*
* @return the memberOf value.
*/
public List memberOf() {
return this.memberOf;
}
/**
* Set the memberOf property: The memberOf property.
*
* @param memberOf the memberOf value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withMemberOf(List memberOf) {
this.memberOf = memberOf;
return this;
}
/**
* Get the transitiveMemberOf property: The transitiveMemberOf property.
*
* @return the transitiveMemberOf value.
*/
public List transitiveMemberOf() {
return this.transitiveMemberOf;
}
/**
* Set the transitiveMemberOf property: The transitiveMemberOf property.
*
* @param transitiveMemberOf the transitiveMemberOf value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner
withTransitiveMemberOf(List transitiveMemberOf) {
this.transitiveMemberOf = transitiveMemberOf;
return this;
}
/**
* Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is
* the base type for many other directory entity types.
*
* @return the additionalProperties value.
*/
public Map additionalProperties() {
return this.additionalProperties;
}
/**
* Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is
* the base type for many other directory entity types.
*
* @param additionalProperties the additionalProperties value to set.
* @return the MicrosoftGraphOrgContactInner object itself.
*/
public MicrosoftGraphOrgContactInner withAdditionalProperties(Map additionalProperties) {
this.additionalProperties = additionalProperties;
return this;
}
/**
* {@inheritDoc}
*/
@Override
public MicrosoftGraphOrgContactInner withDeletedDateTime(OffsetDateTime deletedDateTime) {
super.withDeletedDateTime(deletedDateTime);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public MicrosoftGraphOrgContactInner withId(String id) {
super.withId(id);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
@Override
public void validate() {
super.validate();
if (addresses() != null) {
addresses().forEach(e -> e.validate());
}
if (onPremisesProvisioningErrors() != null) {
onPremisesProvisioningErrors().forEach(e -> e.validate());
}
if (phones() != null) {
phones().forEach(e -> e.validate());
}
if (directReports() != null) {
directReports().forEach(e -> e.validate());
}
if (manager() != null) {
manager().validate();
}
if (memberOf() != null) {
memberOf().forEach(e -> e.validate());
}
if (transitiveMemberOf() != null) {
transitiveMemberOf().forEach(e -> e.validate());
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("id", id());
jsonWriter.writeStringField("deletedDateTime",
deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime()));
jsonWriter.writeArrayField("addresses", this.addresses, (writer, element) -> writer.writeJson(element));
jsonWriter.writeStringField("companyName", this.companyName);
jsonWriter.writeStringField("department", this.department);
jsonWriter.writeStringField("displayName", this.displayName);
jsonWriter.writeStringField("givenName", this.givenName);
jsonWriter.writeStringField("jobTitle", this.jobTitle);
jsonWriter.writeStringField("mail", this.mail);
jsonWriter.writeStringField("mailNickname", this.mailNickname);
jsonWriter.writeStringField("onPremisesLastSyncDateTime",
this.onPremisesLastSyncDateTime == null
? null
: DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.onPremisesLastSyncDateTime));
jsonWriter.writeArrayField("onPremisesProvisioningErrors", this.onPremisesProvisioningErrors,
(writer, element) -> writer.writeJson(element));
jsonWriter.writeBooleanField("onPremisesSyncEnabled", this.onPremisesSyncEnabled);
jsonWriter.writeArrayField("phones", this.phones, (writer, element) -> writer.writeJson(element));
jsonWriter.writeArrayField("proxyAddresses", this.proxyAddresses,
(writer, element) -> writer.writeString(element));
jsonWriter.writeStringField("surname", this.surname);
jsonWriter.writeArrayField("directReports", this.directReports, (writer, element) -> writer.writeJson(element));
jsonWriter.writeJsonField("manager", this.manager);
jsonWriter.writeArrayField("memberOf", this.memberOf, (writer, element) -> writer.writeJson(element));
jsonWriter.writeArrayField("transitiveMemberOf", this.transitiveMemberOf,
(writer, element) -> writer.writeJson(element));
if (additionalProperties != null) {
for (Map.Entry additionalProperty : additionalProperties.entrySet()) {
jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue());
}
}
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of MicrosoftGraphOrgContactInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of MicrosoftGraphOrgContactInner 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 MicrosoftGraphOrgContactInner.
*/
public static MicrosoftGraphOrgContactInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
MicrosoftGraphOrgContactInner deserializedMicrosoftGraphOrgContactInner
= new MicrosoftGraphOrgContactInner();
Map additionalProperties = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.withId(reader.getString());
} else if ("deletedDateTime".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.withDeletedDateTime(reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
} else if ("addresses".equals(fieldName)) {
List addresses
= reader.readArray(reader1 -> MicrosoftGraphPhysicalOfficeAddress.fromJson(reader1));
deserializedMicrosoftGraphOrgContactInner.addresses = addresses;
} else if ("companyName".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.companyName = reader.getString();
} else if ("department".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.department = reader.getString();
} else if ("displayName".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.displayName = reader.getString();
} else if ("givenName".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.givenName = reader.getString();
} else if ("jobTitle".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.jobTitle = reader.getString();
} else if ("mail".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.mail = reader.getString();
} else if ("mailNickname".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.mailNickname = reader.getString();
} else if ("onPremisesLastSyncDateTime".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.onPremisesLastSyncDateTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("onPremisesProvisioningErrors".equals(fieldName)) {
List onPremisesProvisioningErrors
= reader.readArray(reader1 -> MicrosoftGraphOnPremisesProvisioningError.fromJson(reader1));
deserializedMicrosoftGraphOrgContactInner.onPremisesProvisioningErrors
= onPremisesProvisioningErrors;
} else if ("onPremisesSyncEnabled".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.onPremisesSyncEnabled
= reader.getNullable(JsonReader::getBoolean);
} else if ("phones".equals(fieldName)) {
List phones
= reader.readArray(reader1 -> MicrosoftGraphPhone.fromJson(reader1));
deserializedMicrosoftGraphOrgContactInner.phones = phones;
} else if ("proxyAddresses".equals(fieldName)) {
List proxyAddresses = reader.readArray(reader1 -> reader1.getString());
deserializedMicrosoftGraphOrgContactInner.proxyAddresses = proxyAddresses;
} else if ("surname".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.surname = reader.getString();
} else if ("directReports".equals(fieldName)) {
List directReports
= reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1));
deserializedMicrosoftGraphOrgContactInner.directReports = directReports;
} else if ("manager".equals(fieldName)) {
deserializedMicrosoftGraphOrgContactInner.manager
= MicrosoftGraphDirectoryObjectInner.fromJson(reader);
} else if ("memberOf".equals(fieldName)) {
List memberOf
= reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1));
deserializedMicrosoftGraphOrgContactInner.memberOf = memberOf;
} else if ("transitiveMemberOf".equals(fieldName)) {
List transitiveMemberOf
= reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1));
deserializedMicrosoftGraphOrgContactInner.transitiveMemberOf = transitiveMemberOf;
} else {
if (additionalProperties == null) {
additionalProperties = new LinkedHashMap<>();
}
additionalProperties.put(fieldName, reader.readUntyped());
}
}
deserializedMicrosoftGraphOrgContactInner.additionalProperties = additionalProperties;
return deserializedMicrosoftGraphOrgContactInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy