All Downloads are FREE. Search and download functionalities are using the official Maven repository.

swift-combine.modelObject.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
{{#isDeprecated}}
@available(*, deprecated, message: "Deprecated API parameter")
{{/isDeprecated}}
public struct {{{classname}}}: Codable {
{{#allVars}}
{{#isEnum}}
{{> modelInlineEnumDeclaration}}
{{/isEnum}}
{{/allVars}}
{{#allVars}}
{{#isEnum}}
    {{#description}}/// {{{.}}}
    {{/description}}public var {{{name}}}: {{{datatypeWithEnum}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}
{{/isEnum}}
{{^isEnum}}
    {{#description}}/// {{{.}}}
    {{/description}}public var {{{name}}}: {{{datatype}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}
{{/isEnum}}
{{/allVars}}
{{#hasVars}}

    public init({{#allVars}}{{{name}}}: {{{datatypeWithEnum}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{^defaultValue}}{{^required}} = nil{{/required}}{{/defaultValue}}{{^-last}}, {{/-last}}{{/allVars}}) {
        {{#allVars}}
        self.{{{name}}} = {{{name}}}
        {{/allVars}}
    }
{{/hasVars}}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy