diff --git a/go-client/api/openapi.yaml b/go-client/api/openapi.yaml index aa8c79e..c6f3d01 100644 --- a/go-client/api/openapi.yaml +++ b/go-client/api/openapi.yaml @@ -373,11 +373,6 @@ components: thumbnail: description: URL of the post thumbnail. type: string - required: - - content - - summary - - thumbnail - - title type: object ICreateUserRequestDTO: example: diff --git a/go-client/docs/IUpdatePostRequestDTO.md b/go-client/docs/IUpdatePostRequestDTO.md index f1090d9..3ea1e6d 100644 --- a/go-client/docs/IUpdatePostRequestDTO.md +++ b/go-client/docs/IUpdatePostRequestDTO.md @@ -4,16 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Title** | **string** | Title of the post. | -**Summary** | **string** | Summary of the post. | -**Content** | **string** | Content of the post. | -**Thumbnail** | **string** | URL of the post thumbnail. | +**Title** | Pointer to **string** | Title of the post. | [optional] +**Summary** | Pointer to **string** | Summary of the post. | [optional] +**Content** | Pointer to **string** | Content of the post. | [optional] +**Thumbnail** | Pointer to **string** | URL of the post thumbnail. | [optional] ## Methods ### NewIUpdatePostRequestDTO -`func NewIUpdatePostRequestDTO(title string, summary string, content string, thumbnail string, ) *IUpdatePostRequestDTO` +`func NewIUpdatePostRequestDTO() *IUpdatePostRequestDTO` NewIUpdatePostRequestDTO instantiates a new IUpdatePostRequestDTO object This constructor will assign default values to properties that have it defined, @@ -47,6 +47,11 @@ and a boolean to check if the value has been set. SetTitle sets Title field to given value. +### HasTitle + +`func (o *IUpdatePostRequestDTO) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. ### GetSummary @@ -67,6 +72,11 @@ and a boolean to check if the value has been set. SetSummary sets Summary field to given value. +### HasSummary + +`func (o *IUpdatePostRequestDTO) HasSummary() bool` + +HasSummary returns a boolean if a field has been set. ### GetContent @@ -87,6 +97,11 @@ and a boolean to check if the value has been set. SetContent sets Content field to given value. +### HasContent + +`func (o *IUpdatePostRequestDTO) HasContent() bool` + +HasContent returns a boolean if a field has been set. ### GetThumbnail @@ -107,6 +122,11 @@ and a boolean to check if the value has been set. SetThumbnail sets Thumbnail field to given value. +### HasThumbnail + +`func (o *IUpdatePostRequestDTO) HasThumbnail() bool` + +HasThumbnail returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/go-client/docs/PostAPI.md b/go-client/docs/PostAPI.md index c0ce0b8..a698365 100644 --- a/go-client/docs/PostAPI.md +++ b/go-client/docs/PostAPI.md @@ -237,7 +237,7 @@ import ( func main() { id := "id_example" // string | Post id. - iUpdatePostRequestDTO := *openapiclient.NewIUpdatePostRequestDTO("Title_example", "Summary_example", "Content_example", "Thumbnail_example") // IUpdatePostRequestDTO | + iUpdatePostRequestDTO := *openapiclient.NewIUpdatePostRequestDTO() // IUpdatePostRequestDTO | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) diff --git a/go-client/model_i_update_post_request_dto.go b/go-client/model_i_update_post_request_dto.go index e919388..3804158 100644 --- a/go-client/model_i_update_post_request_dto.go +++ b/go-client/model_i_update_post_request_dto.go @@ -12,8 +12,6 @@ package openapi import ( "encoding/json" - "bytes" - "fmt" ) // checks if the IUpdatePostRequestDTO type satisfies the MappedNullable interface at compile time @@ -22,27 +20,21 @@ var _ MappedNullable = &IUpdatePostRequestDTO{} // IUpdatePostRequestDTO struct for IUpdatePostRequestDTO type IUpdatePostRequestDTO struct { // Title of the post. - Title string `json:"title"` + Title *string `json:"title,omitempty"` // Summary of the post. - Summary string `json:"summary"` + Summary *string `json:"summary,omitempty"` // Content of the post. - Content string `json:"content"` + Content *string `json:"content,omitempty"` // URL of the post thumbnail. - Thumbnail string `json:"thumbnail"` + Thumbnail *string `json:"thumbnail,omitempty"` } -type _IUpdatePostRequestDTO IUpdatePostRequestDTO - // NewIUpdatePostRequestDTO instantiates a new IUpdatePostRequestDTO object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewIUpdatePostRequestDTO(title string, summary string, content string, thumbnail string) *IUpdatePostRequestDTO { +func NewIUpdatePostRequestDTO() *IUpdatePostRequestDTO { this := IUpdatePostRequestDTO{} - this.Title = title - this.Summary = summary - this.Content = content - this.Thumbnail = thumbnail return &this } @@ -54,100 +46,132 @@ func NewIUpdatePostRequestDTOWithDefaults() *IUpdatePostRequestDTO { return &this } -// GetTitle returns the Title field value +// GetTitle returns the Title field value if set, zero value otherwise. func (o *IUpdatePostRequestDTO) GetTitle() string { - if o == nil { + if o == nil || IsNil(o.Title) { var ret string return ret } - - return o.Title + return *o.Title } -// GetTitleOk returns a tuple with the Title field value +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IUpdatePostRequestDTO) GetTitleOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Title) { return nil, false } - return &o.Title, true + return o.Title, true } -// SetTitle sets field value +// HasTitle returns a boolean if a field has been set. +func (o *IUpdatePostRequestDTO) HasTitle() bool { + if o != nil && !IsNil(o.Title) { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. func (o *IUpdatePostRequestDTO) SetTitle(v string) { - o.Title = v + o.Title = &v } -// GetSummary returns the Summary field value +// GetSummary returns the Summary field value if set, zero value otherwise. func (o *IUpdatePostRequestDTO) GetSummary() string { - if o == nil { + if o == nil || IsNil(o.Summary) { var ret string return ret } - - return o.Summary + return *o.Summary } -// GetSummaryOk returns a tuple with the Summary field value +// GetSummaryOk returns a tuple with the Summary field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IUpdatePostRequestDTO) GetSummaryOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Summary) { return nil, false } - return &o.Summary, true + return o.Summary, true +} + +// HasSummary returns a boolean if a field has been set. +func (o *IUpdatePostRequestDTO) HasSummary() bool { + if o != nil && !IsNil(o.Summary) { + return true + } + + return false } -// SetSummary sets field value +// SetSummary gets a reference to the given string and assigns it to the Summary field. func (o *IUpdatePostRequestDTO) SetSummary(v string) { - o.Summary = v + o.Summary = &v } -// GetContent returns the Content field value +// GetContent returns the Content field value if set, zero value otherwise. func (o *IUpdatePostRequestDTO) GetContent() string { - if o == nil { + if o == nil || IsNil(o.Content) { var ret string return ret } - - return o.Content + return *o.Content } -// GetContentOk returns a tuple with the Content field value +// GetContentOk returns a tuple with the Content field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IUpdatePostRequestDTO) GetContentOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Content) { return nil, false } - return &o.Content, true + return o.Content, true } -// SetContent sets field value +// HasContent returns a boolean if a field has been set. +func (o *IUpdatePostRequestDTO) HasContent() bool { + if o != nil && !IsNil(o.Content) { + return true + } + + return false +} + +// SetContent gets a reference to the given string and assigns it to the Content field. func (o *IUpdatePostRequestDTO) SetContent(v string) { - o.Content = v + o.Content = &v } -// GetThumbnail returns the Thumbnail field value +// GetThumbnail returns the Thumbnail field value if set, zero value otherwise. func (o *IUpdatePostRequestDTO) GetThumbnail() string { - if o == nil { + if o == nil || IsNil(o.Thumbnail) { var ret string return ret } - - return o.Thumbnail + return *o.Thumbnail } -// GetThumbnailOk returns a tuple with the Thumbnail field value +// GetThumbnailOk returns a tuple with the Thumbnail field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IUpdatePostRequestDTO) GetThumbnailOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Thumbnail) { return nil, false } - return &o.Thumbnail, true + return o.Thumbnail, true +} + +// HasThumbnail returns a boolean if a field has been set. +func (o *IUpdatePostRequestDTO) HasThumbnail() bool { + if o != nil && !IsNil(o.Thumbnail) { + return true + } + + return false } -// SetThumbnail sets field value +// SetThumbnail gets a reference to the given string and assigns it to the Thumbnail field. func (o *IUpdatePostRequestDTO) SetThumbnail(v string) { - o.Thumbnail = v + o.Thumbnail = &v } func (o IUpdatePostRequestDTO) MarshalJSON() ([]byte, error) { @@ -160,51 +184,19 @@ func (o IUpdatePostRequestDTO) MarshalJSON() ([]byte, error) { func (o IUpdatePostRequestDTO) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["title"] = o.Title - toSerialize["summary"] = o.Summary - toSerialize["content"] = o.Content - toSerialize["thumbnail"] = o.Thumbnail - return toSerialize, nil -} - -func (o *IUpdatePostRequestDTO) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "title", - "summary", - "content", - "thumbnail", + if !IsNil(o.Title) { + toSerialize["title"] = o.Title } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; + if !IsNil(o.Summary) { + toSerialize["summary"] = o.Summary } - - for _, requiredProperty := range(requiredProperties) { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } + if !IsNil(o.Content) { + toSerialize["content"] = o.Content } - - varIUpdatePostRequestDTO := _IUpdatePostRequestDTO{} - - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varIUpdatePostRequestDTO) - - if err != nil { - return err + if !IsNil(o.Thumbnail) { + toSerialize["thumbnail"] = o.Thumbnail } - - *o = IUpdatePostRequestDTO(varIUpdatePostRequestDTO) - - return err + return toSerialize, nil } type NullableIUpdatePostRequestDTO struct { diff --git a/typescript-client/api.ts b/typescript-client/api.ts index 1540135..9496e87 100644 --- a/typescript-client/api.ts +++ b/typescript-client/api.ts @@ -145,25 +145,25 @@ export interface IUpdatePostRequestDTO { * @type {string} * @memberof IUpdatePostRequestDTO */ - 'title': string; + 'title'?: string; /** * Summary of the post. * @type {string} * @memberof IUpdatePostRequestDTO */ - 'summary': string; + 'summary'?: string; /** * Content of the post. * @type {string} * @memberof IUpdatePostRequestDTO */ - 'content': string; + 'content'?: string; /** * URL of the post thumbnail. * @type {string} * @memberof IUpdatePostRequestDTO */ - 'thumbnail': string; + 'thumbnail'?: string; } /** *