
io.apicurio.registry.rest.client.models.CreateVersion Maven / Gradle / Ivy
package io.apicurio.registry.rest.client.models;
import com.microsoft.kiota.serialization.AdditionalDataHolder;
import com.microsoft.kiota.serialization.Parsable;
import com.microsoft.kiota.serialization.ParseNode;
import com.microsoft.kiota.serialization.SerializationWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@jakarta.annotation.Generated("com.microsoft.kiota")
public class CreateVersion implements AdditionalDataHolder, Parsable {
/**
* Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
*/
private Map additionalData;
/**
* The branches property
*/
private java.util.List branches;
/**
* The content property
*/
private VersionContent content;
/**
* The description property
*/
private String description;
/**
* The isDraft property
*/
private Boolean isDraft;
/**
* User-defined name-value pairs. Name and value must be strings.
*/
private Labels labels;
/**
* The name property
*/
private String name;
/**
* A single version of an artifact. Can be provided by the client when creating a new version,or it can be server-generated. The value can be any string unique to the artifact, but it isrecommended to use a simple integer or a semver value.
*/
private String version;
/**
* Instantiates a new {@link CreateVersion} and sets the default values.
*/
public CreateVersion() {
this.setAdditionalData(new HashMap<>());
}
/**
* 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 CreateVersion}
*/
@jakarta.annotation.Nonnull
public static CreateVersion createFromDiscriminatorValue(@jakarta.annotation.Nonnull final ParseNode parseNode) {
Objects.requireNonNull(parseNode);
return new CreateVersion();
}
/**
* Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
* @return a {@link Map}
*/
@jakarta.annotation.Nonnull
public Map getAdditionalData() {
return this.additionalData;
}
/**
* Gets the branches property value. The branches property
* @return a {@link java.util.List}
*/
@jakarta.annotation.Nullable
public java.util.List getBranches() {
return this.branches;
}
/**
* Gets the content property value. The content property
* @return a {@link VersionContent}
*/
@jakarta.annotation.Nullable
public VersionContent getContent() {
return this.content;
}
/**
* Gets the description property value. The description property
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getDescription() {
return this.description;
}
/**
* The deserialization information for the current model
* @return a {@link Map>}
*/
@jakarta.annotation.Nonnull
public Map> getFieldDeserializers() {
final HashMap> deserializerMap = new HashMap>(7);
deserializerMap.put("branches", (n) -> { this.setBranches(n.getCollectionOfPrimitiveValues(String.class)); });
deserializerMap.put("content", (n) -> { this.setContent(n.getObjectValue(VersionContent::createFromDiscriminatorValue)); });
deserializerMap.put("description", (n) -> { this.setDescription(n.getStringValue()); });
deserializerMap.put("isDraft", (n) -> { this.setIsDraft(n.getBooleanValue()); });
deserializerMap.put("labels", (n) -> { this.setLabels(n.getObjectValue(Labels::createFromDiscriminatorValue)); });
deserializerMap.put("name", (n) -> { this.setName(n.getStringValue()); });
deserializerMap.put("version", (n) -> { this.setVersion(n.getStringValue()); });
return deserializerMap;
}
/**
* Gets the isDraft property value. The isDraft property
* @return a {@link Boolean}
*/
@jakarta.annotation.Nullable
public Boolean getIsDraft() {
return this.isDraft;
}
/**
* Gets the labels property value. User-defined name-value pairs. Name and value must be strings.
* @return a {@link Labels}
*/
@jakarta.annotation.Nullable
public Labels getLabels() {
return this.labels;
}
/**
* Gets the name property value. The name property
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getName() {
return this.name;
}
/**
* Gets the version property value. A single version of an artifact. Can be provided by the client when creating a new version,or it can be server-generated. The value can be any string unique to the artifact, but it isrecommended to use a simple integer or a semver value.
* @return a {@link String}
*/
@jakarta.annotation.Nullable
public String getVersion() {
return this.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);
writer.writeCollectionOfPrimitiveValues("branches", this.getBranches());
writer.writeObjectValue("content", this.getContent());
writer.writeStringValue("description", this.getDescription());
writer.writeBooleanValue("isDraft", this.getIsDraft());
writer.writeObjectValue("labels", this.getLabels());
writer.writeStringValue("name", this.getName());
writer.writeStringValue("version", this.getVersion());
writer.writeAdditionalData(this.getAdditionalData());
}
/**
* Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
* @param value Value to set for the AdditionalData property.
*/
public void setAdditionalData(@jakarta.annotation.Nullable final Map value) {
this.additionalData = value;
}
/**
* Sets the branches property value. The branches property
* @param value Value to set for the branches property.
*/
public void setBranches(@jakarta.annotation.Nullable final java.util.List value) {
this.branches = value;
}
/**
* Sets the content property value. The content property
* @param value Value to set for the content property.
*/
public void setContent(@jakarta.annotation.Nullable final VersionContent value) {
this.content = value;
}
/**
* Sets the description property value. The description property
* @param value Value to set for the description property.
*/
public void setDescription(@jakarta.annotation.Nullable final String value) {
this.description = value;
}
/**
* Sets the isDraft property value. The isDraft property
* @param value Value to set for the isDraft property.
*/
public void setIsDraft(@jakarta.annotation.Nullable final Boolean value) {
this.isDraft = value;
}
/**
* Sets the labels property value. User-defined name-value pairs. Name and value must be strings.
* @param value Value to set for the labels property.
*/
public void setLabels(@jakarta.annotation.Nullable final Labels value) {
this.labels = value;
}
/**
* Sets the name property value. The name property
* @param value Value to set for the name property.
*/
public void setName(@jakarta.annotation.Nullable final String value) {
this.name = value;
}
/**
* Sets the version property value. A single version of an artifact. Can be provided by the client when creating a new version,or it can be server-generated. The value can be any string unique to the artifact, but it isrecommended to use a simple integer or a semver value.
* @param value Value to set for the version property.
*/
public void setVersion(@jakarta.annotation.Nullable final String value) {
this.version = value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy