/* autogenerated file */
#ifndef OCI_IMAGE_MANIFEST_SCHEMA_H
# define OCI_IMAGE_MANIFEST_SCHEMA_H

# include <sys/types.h>
# include <stdint.h>
# include "json_common.h"

typedef string_cells oci_image_manifest_config_annotations;

typedef struct {
    char *media_type;

    int64_t size;

    char *digest;

    char **urls;
    size_t urls_len;

    oci_image_manifest_config_annotations *annotations;

    unsigned int size_present : 1;
}
oci_image_manifest_config;

void free_oci_image_manifest_config (oci_image_manifest_config *ptr);

oci_image_manifest_config *make_oci_image_manifest_config (yajl_val tree, struct parser_context *ctx, parser_error *err);

bool gen_oci_image_manifest_config (yajl_gen g, oci_image_manifest_config *ptr, struct parser_context *ctx, parser_error *err);

typedef string_cells oci_image_manifest_layers_annotations;

typedef struct {
    char *media_type;
    int64_t size;
    char *digest;
    char **urls;
    size_t urls_len;

    oci_image_manifest_layers_annotations *annotations;
    unsigned int size_present : 1;
}
oci_image_manifest_layers_element;

void free_oci_image_manifest_layers_element (oci_image_manifest_layers_element *ptr);

oci_image_manifest_layers_element *make_oci_image_manifest_layers_element (yajl_val tree, struct parser_context *ctx, parser_error *err);

typedef string_cells oci_image_manifest_annotations;

typedef struct {
    int schema_version;

    oci_image_manifest_config *config;

    oci_image_manifest_layers_element **layers;
    size_t layers_len;

    oci_image_manifest_annotations *annotations;

    unsigned int schema_version_present : 1;
}
oci_image_manifest;

void free_oci_image_manifest (oci_image_manifest *ptr);

oci_image_manifest *make_oci_image_manifest (yajl_val tree, struct parser_context *ctx, parser_error *err);

bool gen_oci_image_manifest (yajl_gen g, oci_image_manifest *ptr, struct parser_context *ctx, parser_error *err);

oci_image_manifest *oci_image_manifest_parse_file (const char *filename, struct parser_context *ctx, parser_error *err);

oci_image_manifest *oci_image_manifest_parse_file_stream (FILE *stream, struct parser_context *ctx, parser_error *err);

oci_image_manifest *oci_image_manifest_parse_data (const char *jsondata, struct parser_context *ctx, parser_error *err);

char *oci_image_manifest_generate_json (oci_image_manifest *ptr, struct parser_context *ctx, parser_error *err);

#endif
