diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d64b75..6b6383a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [1.2.4] - 2022-04-01 +- Fix nullable fields in `status` endpoint result + ## [1.2.3] - 2022-03-21 - Add `ingest.receivedParts` attribute in GET /videos/{video_id}/status diff --git a/api/openapi.yaml b/api/openapi.yaml index 46064e1..f002dac 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -2235,14 +2235,21 @@ paths: \ Code: \"+ e.ErrorCode);\n Debug.Print(e.StackTrace);\n\ \ }\n }\n }\n} \n" - language: php - code: "videos()->getStatus($videoId);\ - \ " + code: |- + videos()->get($videoId); - language: swift code: |+ // First install the api client: https://github.com/apivideo/api.video-ios-client#getting-started @@ -11624,6 +11631,7 @@ components: filesize: description: The size of your file in bytes. example: 200000 + nullable: true type: integer receivedBytes: description: The total number of bytes received, listed for each chunk of @@ -11639,34 +11647,42 @@ components: properties: width: description: The width of the video in pixels. + nullable: true type: integer height: description: The height of the video in pixels. + nullable: true type: integer bitrate: description: The number of bits processed per second. + nullable: true type: number duration: description: The length of the video. + nullable: true type: integer framerate: description: The frequency with which consecutive images or frames appear on a display. Shown in this API as frames per second (fps). example: 60 + nullable: true type: integer samplerate: description: How many samples per second a digital audio system uses to record an audio signal. The higher the rate, the higher the frequencies that can be recorded. They are presented in this API using hertz. example: 48000 + nullable: true type: integer videoCodec: description: 'The method used to compress and decompress digital video. API Video supports all codecs in the libavcodec library. ' + nullable: true type: string audioCodec: description: The method used to compress and decompress digital audio for your video. + nullable: true type: string aspectRatio: nullable: true diff --git a/api_videos_test.go b/api_videos_test.go index 163326b..cb14fc8 100644 --- a/api_videos_test.go +++ b/api_videos_test.go @@ -239,7 +239,7 @@ var videoStatusJSONResponse = `{ var videoStatusStruct = VideoStatus{ Ingest: &VideoStatusIngest{ Status: PtrString("uploaded"), - Filesize: PtrInt32(273579401), + Filesize: PtrNullableInt32(273579401), ReceivedBytes: &[]BytesRange{ { To: PtrInt32(134217727), @@ -278,14 +278,14 @@ var videoStatusStruct = VideoStatus{ }, }, Metadata: &VideoStatusEncodingMetadata{ - Width: PtrInt32(424), - Height: PtrInt32(240), - Bitrate: PtrFloat32(411), - Duration: PtrInt32(4176), - Framerate: PtrInt32(24), - Samplerate: PtrInt32(48000), - VideoCodec: PtrString("h264"), - AudioCodec: PtrString("aac"), + Width: PtrNullableInt32(424), + Height: PtrNullableInt32(240), + Bitrate: PtrNullableFloat32(411), + Duration: PtrNullableInt32(4176), + Framerate: PtrNullableInt32(24), + Samplerate: PtrNullableInt32(48000), + VideoCodec: PtrNullableString("h264"), + AudioCodec: PtrNullableString("aac"), AspectRatio: PtrNullableString("16/9"), }, }, diff --git a/client.go b/client.go index 32f5292..31cd7a2 100644 --- a/client.go +++ b/client.go @@ -231,7 +231,7 @@ func (c *Client) prepareRequest( req.Header.Set("AV-Origin-App", originAppHeaderValue) } - req.Header.Set("AV-Origin-Client", "go:1.2.3") + req.Header.Set("AV-Origin-Client", "go:1.2.4") for headerName := range headerParams { req.Header.Set(headerName, headerParams[headerName]) @@ -502,7 +502,7 @@ func (c *Client) auth(req *http.Request) (*http.Request, error) { if originAppHeaderValue != "" { req.Header.Set("AV-Origin-App", originAppHeaderValue) } - req.Header.Set("AV-Origin-Client", "go:1.2.3") + req.Header.Set("AV-Origin-Client", "go:1.2.4") resp, err := c.httpClient.Do(req) diff --git a/docs/VideoStatusEncodingMetadata.md b/docs/VideoStatusEncodingMetadata.md index 64cdd17..7b300ad 100644 --- a/docs/VideoStatusEncodingMetadata.md +++ b/docs/VideoStatusEncodingMetadata.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Width** | Pointer to **int32** | The width of the video in pixels. | [optional] -**Height** | Pointer to **int32** | The height of the video in pixels. | [optional] -**Bitrate** | Pointer to **float32** | The number of bits processed per second. | [optional] -**Duration** | Pointer to **int32** | The length of the video. | [optional] -**Framerate** | Pointer to **int32** | The frequency with which consecutive images or frames appear on a display. Shown in this API as frames per second (fps). | [optional] -**Samplerate** | Pointer to **int32** | How many samples per second a digital audio system uses to record an audio signal. The higher the rate, the higher the frequencies that can be recorded. They are presented in this API using hertz. | [optional] -**VideoCodec** | Pointer to **string** | The method used to compress and decompress digital video. API Video supports all codecs in the libavcodec library. | [optional] -**AudioCodec** | Pointer to **string** | The method used to compress and decompress digital audio for your video. | [optional] +**Width** | Pointer to **NullableInt32** | The width of the video in pixels. | [optional] +**Height** | Pointer to **NullableInt32** | The height of the video in pixels. | [optional] +**Bitrate** | Pointer to **NullableFloat32** | The number of bits processed per second. | [optional] +**Duration** | Pointer to **NullableInt32** | The length of the video. | [optional] +**Framerate** | Pointer to **NullableInt32** | The frequency with which consecutive images or frames appear on a display. Shown in this API as frames per second (fps). | [optional] +**Samplerate** | Pointer to **NullableInt32** | How many samples per second a digital audio system uses to record an audio signal. The higher the rate, the higher the frequencies that can be recorded. They are presented in this API using hertz. | [optional] +**VideoCodec** | Pointer to **NullableString** | The method used to compress and decompress digital video. API Video supports all codecs in the libavcodec library. | [optional] +**AudioCodec** | Pointer to **NullableString** | The method used to compress and decompress digital audio for your video. | [optional] **AspectRatio** | Pointer to **NullableString** | | [optional] ## Methods @@ -58,6 +58,16 @@ SetWidth sets Width field to given value. HasWidth returns a boolean if a field has been set. +### SetWidthNil + +`func (o *VideoStatusEncodingMetadata) SetWidthNil(b bool)` + + SetWidthNil sets the value for Width to be an explicit nil + +### UnsetWidth +`func (o *VideoStatusEncodingMetadata) UnsetWidth()` + +UnsetWidth ensures that no value is present for Width, not even an explicit nil ### GetHeight `func (o *VideoStatusEncodingMetadata) GetHeight() int32` @@ -83,6 +93,16 @@ SetHeight sets Height field to given value. HasHeight returns a boolean if a field has been set. +### SetHeightNil + +`func (o *VideoStatusEncodingMetadata) SetHeightNil(b bool)` + + SetHeightNil sets the value for Height to be an explicit nil + +### UnsetHeight +`func (o *VideoStatusEncodingMetadata) UnsetHeight()` + +UnsetHeight ensures that no value is present for Height, not even an explicit nil ### GetBitrate `func (o *VideoStatusEncodingMetadata) GetBitrate() float32` @@ -108,6 +128,16 @@ SetBitrate sets Bitrate field to given value. HasBitrate returns a boolean if a field has been set. +### SetBitrateNil + +`func (o *VideoStatusEncodingMetadata) SetBitrateNil(b bool)` + + SetBitrateNil sets the value for Bitrate to be an explicit nil + +### UnsetBitrate +`func (o *VideoStatusEncodingMetadata) UnsetBitrate()` + +UnsetBitrate ensures that no value is present for Bitrate, not even an explicit nil ### GetDuration `func (o *VideoStatusEncodingMetadata) GetDuration() int32` @@ -133,6 +163,16 @@ SetDuration sets Duration field to given value. HasDuration returns a boolean if a field has been set. +### SetDurationNil + +`func (o *VideoStatusEncodingMetadata) SetDurationNil(b bool)` + + SetDurationNil sets the value for Duration to be an explicit nil + +### UnsetDuration +`func (o *VideoStatusEncodingMetadata) UnsetDuration()` + +UnsetDuration ensures that no value is present for Duration, not even an explicit nil ### GetFramerate `func (o *VideoStatusEncodingMetadata) GetFramerate() int32` @@ -158,6 +198,16 @@ SetFramerate sets Framerate field to given value. HasFramerate returns a boolean if a field has been set. +### SetFramerateNil + +`func (o *VideoStatusEncodingMetadata) SetFramerateNil(b bool)` + + SetFramerateNil sets the value for Framerate to be an explicit nil + +### UnsetFramerate +`func (o *VideoStatusEncodingMetadata) UnsetFramerate()` + +UnsetFramerate ensures that no value is present for Framerate, not even an explicit nil ### GetSamplerate `func (o *VideoStatusEncodingMetadata) GetSamplerate() int32` @@ -183,6 +233,16 @@ SetSamplerate sets Samplerate field to given value. HasSamplerate returns a boolean if a field has been set. +### SetSamplerateNil + +`func (o *VideoStatusEncodingMetadata) SetSamplerateNil(b bool)` + + SetSamplerateNil sets the value for Samplerate to be an explicit nil + +### UnsetSamplerate +`func (o *VideoStatusEncodingMetadata) UnsetSamplerate()` + +UnsetSamplerate ensures that no value is present for Samplerate, not even an explicit nil ### GetVideoCodec `func (o *VideoStatusEncodingMetadata) GetVideoCodec() string` @@ -208,6 +268,16 @@ SetVideoCodec sets VideoCodec field to given value. HasVideoCodec returns a boolean if a field has been set. +### SetVideoCodecNil + +`func (o *VideoStatusEncodingMetadata) SetVideoCodecNil(b bool)` + + SetVideoCodecNil sets the value for VideoCodec to be an explicit nil + +### UnsetVideoCodec +`func (o *VideoStatusEncodingMetadata) UnsetVideoCodec()` + +UnsetVideoCodec ensures that no value is present for VideoCodec, not even an explicit nil ### GetAudioCodec `func (o *VideoStatusEncodingMetadata) GetAudioCodec() string` @@ -233,6 +303,16 @@ SetAudioCodec sets AudioCodec field to given value. HasAudioCodec returns a boolean if a field has been set. +### SetAudioCodecNil + +`func (o *VideoStatusEncodingMetadata) SetAudioCodecNil(b bool)` + + SetAudioCodecNil sets the value for AudioCodec to be an explicit nil + +### UnsetAudioCodec +`func (o *VideoStatusEncodingMetadata) UnsetAudioCodec()` + +UnsetAudioCodec ensures that no value is present for AudioCodec, not even an explicit nil ### GetAspectRatio `func (o *VideoStatusEncodingMetadata) GetAspectRatio() string` diff --git a/docs/VideoStatusIngest.md b/docs/VideoStatusIngest.md index 4d111fc..97f7abe 100644 --- a/docs/VideoStatusIngest.md +++ b/docs/VideoStatusIngest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Status** | Pointer to **string** | There are three possible ingest statuses. missing - you are missing information required to ingest the video. uploading - the video is in the process of being uploaded. uploaded - the video is ready for use. | [optional] -**Filesize** | Pointer to **int32** | The size of your file in bytes. | [optional] +**Filesize** | Pointer to **NullableInt32** | The size of your file in bytes. | [optional] **ReceivedBytes** | Pointer to [**[]BytesRange**](BytesRange.md) | The total number of bytes received, listed for each chunk of the upload. | [optional] **ReceivedParts** | Pointer to [**VideoStatusIngestReceivedParts**](VideoStatusIngestReceivedParts.md) | | [optional] @@ -78,6 +78,16 @@ SetFilesize sets Filesize field to given value. HasFilesize returns a boolean if a field has been set. +### SetFilesizeNil + +`func (o *VideoStatusIngest) SetFilesizeNil(b bool)` + + SetFilesizeNil sets the value for Filesize to be an explicit nil + +### UnsetFilesize +`func (o *VideoStatusIngest) UnsetFilesize()` + +UnsetFilesize ensures that no value is present for Filesize, not even an explicit nil ### GetReceivedBytes `func (o *VideoStatusIngest) GetReceivedBytes() []BytesRange` diff --git a/model_video_status_encoding_metadata.go b/model_video_status_encoding_metadata.go index 6dc4b5b..d315ee6 100644 --- a/model_video_status_encoding_metadata.go +++ b/model_video_status_encoding_metadata.go @@ -17,21 +17,21 @@ import ( // VideoStatusEncodingMetadata struct for VideoStatusEncodingMetadata type VideoStatusEncodingMetadata struct { // The width of the video in pixels. - Width *int32 `json:"width,omitempty"` + Width *NullableInt32 `json:"width,omitempty"` // The height of the video in pixels. - Height *int32 `json:"height,omitempty"` + Height *NullableInt32 `json:"height,omitempty"` // The number of bits processed per second. - Bitrate *float32 `json:"bitrate,omitempty"` + Bitrate *NullableFloat32 `json:"bitrate,omitempty"` // The length of the video. - Duration *int32 `json:"duration,omitempty"` + Duration *NullableInt32 `json:"duration,omitempty"` // The frequency with which consecutive images or frames appear on a display. Shown in this API as frames per second (fps). - Framerate *int32 `json:"framerate,omitempty"` + Framerate *NullableInt32 `json:"framerate,omitempty"` // How many samples per second a digital audio system uses to record an audio signal. The higher the rate, the higher the frequencies that can be recorded. They are presented in this API using hertz. - Samplerate *int32 `json:"samplerate,omitempty"` + Samplerate *NullableInt32 `json:"samplerate,omitempty"` // The method used to compress and decompress digital video. API Video supports all codecs in the libavcodec library. - VideoCodec *string `json:"videoCodec,omitempty"` + VideoCodec *NullableString `json:"videoCodec,omitempty"` // The method used to compress and decompress digital audio for your video. - AudioCodec *string `json:"audioCodec,omitempty"` + AudioCodec *NullableString `json:"audioCodec,omitempty"` AspectRatio *NullableString `json:"aspectRatio,omitempty"` } @@ -52,260 +52,348 @@ func NewVideoStatusEncodingMetadataWithDefaults() *VideoStatusEncodingMetadata { return &this } -// GetWidth returns the Width field value if set, zero value otherwise. +// GetWidth returns the Width field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VideoStatusEncodingMetadata) GetWidth() int32 { - if o == nil || o.Width == nil { + if o == nil || o.Width.Get() == nil { var ret int32 return ret } - return *o.Width + return *o.Width.Get() } // GetWidthOk returns a tuple with the Width field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VideoStatusEncodingMetadata) GetWidthOk() (*int32, bool) { - if o == nil || o.Width == nil { + if o == nil { return nil, false } - return o.Width, true + return o.Width.Get(), o.Width.IsSet() } // HasWidth returns a boolean if a field has been set. func (o *VideoStatusEncodingMetadata) HasWidth() bool { - if o != nil && o.Width != nil { + if o != nil && o.Width.IsSet() { return true } return false } -// SetWidth gets a reference to the given int32 and assigns it to the Width field. +// SetWidth gets a reference to the given NullableInt32 and assigns it to the Width field. func (o *VideoStatusEncodingMetadata) SetWidth(v int32) { - o.Width = &v + o.Width.Set(&v) +} + +// SetWidthNil sets the value for Width to be an explicit nil +func (o *VideoStatusEncodingMetadata) SetWidthNil() { + o.Width.Set(nil) +} + +// UnsetWidth ensures that no value is present for Width, not even an explicit nil +func (o *VideoStatusEncodingMetadata) UnsetWidth() { + o.Width.Unset() } -// GetHeight returns the Height field value if set, zero value otherwise. +// GetHeight returns the Height field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VideoStatusEncodingMetadata) GetHeight() int32 { - if o == nil || o.Height == nil { + if o == nil || o.Height.Get() == nil { var ret int32 return ret } - return *o.Height + return *o.Height.Get() } // GetHeightOk returns a tuple with the Height field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VideoStatusEncodingMetadata) GetHeightOk() (*int32, bool) { - if o == nil || o.Height == nil { + if o == nil { return nil, false } - return o.Height, true + return o.Height.Get(), o.Height.IsSet() } // HasHeight returns a boolean if a field has been set. func (o *VideoStatusEncodingMetadata) HasHeight() bool { - if o != nil && o.Height != nil { + if o != nil && o.Height.IsSet() { return true } return false } -// SetHeight gets a reference to the given int32 and assigns it to the Height field. +// SetHeight gets a reference to the given NullableInt32 and assigns it to the Height field. func (o *VideoStatusEncodingMetadata) SetHeight(v int32) { - o.Height = &v + o.Height.Set(&v) +} + +// SetHeightNil sets the value for Height to be an explicit nil +func (o *VideoStatusEncodingMetadata) SetHeightNil() { + o.Height.Set(nil) +} + +// UnsetHeight ensures that no value is present for Height, not even an explicit nil +func (o *VideoStatusEncodingMetadata) UnsetHeight() { + o.Height.Unset() } -// GetBitrate returns the Bitrate field value if set, zero value otherwise. +// GetBitrate returns the Bitrate field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VideoStatusEncodingMetadata) GetBitrate() float32 { - if o == nil || o.Bitrate == nil { + if o == nil || o.Bitrate.Get() == nil { var ret float32 return ret } - return *o.Bitrate + return *o.Bitrate.Get() } // GetBitrateOk returns a tuple with the Bitrate field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VideoStatusEncodingMetadata) GetBitrateOk() (*float32, bool) { - if o == nil || o.Bitrate == nil { + if o == nil { return nil, false } - return o.Bitrate, true + return o.Bitrate.Get(), o.Bitrate.IsSet() } // HasBitrate returns a boolean if a field has been set. func (o *VideoStatusEncodingMetadata) HasBitrate() bool { - if o != nil && o.Bitrate != nil { + if o != nil && o.Bitrate.IsSet() { return true } return false } -// SetBitrate gets a reference to the given float32 and assigns it to the Bitrate field. +// SetBitrate gets a reference to the given NullableFloat32 and assigns it to the Bitrate field. func (o *VideoStatusEncodingMetadata) SetBitrate(v float32) { - o.Bitrate = &v + o.Bitrate.Set(&v) +} + +// SetBitrateNil sets the value for Bitrate to be an explicit nil +func (o *VideoStatusEncodingMetadata) SetBitrateNil() { + o.Bitrate.Set(nil) +} + +// UnsetBitrate ensures that no value is present for Bitrate, not even an explicit nil +func (o *VideoStatusEncodingMetadata) UnsetBitrate() { + o.Bitrate.Unset() } -// GetDuration returns the Duration field value if set, zero value otherwise. +// GetDuration returns the Duration field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VideoStatusEncodingMetadata) GetDuration() int32 { - if o == nil || o.Duration == nil { + if o == nil || o.Duration.Get() == nil { var ret int32 return ret } - return *o.Duration + return *o.Duration.Get() } // GetDurationOk returns a tuple with the Duration field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VideoStatusEncodingMetadata) GetDurationOk() (*int32, bool) { - if o == nil || o.Duration == nil { + if o == nil { return nil, false } - return o.Duration, true + return o.Duration.Get(), o.Duration.IsSet() } // HasDuration returns a boolean if a field has been set. func (o *VideoStatusEncodingMetadata) HasDuration() bool { - if o != nil && o.Duration != nil { + if o != nil && o.Duration.IsSet() { return true } return false } -// SetDuration gets a reference to the given int32 and assigns it to the Duration field. +// SetDuration gets a reference to the given NullableInt32 and assigns it to the Duration field. func (o *VideoStatusEncodingMetadata) SetDuration(v int32) { - o.Duration = &v + o.Duration.Set(&v) +} + +// SetDurationNil sets the value for Duration to be an explicit nil +func (o *VideoStatusEncodingMetadata) SetDurationNil() { + o.Duration.Set(nil) +} + +// UnsetDuration ensures that no value is present for Duration, not even an explicit nil +func (o *VideoStatusEncodingMetadata) UnsetDuration() { + o.Duration.Unset() } -// GetFramerate returns the Framerate field value if set, zero value otherwise. +// GetFramerate returns the Framerate field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VideoStatusEncodingMetadata) GetFramerate() int32 { - if o == nil || o.Framerate == nil { + if o == nil || o.Framerate.Get() == nil { var ret int32 return ret } - return *o.Framerate + return *o.Framerate.Get() } // GetFramerateOk returns a tuple with the Framerate field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VideoStatusEncodingMetadata) GetFramerateOk() (*int32, bool) { - if o == nil || o.Framerate == nil { + if o == nil { return nil, false } - return o.Framerate, true + return o.Framerate.Get(), o.Framerate.IsSet() } // HasFramerate returns a boolean if a field has been set. func (o *VideoStatusEncodingMetadata) HasFramerate() bool { - if o != nil && o.Framerate != nil { + if o != nil && o.Framerate.IsSet() { return true } return false } -// SetFramerate gets a reference to the given int32 and assigns it to the Framerate field. +// SetFramerate gets a reference to the given NullableInt32 and assigns it to the Framerate field. func (o *VideoStatusEncodingMetadata) SetFramerate(v int32) { - o.Framerate = &v + o.Framerate.Set(&v) +} + +// SetFramerateNil sets the value for Framerate to be an explicit nil +func (o *VideoStatusEncodingMetadata) SetFramerateNil() { + o.Framerate.Set(nil) +} + +// UnsetFramerate ensures that no value is present for Framerate, not even an explicit nil +func (o *VideoStatusEncodingMetadata) UnsetFramerate() { + o.Framerate.Unset() } -// GetSamplerate returns the Samplerate field value if set, zero value otherwise. +// GetSamplerate returns the Samplerate field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VideoStatusEncodingMetadata) GetSamplerate() int32 { - if o == nil || o.Samplerate == nil { + if o == nil || o.Samplerate.Get() == nil { var ret int32 return ret } - return *o.Samplerate + return *o.Samplerate.Get() } // GetSamplerateOk returns a tuple with the Samplerate field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VideoStatusEncodingMetadata) GetSamplerateOk() (*int32, bool) { - if o == nil || o.Samplerate == nil { + if o == nil { return nil, false } - return o.Samplerate, true + return o.Samplerate.Get(), o.Samplerate.IsSet() } // HasSamplerate returns a boolean if a field has been set. func (o *VideoStatusEncodingMetadata) HasSamplerate() bool { - if o != nil && o.Samplerate != nil { + if o != nil && o.Samplerate.IsSet() { return true } return false } -// SetSamplerate gets a reference to the given int32 and assigns it to the Samplerate field. +// SetSamplerate gets a reference to the given NullableInt32 and assigns it to the Samplerate field. func (o *VideoStatusEncodingMetadata) SetSamplerate(v int32) { - o.Samplerate = &v + o.Samplerate.Set(&v) +} + +// SetSamplerateNil sets the value for Samplerate to be an explicit nil +func (o *VideoStatusEncodingMetadata) SetSamplerateNil() { + o.Samplerate.Set(nil) +} + +// UnsetSamplerate ensures that no value is present for Samplerate, not even an explicit nil +func (o *VideoStatusEncodingMetadata) UnsetSamplerate() { + o.Samplerate.Unset() } -// GetVideoCodec returns the VideoCodec field value if set, zero value otherwise. +// GetVideoCodec returns the VideoCodec field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VideoStatusEncodingMetadata) GetVideoCodec() string { - if o == nil || o.VideoCodec == nil { + if o == nil || o.VideoCodec.Get() == nil { var ret string return ret } - return *o.VideoCodec + return *o.VideoCodec.Get() } // GetVideoCodecOk returns a tuple with the VideoCodec field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VideoStatusEncodingMetadata) GetVideoCodecOk() (*string, bool) { - if o == nil || o.VideoCodec == nil { + if o == nil { return nil, false } - return o.VideoCodec, true + return o.VideoCodec.Get(), o.VideoCodec.IsSet() } // HasVideoCodec returns a boolean if a field has been set. func (o *VideoStatusEncodingMetadata) HasVideoCodec() bool { - if o != nil && o.VideoCodec != nil { + if o != nil && o.VideoCodec.IsSet() { return true } return false } -// SetVideoCodec gets a reference to the given string and assigns it to the VideoCodec field. +// SetVideoCodec gets a reference to the given NullableString and assigns it to the VideoCodec field. func (o *VideoStatusEncodingMetadata) SetVideoCodec(v string) { - o.VideoCodec = &v + o.VideoCodec.Set(&v) +} + +// SetVideoCodecNil sets the value for VideoCodec to be an explicit nil +func (o *VideoStatusEncodingMetadata) SetVideoCodecNil() { + o.VideoCodec.Set(nil) +} + +// UnsetVideoCodec ensures that no value is present for VideoCodec, not even an explicit nil +func (o *VideoStatusEncodingMetadata) UnsetVideoCodec() { + o.VideoCodec.Unset() } -// GetAudioCodec returns the AudioCodec field value if set, zero value otherwise. +// GetAudioCodec returns the AudioCodec field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VideoStatusEncodingMetadata) GetAudioCodec() string { - if o == nil || o.AudioCodec == nil { + if o == nil || o.AudioCodec.Get() == nil { var ret string return ret } - return *o.AudioCodec + return *o.AudioCodec.Get() } // GetAudioCodecOk returns a tuple with the AudioCodec field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VideoStatusEncodingMetadata) GetAudioCodecOk() (*string, bool) { - if o == nil || o.AudioCodec == nil { + if o == nil { return nil, false } - return o.AudioCodec, true + return o.AudioCodec.Get(), o.AudioCodec.IsSet() } // HasAudioCodec returns a boolean if a field has been set. func (o *VideoStatusEncodingMetadata) HasAudioCodec() bool { - if o != nil && o.AudioCodec != nil { + if o != nil && o.AudioCodec.IsSet() { return true } return false } -// SetAudioCodec gets a reference to the given string and assigns it to the AudioCodec field. +// SetAudioCodec gets a reference to the given NullableString and assigns it to the AudioCodec field. func (o *VideoStatusEncodingMetadata) SetAudioCodec(v string) { - o.AudioCodec = &v + o.AudioCodec.Set(&v) +} + +// SetAudioCodecNil sets the value for AudioCodec to be an explicit nil +func (o *VideoStatusEncodingMetadata) SetAudioCodecNil() { + o.AudioCodec.Set(nil) +} + +// UnsetAudioCodec ensures that no value is present for AudioCodec, not even an explicit nil +func (o *VideoStatusEncodingMetadata) UnsetAudioCodec() { + o.AudioCodec.Unset() } // GetAspectRatio returns the AspectRatio field value if set, zero value otherwise (both if not set or set to explicit null). diff --git a/model_video_status_ingest.go b/model_video_status_ingest.go index 69bf825..25a93d9 100644 --- a/model_video_status_ingest.go +++ b/model_video_status_ingest.go @@ -19,7 +19,7 @@ type VideoStatusIngest struct { // There are three possible ingest statuses. missing - you are missing information required to ingest the video. uploading - the video is in the process of being uploaded. uploaded - the video is ready for use. Status *string `json:"status,omitempty"` // The size of your file in bytes. - Filesize *int32 `json:"filesize,omitempty"` + Filesize *NullableInt32 `json:"filesize,omitempty"` // The total number of bytes received, listed for each chunk of the upload. ReceivedBytes *[]BytesRange `json:"receivedBytes,omitempty"` ReceivedParts *VideoStatusIngestReceivedParts `json:"receivedParts,omitempty"` @@ -74,36 +74,47 @@ func (o *VideoStatusIngest) SetStatus(v string) { o.Status = &v } -// GetFilesize returns the Filesize field value if set, zero value otherwise. +// GetFilesize returns the Filesize field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VideoStatusIngest) GetFilesize() int32 { - if o == nil || o.Filesize == nil { + if o == nil || o.Filesize.Get() == nil { var ret int32 return ret } - return *o.Filesize + return *o.Filesize.Get() } // GetFilesizeOk returns a tuple with the Filesize field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VideoStatusIngest) GetFilesizeOk() (*int32, bool) { - if o == nil || o.Filesize == nil { + if o == nil { return nil, false } - return o.Filesize, true + return o.Filesize.Get(), o.Filesize.IsSet() } // HasFilesize returns a boolean if a field has been set. func (o *VideoStatusIngest) HasFilesize() bool { - if o != nil && o.Filesize != nil { + if o != nil && o.Filesize.IsSet() { return true } return false } -// SetFilesize gets a reference to the given int32 and assigns it to the Filesize field. +// SetFilesize gets a reference to the given NullableInt32 and assigns it to the Filesize field. func (o *VideoStatusIngest) SetFilesize(v int32) { - o.Filesize = &v + o.Filesize.Set(&v) +} + +// SetFilesizeNil sets the value for Filesize to be an explicit nil +func (o *VideoStatusIngest) SetFilesizeNil() { + o.Filesize.Set(nil) +} + +// UnsetFilesize ensures that no value is present for Filesize, not even an explicit nil +func (o *VideoStatusIngest) UnsetFilesize() { + o.Filesize.Unset() } // GetReceivedBytes returns the ReceivedBytes field value if set, zero value otherwise. diff --git a/utils.go b/utils.go index bd98c4f..77567ab 100644 --- a/utils.go +++ b/utils.go @@ -39,6 +39,12 @@ func PtrString(v string) *string { return &v } // PtrNullableString is a helper routine that returns a pointer to given NullableString value. func PtrNullableString(v string) *NullableString { return NewNullableString(&v) } +// PtrNullableInt32 is a helper routine that returns a pointer to given NullableInt32 value. +func PtrNullableInt32(v int32) *NullableInt32 { return NewNullableInt32(&v) } + +// PtrNullableFloat32 is a helper routine that returns a pointer to given NullableFloat32 value. +func PtrNullableFloat32(v float32) *NullableFloat32 { return NewNullableFloat32(&v) } + // PtrNullableStringNull is a helper routine that returns a pointer to NullableString that has nil value. func PtrNullableStringNull() *NullableString { return &NullableString{value: nil, isSet: true} }