odata.msgraph.client.beta.entity.AndroidManagedStoreAppConfigurationSchema Maven / Gradle / Ivy
Show all versions of odata-client-msgraph-beta Show documentation
package odata.msgraph.client.beta.entity;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.github.davidmoten.odata.client.ClientException;
import com.github.davidmoten.odata.client.CollectionPage;
import com.github.davidmoten.odata.client.HttpRequestOptions;
import com.github.davidmoten.odata.client.NameValue;
import com.github.davidmoten.odata.client.ODataEntityType;
import com.github.davidmoten.odata.client.RequestOptions;
import com.github.davidmoten.odata.client.UnmappedFields;
import com.github.davidmoten.odata.client.Util;
import com.github.davidmoten.odata.client.annotation.Property;
import com.github.davidmoten.odata.client.internal.ChangedFields;
import com.github.davidmoten.odata.client.internal.RequestHelper;
import com.github.davidmoten.odata.client.internal.UnmappedFieldsImpl;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import odata.msgraph.client.beta.complex.AndroidManagedStoreAppConfigurationSchemaItem;
/**
* “Schema describing an Android application's custom configurations.”
*/@JsonPropertyOrder({
"@odata.type",
"exampleJson",
"nestedSchemaItems",
"schemaItems"})
@JsonInclude(Include.NON_NULL)
public class AndroidManagedStoreAppConfigurationSchema extends Entity implements ODataEntityType {
@Override
public String odataTypeName() {
return "microsoft.graph.androidManagedStoreAppConfigurationSchema";
}
@JsonProperty("exampleJson")
protected byte[] exampleJson;
@JsonProperty("nestedSchemaItems")
protected List nestedSchemaItems;
@JsonProperty("nestedSchemaItems@nextLink")
protected String nestedSchemaItemsNextLink;
@JsonProperty("schemaItems")
protected List schemaItems;
@JsonProperty("schemaItems@nextLink")
protected String schemaItemsNextLink;
protected AndroidManagedStoreAppConfigurationSchema() {
super();
}
/**
* Returns a builder which is used to create a new
* instance of this class (given that this class is immutable).
*
* @return a new Builder for this class
*/
// Suffix used on builder factory method to differentiate the method
// from static builder methods on superclasses
public static Builder builderAndroidManagedStoreAppConfigurationSchema() {
return new Builder();
}
public static final class Builder {
private String id;
private byte[] exampleJson;
private List nestedSchemaItems;
private String nestedSchemaItemsNextLink;
private List schemaItems;
private String schemaItemsNextLink;
private ChangedFields changedFields = ChangedFields.EMPTY;
Builder() {
// prevent instantiation
}
public Builder id(String id) {
this.id = id;
this.changedFields = changedFields.add("id");
return this;
}
/**
* “UTF8 encoded byte array containing example JSON string conforming to this schema
* that demonstrates how to set the configuration for this app”
*
* @param exampleJson
* value of {@code exampleJson} property (as defined in service metadata)
* @return {@code this} (for method chaining)
*/
public Builder exampleJson(byte[] exampleJson) {
this.exampleJson = exampleJson;
this.changedFields = changedFields.add("exampleJson");
return this;
}
/**
* “Collection of items each representing a named configuration option in the schema
* . It contains a flat list of all configuration.”
*
* @param nestedSchemaItems
* value of {@code nestedSchemaItems} property (as defined in service metadata)
* @return {@code this} (for method chaining)
*/
public Builder nestedSchemaItems(List nestedSchemaItems) {
this.nestedSchemaItems = nestedSchemaItems;
this.changedFields = changedFields.add("nestedSchemaItems");
return this;
}
/**
* “Collection of items each representing a named configuration option in the schema
* . It contains a flat list of all configuration.”
*
* @param nestedSchemaItems
* value of {@code nestedSchemaItems} property (as defined in service metadata)
* @return {@code this} (for method chaining)
*/
public Builder nestedSchemaItems(AndroidManagedStoreAppConfigurationSchemaItem... nestedSchemaItems) {
return nestedSchemaItems(Arrays.asList(nestedSchemaItems));
}
/**
* “Collection of items each representing a named configuration option in the schema
* . It contains a flat list of all configuration.”
*
* @param nestedSchemaItemsNextLink
* value of {@code nestedSchemaItems@nextLink} property (as defined in service metadata)
* @return {@code this} (for method chaining)
*/
public Builder nestedSchemaItemsNextLink(String nestedSchemaItemsNextLink) {
this.nestedSchemaItemsNextLink = nestedSchemaItemsNextLink;
this.changedFields = changedFields.add("nestedSchemaItems");
return this;
}
/**
* “Collection of items each representing a named configuration option in the schema
* . It only contains the root-level configuration.”
*
* @param schemaItems
* value of {@code schemaItems} property (as defined in service metadata)
* @return {@code this} (for method chaining)
*/
public Builder schemaItems(List schemaItems) {
this.schemaItems = schemaItems;
this.changedFields = changedFields.add("schemaItems");
return this;
}
/**
* “Collection of items each representing a named configuration option in the schema
* . It only contains the root-level configuration.”
*
* @param schemaItems
* value of {@code schemaItems} property (as defined in service metadata)
* @return {@code this} (for method chaining)
*/
public Builder schemaItems(AndroidManagedStoreAppConfigurationSchemaItem... schemaItems) {
return schemaItems(Arrays.asList(schemaItems));
}
/**
* “Collection of items each representing a named configuration option in the schema
* . It only contains the root-level configuration.”
*
* @param schemaItemsNextLink
* value of {@code schemaItems@nextLink} property (as defined in service metadata)
* @return {@code this} (for method chaining)
*/
public Builder schemaItemsNextLink(String schemaItemsNextLink) {
this.schemaItemsNextLink = schemaItemsNextLink;
this.changedFields = changedFields.add("schemaItems");
return this;
}
public AndroidManagedStoreAppConfigurationSchema build() {
AndroidManagedStoreAppConfigurationSchema _x = new AndroidManagedStoreAppConfigurationSchema();
_x.contextPath = null;
_x.changedFields = changedFields;
_x.unmappedFields = new UnmappedFieldsImpl();
_x.odataType = "microsoft.graph.androidManagedStoreAppConfigurationSchema";
_x.id = id;
_x.exampleJson = exampleJson;
_x.nestedSchemaItems = nestedSchemaItems;
_x.nestedSchemaItemsNextLink = nestedSchemaItemsNextLink;
_x.schemaItems = schemaItems;
_x.schemaItemsNextLink = schemaItemsNextLink;
return _x;
}
}
@Override
@JsonIgnore
public ChangedFields getChangedFields() {
return changedFields;
}
@Override
public void postInject(boolean addKeysToContextPath) {
if (addKeysToContextPath && id != null) {
contextPath = contextPath.clearQueries().addKeys(new NameValue(id.toString()));
}
}
/**
* “UTF8 encoded byte array containing example JSON string conforming to this schema
* that demonstrates how to set the configuration for this app”
*
* @return property exampleJson
*/
@Property(name="exampleJson")
@JsonIgnore
public Optional getExampleJson() {
return Optional.ofNullable(exampleJson);
}
/**
* Returns an immutable copy of {@code this} with just the {@code exampleJson}
* field changed. Field description below. The field name is also added to an
* internal map of changed fields in the returned object so that when {@code this.
* patch()} is called (if available)on the returned object only the changed fields
* are submitted.
*
* “UTF8 encoded byte array containing example JSON string conforming to this schema
* that demonstrates how to set the configuration for this app”
*
* @param exampleJson
* new value of {@code exampleJson} field (as defined in service metadata)
* @return immutable copy of {@code this} with just the {@code exampleJson} field changed
*/
public AndroidManagedStoreAppConfigurationSchema withExampleJson(byte[] exampleJson) {
AndroidManagedStoreAppConfigurationSchema _x = _copy();
_x.changedFields = changedFields.add("exampleJson");
_x.odataType = Util.nvl(odataType, "microsoft.graph.androidManagedStoreAppConfigurationSchema");
_x.exampleJson = exampleJson;
return _x;
}
/**
* “Collection of items each representing a named configuration option in the schema
* . It contains a flat list of all configuration.”
*
* @return property nestedSchemaItems
*/
@Property(name="nestedSchemaItems")
@JsonIgnore
public CollectionPage getNestedSchemaItems() {
return new CollectionPage(contextPath, AndroidManagedStoreAppConfigurationSchemaItem.class, this.nestedSchemaItems, Optional.ofNullable(nestedSchemaItemsNextLink), Collections.emptyList(), HttpRequestOptions.EMPTY);
}
/**
* Returns an immutable copy of {@code this} with just the {@code nestedSchemaItems
* } field changed. Field description below. The field name is also added to an
* internal map of changed fields in the returned object so that when {@code this.
* patch()} is called (if available)on the returned object only the changed fields
* are submitted.
*
* “Collection of items each representing a named configuration option in the schema
* . It contains a flat list of all configuration.”
*
* @param nestedSchemaItems
* new value of {@code nestedSchemaItems} field (as defined in service metadata)
* @return immutable copy of {@code this} with just the {@code nestedSchemaItems} field changed
*/
public AndroidManagedStoreAppConfigurationSchema withNestedSchemaItems(List nestedSchemaItems) {
AndroidManagedStoreAppConfigurationSchema _x = _copy();
_x.changedFields = changedFields.add("nestedSchemaItems");
_x.odataType = Util.nvl(odataType, "microsoft.graph.androidManagedStoreAppConfigurationSchema");
_x.nestedSchemaItems = nestedSchemaItems;
return _x;
}
/**
* “Collection of items each representing a named configuration option in the schema
* . It contains a flat list of all configuration.”
*
* @param options
* specify connect and read timeouts
* @return property nestedSchemaItems
*/
@Property(name="nestedSchemaItems")
@JsonIgnore
public CollectionPage getNestedSchemaItems(HttpRequestOptions options) {
return new CollectionPage(contextPath, AndroidManagedStoreAppConfigurationSchemaItem.class, this.nestedSchemaItems, Optional.ofNullable(nestedSchemaItemsNextLink), Collections.emptyList(), options);
}
/**
* “Collection of items each representing a named configuration option in the schema
* . It only contains the root-level configuration.”
*
* @return property schemaItems
*/
@Property(name="schemaItems")
@JsonIgnore
public CollectionPage getSchemaItems() {
return new CollectionPage(contextPath, AndroidManagedStoreAppConfigurationSchemaItem.class, this.schemaItems, Optional.ofNullable(schemaItemsNextLink), Collections.emptyList(), HttpRequestOptions.EMPTY);
}
/**
* Returns an immutable copy of {@code this} with just the {@code schemaItems}
* field changed. Field description below. The field name is also added to an
* internal map of changed fields in the returned object so that when {@code this.
* patch()} is called (if available)on the returned object only the changed fields
* are submitted.
*
* “Collection of items each representing a named configuration option in the schema
* . It only contains the root-level configuration.”
*
* @param schemaItems
* new value of {@code schemaItems} field (as defined in service metadata)
* @return immutable copy of {@code this} with just the {@code schemaItems} field changed
*/
public AndroidManagedStoreAppConfigurationSchema withSchemaItems(List schemaItems) {
AndroidManagedStoreAppConfigurationSchema _x = _copy();
_x.changedFields = changedFields.add("schemaItems");
_x.odataType = Util.nvl(odataType, "microsoft.graph.androidManagedStoreAppConfigurationSchema");
_x.schemaItems = schemaItems;
return _x;
}
/**
* “Collection of items each representing a named configuration option in the schema
* . It only contains the root-level configuration.”
*
* @param options
* specify connect and read timeouts
* @return property schemaItems
*/
@Property(name="schemaItems")
@JsonIgnore
public CollectionPage getSchemaItems(HttpRequestOptions options) {
return new CollectionPage(contextPath, AndroidManagedStoreAppConfigurationSchemaItem.class, this.schemaItems, Optional.ofNullable(schemaItemsNextLink), Collections.emptyList(), options);
}
public AndroidManagedStoreAppConfigurationSchema withUnmappedField(String name, String value) {
AndroidManagedStoreAppConfigurationSchema _x = _copy();
_x.setUnmappedField(name, value);
return _x;
}
@JsonAnySetter
private void setUnmappedField(String name, Object value) {
if (unmappedFields == null) {
unmappedFields = new UnmappedFieldsImpl();
}
unmappedFields.put(name, value);
}
@JsonAnyGetter
private UnmappedFieldsImpl unmappedFields() {
return unmappedFields == null ? UnmappedFieldsImpl.EMPTY : unmappedFields;
}
@Override
public UnmappedFields getUnmappedFields() {
return unmappedFields();
}
/**
* Submits only changed fields for update and returns an
* immutable copy of {@code this} with changed fields reset.
*
* @return a copy of {@code this} with changed fields reset
* @throws ClientException if HTTP response is not as expected
*/
public AndroidManagedStoreAppConfigurationSchema patch() {
RequestHelper.patch(this, contextPath, RequestOptions.EMPTY);
AndroidManagedStoreAppConfigurationSchema _x = _copy();
_x.changedFields = null;
return _x;
}
/**
* Submits all fields for update and returns an immutable copy of {@code this}
* with changed fields reset (they were ignored anyway).
*
* @return a copy of {@code this} with changed fields reset
* @throws ClientException if HTTP response is not as expected
*/
public AndroidManagedStoreAppConfigurationSchema put() {
RequestHelper.put(this, contextPath, RequestOptions.EMPTY);
AndroidManagedStoreAppConfigurationSchema _x = _copy();
_x.changedFields = null;
return _x;
}
private AndroidManagedStoreAppConfigurationSchema _copy() {
AndroidManagedStoreAppConfigurationSchema _x = new AndroidManagedStoreAppConfigurationSchema();
_x.contextPath = contextPath;
_x.changedFields = changedFields;
_x.unmappedFields = unmappedFields.copy();
_x.odataType = odataType;
_x.id = id;
_x.exampleJson = exampleJson;
_x.nestedSchemaItems = nestedSchemaItems;
_x.schemaItems = schemaItems;
return _x;
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("AndroidManagedStoreAppConfigurationSchema[");
b.append("id=");
b.append(this.id);
b.append(", ");
b.append("exampleJson=");
b.append(this.exampleJson);
b.append(", ");
b.append("nestedSchemaItems=");
b.append(this.nestedSchemaItems);
b.append(", ");
b.append("schemaItems=");
b.append(this.schemaItems);
b.append("]");
b.append(",unmappedFields=");
b.append(unmappedFields);
b.append(",odataType=");
b.append(odataType);
return b.toString();
}
}