schema_salad.dotnet_codegen
===========================

.. py:module:: schema_salad.dotnet_codegen

.. autoapi-nested-parse::

   DotNet code generator for a given schema salad definition.



Attributes
----------

.. autoapisummary::

   schema_salad.dotnet_codegen.prims


Classes
-------

.. autoapisummary::

   schema_salad.dotnet_codegen.DotNetCodeGen


Functions
---------

.. autoapisummary::

   schema_salad.dotnet_codegen.doc_to_doc_string


Module Contents
---------------

.. py:function:: doc_to_doc_string(doc, indent_level = 0)

   Generate a documentation string from a schema salad doc field.


.. py:data:: prims

.. py:class:: DotNetCodeGen(base, examples, target, package)

   Bases: :py:obj:`schema_salad.codegen_base.CodeGenBase`

   .. autoapi-inheritance-diagram:: schema_salad.dotnet_codegen.DotNetCodeGen
      :parts: 1


   Generation of TypeScript code for a given Schema Salad definition.


   .. py:attribute:: target_dir


   .. py:attribute:: main_src_dir


   .. py:attribute:: test_src_dir


   .. py:attribute:: test_resources_dir


   .. py:attribute:: package


   .. py:attribute:: base_uri


   .. py:attribute:: examples


   .. py:attribute:: current_class
      :value: ''



   .. py:attribute:: current_class_is_abstract
      :type:  bool
      :value: False



   .. py:attribute:: current_constructor_signature
      :type:  io.StringIO


   .. py:attribute:: current_constructor_signature_optionals
      :type:  io.StringIO


   .. py:attribute:: current_constructor_body
      :type:  io.StringIO


   .. py:attribute:: current_loader
      :type:  io.StringIO


   .. py:attribute:: current_serializer
      :type:  io.StringIO


   .. py:attribute:: current_fieldtypes
      :type:  dict[str, schema_salad.codegen_base.TypeDef]


   .. py:attribute:: optional_field_names
      :type:  list[str]
      :value: []



   .. py:attribute:: mandatory_field_names
      :type:  list[str]
      :value: []



   .. py:attribute:: idfield
      :type:  str | None
      :value: None



   .. py:attribute:: id_field_type
      :type:  schema_salad.codegen_base.TypeDef | None
      :value: None



   .. py:method:: prologue()

      Trigger to generate the prolouge code.



   .. py:method:: safe_name(name)
      :staticmethod:


      Generate a safe version of the given name.



   .. py:method:: begin_class(classname, extends, doc, abstract, field_names, idfield, optional_fields)

      Produce the header for the given class.



   .. py:method:: end_class(classname, field_names)

      Signal that we are done with this class.



   .. py:method:: type_loader(type_declaration, container = None, no_link_check = None)

      Parse the given type declaration and declare its components.



   .. py:method:: type_loader_enum(type_declaration)

      Build an enum type loader for the given declaration.



   .. py:method:: declare_field(name, fieldtype, doc, optional, subscope)

      Output the code to load the given field.



   .. py:method:: declare_id_field(name, fieldtype, doc, optional)

      Output the code to handle the given ID field.



   .. py:method:: to_dotnet(val)

      Convert a Python keyword to a DotNet keyword.



   .. py:method:: uri_loader(inner, scoped_id, vocab_term, ref_scope, no_link_check = None)

      Construct the TypeDef for the given URI loader.



   .. py:method:: idmap_loader(field, inner, map_subject, map_predicate)

      Construct the TypeDef for the given mapped ID loader.



   .. py:method:: typedsl_loader(inner, ref_scope)

      Construct the TypeDef for the given DSL loader.



   .. py:method:: epilogue(root_loader)

      Trigger to generate the epilouge code.



   .. py:method:: secondaryfilesdsl_loader(inner)

      Construct the TypeDef for secondary files.



