github.com/oam-dev/kubevela@v1.9.11/pkg/definition/gen_sdk/openapi-generator/templates/go/model_doc.mustache (about)

     1  {{#models}}{{#model}}# {{classname}}
     2  
     3  {{^isEnum}}
     4  ## Properties
     5  
     6  Name | Type | Description | Notes
     7  ------------ | ------------- | ------------- | -------------
     8  {{#vendorExtensions.x-is-one-of-interface}}
     9  **{{classname}}Interface** | **interface { {{#discriminator}}{{propertyGetter}}() {{propertyType}}{{/discriminator}} }** | An interface that can hold any of the proper implementing types |
    10  {{/vendorExtensions.x-is-one-of-interface}}
    11  {{^vendorExtensions.x-is-one-of-interface}}
    12  {{#vars}}**{{name}}** | {{^required}}Pointer to {{/required}}{{#isContainer}}{{#isArray}}{{#items}}{{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**[]{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{dataType}}.md){{/isFile}}{{/isPrimitiveType}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**map[string]{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}}{{^isFile}}{{^isDateTime}}[{{/isDateTime}}{{/isFile}}{{/isPrimitiveType}}**{{dataType}}**{{^isPrimitiveType}}{{^isFile}}{{^isDateTime}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isDateTime}}{{/isFile}}{{/isPrimitiveType}}{{/isContainer}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
    13  {{/vars}}
    14  {{/vendorExtensions.x-is-one-of-interface}}
    15  
    16  ## Methods
    17  
    18  {{^vendorExtensions.x-is-one-of-interface}}
    19  ### New{{classname}}
    20  
    21  `func New{{classname}}({{#vars}}{{#required}}{{nameInCamelCase}} {{dataType}}, {{/required}}{{/vars}}) *{{classname}}`
    22  
    23  New{{classname}} instantiates a new {{classname}} object
    24  This constructor will assign default values to properties that have it defined,
    25  and makes sure properties required by API are set, but the set of arguments
    26  will change when the set of required properties is changed
    27  
    28  ### New{{classname}}WithDefaults
    29  
    30  `func New{{classname}}WithDefaults() *{{classname}}`
    31  
    32  New{{classname}}WithDefaults instantiates a new {{classname}} object
    33  This constructor will only assign default values to properties that have it defined,
    34  but it doesn't guarantee that properties required by API are set
    35  
    36  {{#vars}}
    37  ### Get{{name}}
    38  
    39  `func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}}`
    40  
    41  Get{{name}} returns the {{name}} field if non-nil, zero value otherwise.
    42  
    43  ### Get{{name}}Ok
    44  
    45  `func (o *{{classname}}) Get{{name}}Ok() (*{{vendorExtensions.x-go-base-type}}, bool)`
    46  
    47  Get{{name}}Ok returns a tuple with the {{name}} field if it's non-nil, zero value otherwise
    48  and a boolean to check if the value has been set.
    49  
    50  ### Set{{name}}
    51  
    52  `func (o *{{classname}}) Set{{name}}(v {{vendorExtensions.x-go-base-type}})`
    53  
    54  Set{{name}} sets {{name}} field to given value.
    55  
    56  {{^required}}
    57  ### Has{{name}}
    58  
    59  `func (o *{{classname}}) Has{{name}}() bool`
    60  
    61  Has{{name}} returns a boolean if a field has been set.
    62  {{/required}}
    63  
    64  {{#isNullable}}
    65  ### Set{{name}}Nil
    66  
    67  `func (o *{{classname}}) Set{{name}}Nil(b bool)`
    68  
    69   Set{{name}}Nil sets the value for {{name}} to be an explicit nil
    70  
    71  ### Unset{{name}}
    72  `func (o *{{classname}}) Unset{{name}}()`
    73  
    74  Unset{{name}} ensures that no value is present for {{name}}, not even an explicit nil
    75  {{/isNullable}}
    76  {{/vars}}
    77  {{#vendorExtensions.x-implements}}
    78  
    79  ### As{{{.}}}
    80  
    81  `func (s *{{classname}}) As{{{.}}}() {{{.}}}`
    82  
    83  Convenience method to wrap this instance of {{classname}} in {{{.}}}
    84  {{/vendorExtensions.x-implements}}
    85  {{/vendorExtensions.x-is-one-of-interface}}
    86  {{/isEnum}}
    87  {{#isEnum}}
    88  ## Enum
    89  
    90  {{#allowableValues}}{{#enumVars}}
    91  * `{{name}}` (value: `{{{value}}}`)
    92  {{/enumVars}}{{/allowableValues}}
    93  {{/isEnum}}
    94  
    95  [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
    96  
    97  {{/model}}{{/models}}