<commit_before>{{ header }}

package {{ package_name }};

{%- for child_api in specification.child_apis %}
{%- set child_spec = specification_set[child_api.rest_name] %}
import {{ package_name }}.fetchers.{{ child_spec.entity_name_plural }}Fetcher;
{% endfor -%}
import net.nuagenetworks.bambou.RestException;
import net.nuagenetworks.bambou.annotation.RestEntity;
import net.nuagenetworks.vro.model.{{ superclass_name }};
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
{%- if specification.attributes|length > 0 %} 
import com.fasterxml.jackson.annotation.JsonProperty;
{% endif -%}
{%- if specification.child_apis|length > 0 %}
import com.fasterxml.jackson.annotation.JsonIgnore;
{%- endif %}
import com.vmware.o11n.plugin.sdk.annotation.VsoConstructor;
import com.vmware.o11n.plugin.sdk.annotation.VsoFinder;
import com.vmware.o11n.plugin.sdk.annotation.VsoMethod;
import com.vmware.o11n.plugin.sdk.annotation.VsoObject;
import com.vmware.o11n.plugin.sdk.annotation.VsoProperty;
import com.vmware.o11n.plugin.sdk.annotation.VsoRelation;

@VsoFinder(name = Constants.{{ specification.entity_name | upper }}, datasource = Constants.DATASOURCE, image = Constants.{{ specification.entity_name | upper }}_IMAGE_FILENAME, idAccessor = Constants.ID_ACCESSOR, relations = {
{%- for child_api in specification.child_apis %}
{%- set child_spec = specification_set[child_api.rest_name] %}
{%- if ((child_api.allows_get and child_api.allows_create) or child_spec.entity_name in entity_includes) and (not child_spec.entity_name in entity_excludes) %}
        @VsoRelation(inventoryChildren = true, name = Constants.{{ child_spec.entity_name_plural | upper }}_FETCHER, type = Constants.{{ child_spec.entity_name_plural | upper }}_FETCHER){% if not loop.last %}, {% endif %}
{% endif -%}
{% endfor -%}
})
@VsoObject(create = false, strict = true)
@JsonIgnoreProperties(ignoreUnknown = true)
@RestEntity(restName = "{{ specification.rest_name }}", resourceName = "{{ specification.resource_name }}")
public class {{ specification.entity_name }} extends {{ superclass_name }} {

    {%- for attribute in specification.attributes %}
    {%- if attribute.type == "enum" or attribute.subtype == "enum" %}
    {%- set field_name = attribute.local_name[0:1].upper() + attribute.local_name[1:] %}
    @VsoFinder(name = Constants.{{ specification.entity_name | upper }}_{{ attribute.local_name | upper }}_ENUM, datasource = Constants.DATASOURCE, idAccessor = Constants.ID_ACCESSOR)
    @VsoObject(strict = true)
    public enum {{ field_name }} {

        {% for choice in attribute.allowed_choices %}{{ choice }}("{{ loop.index }}", "{{ choice }}"){% if not loop.last %}, {% endif %}{% endfor %};

        private final String id;
        private final String name;
   
        {{ field_name }}(String id, String name) {
            this.id = id;
            this.name = name;
         }
   
        @VsoProperty(displayName = "Id", readOnly = true)
        public String getId() {
            return id;
        }
   
        @VsoProperty(displayName = "Name", readOnly = true)
        public String getName() {<commit_msg>Added support for object serialization<commit_after>{{ header }}

package {{ package_name }};

{%- for child_api in specification.child_apis %}
{%- set child_spec = specification_set[child_api.rest_name] %}
import {{ package_name }}.fetchers.{{ child_spec.entity_name_plural }}Fetcher;
{% endfor -%}
import net.nuagenetworks.bambou.RestException;
import net.nuagenetworks.bambou.annotation.RestEntity;
import net.nuagenetworks.vro.model.{{ superclass_name }};
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
{%- if specification.attributes|length > 0 %} 
import com.fasterxml.jackson.annotation.JsonProperty;
{% endif -%}
{%- if specification.child_apis|length > 0 %}
import com.fasterxml.jackson.annotation.JsonIgnore;
{%- endif %}
import com.vmware.o11n.plugin.sdk.annotation.VsoConstructor;
import com.vmware.o11n.plugin.sdk.annotation.VsoFinder;
import com.vmware.o11n.plugin.sdk.annotation.VsoMethod;
import com.vmware.o11n.plugin.sdk.annotation.VsoObject;
import com.vmware.o11n.plugin.sdk.annotation.VsoProperty;
import com.vmware.o11n.plugin.sdk.annotation.VsoRelation;

@VsoFinder(name = Constants.{{ specification.entity_name | upper }}, datasource = Constants.DATASOURCE, image = Constants.{{ specification.entity_name | upper }}_IMAGE_FILENAME, idAccessor = Constants.ID_ACCESSOR, relations = {
{%- for child_api in specification.child_apis %}
{%- set child_spec = specification_set[child_api.rest_name] %}
{%- if ((child_api.allows_get and child_api.allows_create) or child_spec.entity_name in entity_includes) and (not child_spec.entity_name in entity_excludes) %}
        @VsoRelation(inventoryChildren = true, name = Constants.{{ child_spec.entity_name_plural | upper }}_FETCHER, type = Constants.{{ child_spec.entity_name_plural | upper }}_FETCHER){% if not loop.last %}, {% endif %}
{% endif -%}
{% endfor -%}
})
@VsoObject(create = false, strict = true)
@JsonIgnoreProperties(ignoreUnknown = true)
@RestEntity(restName = "{{ specification.rest_name }}", resourceName = "{{ specification.resource_name }}")
public class {{ specification.entity_name }} extends {{ superclass_name }} {

    private static final long serialVersionUID = 1L;

    {% for attribute in specification.attributes %}
    {%- if attribute.type == "enum" or attribute.subtype == "enum" %}
    {%- set field_name = attribute.local_name[0:1].upper() + attribute.local_name[1:] %}
    @VsoFinder(name = Constants.{{ specification.entity_name | upper }}_{{ attribute.local_name | upper }}_ENUM, datasource = Constants.DATASOURCE, idAccessor = Constants.ID_ACCESSOR)
    @VsoObject(strict = true)
    public enum {{ field_name }} {

        {% for choice in attribute.allowed_choices %}{{ choice }}("{{ loop.index }}", "{{ choice }}"){% if not loop.last %}, {% endif %}{% endfor %};

        private final String id;
        private final String name;
   
        {{ field_name }}(String id, String name) {
            this.id = id;
            this.name = name;
         }
   
        @VsoProperty(displayName = "Id", readOnly = true)
        public String getId() {
            return id;
        }
   
        @VsoProperty(displayName = "Name", readOnly = true)
        public String getName() {
{'fraction_non_alphanumeric': 0.13917036098796706, 'fraction_numerical': 0.005541481950601647, 'mean_word_length': 4.344331641285956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1919649', 'n_tokens_mistral': 2102, 'n_tokens_neox': 1947, 'n_words': 394}