diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a0b7e8b..8903cbe 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: e742591b-391d-4f4e-8484-d01a093b32ec management: - docChecksum: 45c73686e6dbe8c29b7e2857b6194ccf + docChecksum: a14d0ae27d4f5bd83b80747112f74352 docVersion: 0.0.3 speakeasyVersion: internal generationVersion: 2.237.2 - releaseVersion: 0.2.4 - configChecksum: 3eabe9635f0405c71d695a4559488aae + releaseVersion: 0.2.5 + configChecksum: 8a99c36c4d1db17583b4c16f920029a5 repoURL: https://github.com/LukeHagar/plexterraform.git repoSubDirectory: . published: true diff --git a/README.md b/README.md index ca04927..b025d18 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ terraform { required_providers { PlexAPI = { source = "LukeHagar/PlexAPI" - version = "0.2.4" + version = "0.2.5" } } } diff --git a/RELEASES.md b/RELEASES.md index b9d8c4e..43cf474 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -54,4 +54,12 @@ Based on: - OpenAPI Doc 0.0.3 - Speakeasy CLI 1.147.0 (2.237.2) https://github.com/speakeasy-api/speakeasy ### Generated -- [terraform v0.2.4] . \ No newline at end of file +- [terraform v0.2.4] . + +## 2024-01-19 17:27:23 +### Changes +Based on: +- OpenAPI Doc 0.0.3 +- Speakeasy CLI 1.147.0 (2.237.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [terraform v0.2.5] . \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 1bb2e5c..2ae380f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -17,7 +17,7 @@ terraform { required_providers { PlexAPI = { source = "LukeHagar/PlexAPI" - version = "0.2.4" + version = "0.2.5" } } } diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 895d4a4..8086eb4 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { PlexAPI = { source = "LukeHagar/PlexAPI" - version = "0.2.4" + version = "0.2.5" } } } diff --git a/gen.yaml b/gen.yaml index 8138137..80aa592 100644 --- a/gen.yaml +++ b/gen.yaml @@ -8,7 +8,7 @@ generation: fixes: nameResolutionDec2023: false terraform: - version: 0.2.4 + version: 0.2.5 author: LukeHagar imports: option: openapi diff --git a/internal/sdk/library.go b/internal/sdk/library.go index 9d764e7..5fdd3a8 100644 --- a/internal/sdk/library.go +++ b/internal/sdk/library.go @@ -295,9 +295,6 @@ func (s *Library) GetLibrary(ctx context.Context, request operations.GetLibraryR } switch { case httpRes.StatusCode == 200: - fallthrough - case httpRes.StatusCode == 400: - case httpRes.StatusCode == 401: switch { case utils.MatchContentType(contentType, `application/json`): var out operations.GetLibraryResponseBody @@ -305,7 +302,20 @@ func (s *Library) GetLibrary(ctx context.Context, request operations.GetLibraryR return nil, err } - res.Object = &out + res.TwoHundredApplicationJSONObject = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetLibraryLibraryResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.FourHundredAndOneApplicationJSONObject = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/internal/sdk/pkg/models/operations/getlibrary.go b/internal/sdk/pkg/models/operations/getlibrary.go index 5b492cb..cd9b8c9 100644 --- a/internal/sdk/pkg/models/operations/getlibrary.go +++ b/internal/sdk/pkg/models/operations/getlibrary.go @@ -99,18 +99,180 @@ func (o *GetLibraryErrors) GetStatus() *float64 { return o.Status } -// GetLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. -type GetLibraryResponseBody struct { +// GetLibraryLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetLibraryLibraryResponseBody struct { Errors []GetLibraryErrors `json:"errors,omitempty"` } -func (o *GetLibraryResponseBody) GetErrors() []GetLibraryErrors { +func (o *GetLibraryLibraryResponseBody) GetErrors() []GetLibraryErrors { if o == nil { return nil } return o.Errors } +type GetLibraryDirectory struct { + Secondary *bool `json:"secondary,omitempty"` + Prompt *string `json:"prompt,omitempty"` + Search *bool `json:"search,omitempty"` + Key *string `json:"key,omitempty"` + Title *string `json:"title,omitempty"` +} + +func (o *GetLibraryDirectory) GetSecondary() *bool { + if o == nil { + return nil + } + return o.Secondary +} + +func (o *GetLibraryDirectory) GetPrompt() *string { + if o == nil { + return nil + } + return o.Prompt +} + +func (o *GetLibraryDirectory) GetSearch() *bool { + if o == nil { + return nil + } + return o.Search +} + +func (o *GetLibraryDirectory) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *GetLibraryDirectory) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +type GetLibraryMediaContainer struct { + Size *int `json:"size,omitempty"` + AllowSync *bool `json:"allowSync,omitempty"` + Art *string `json:"art,omitempty"` + Content *string `json:"content,omitempty"` + Identifier *string `json:"identifier,omitempty"` + LibrarySectionID *int `json:"librarySectionID,omitempty"` + MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"` + MediaTagVersion *int `json:"mediaTagVersion,omitempty"` + Thumb *string `json:"thumb,omitempty"` + Title1 *string `json:"title1,omitempty"` + ViewGroup *string `json:"viewGroup,omitempty"` + ViewMode *int `json:"viewMode,omitempty"` + Directory []GetLibraryDirectory `json:"Directory,omitempty"` +} + +func (o *GetLibraryMediaContainer) GetSize() *int { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetLibraryMediaContainer) GetAllowSync() *bool { + if o == nil { + return nil + } + return o.AllowSync +} + +func (o *GetLibraryMediaContainer) GetArt() *string { + if o == nil { + return nil + } + return o.Art +} + +func (o *GetLibraryMediaContainer) GetContent() *string { + if o == nil { + return nil + } + return o.Content +} + +func (o *GetLibraryMediaContainer) GetIdentifier() *string { + if o == nil { + return nil + } + return o.Identifier +} + +func (o *GetLibraryMediaContainer) GetLibrarySectionID() *int { + if o == nil { + return nil + } + return o.LibrarySectionID +} + +func (o *GetLibraryMediaContainer) GetMediaTagPrefix() *string { + if o == nil { + return nil + } + return o.MediaTagPrefix +} + +func (o *GetLibraryMediaContainer) GetMediaTagVersion() *int { + if o == nil { + return nil + } + return o.MediaTagVersion +} + +func (o *GetLibraryMediaContainer) GetThumb() *string { + if o == nil { + return nil + } + return o.Thumb +} + +func (o *GetLibraryMediaContainer) GetTitle1() *string { + if o == nil { + return nil + } + return o.Title1 +} + +func (o *GetLibraryMediaContainer) GetViewGroup() *string { + if o == nil { + return nil + } + return o.ViewGroup +} + +func (o *GetLibraryMediaContainer) GetViewMode() *int { + if o == nil { + return nil + } + return o.ViewMode +} + +func (o *GetLibraryMediaContainer) GetDirectory() []GetLibraryDirectory { + if o == nil { + return nil + } + return o.Directory +} + +// GetLibraryResponseBody - The details of the library +type GetLibraryResponseBody struct { + MediaContainer *GetLibraryMediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *GetLibraryResponseBody) GetMediaContainer() *GetLibraryMediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + type GetLibraryResponse struct { // HTTP response content type for this operation ContentType string @@ -118,8 +280,10 @@ type GetLibraryResponse struct { StatusCode int // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response + // The details of the library + TwoHundredApplicationJSONObject *GetLibraryResponseBody // Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - Object *GetLibraryResponseBody + FourHundredAndOneApplicationJSONObject *GetLibraryLibraryResponseBody } func (o *GetLibraryResponse) GetContentType() string { @@ -143,9 +307,16 @@ func (o *GetLibraryResponse) GetRawResponse() *http.Response { return o.RawResponse } -func (o *GetLibraryResponse) GetObject() *GetLibraryResponseBody { +func (o *GetLibraryResponse) GetTwoHundredApplicationJSONObject() *GetLibraryResponseBody { if o == nil { return nil } - return o.Object + return o.TwoHundredApplicationJSONObject +} + +func (o *GetLibraryResponse) GetFourHundredAndOneApplicationJSONObject() *GetLibraryLibraryResponseBody { + if o == nil { + return nil + } + return o.FourHundredAndOneApplicationJSONObject } diff --git a/internal/sdk/sdk.go b/internal/sdk/sdk.go index 24dc482..329be9c 100644 --- a/internal/sdk/sdk.go +++ b/internal/sdk/sdk.go @@ -259,9 +259,9 @@ func New(opts ...SDKOption) *PlexAPI { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "0.0.3", - SDKVersion: "0.2.4", + SDKVersion: "0.2.5", GenVersion: "2.237.2", - UserAgent: "speakeasy-sdk/go 0.2.4 2.237.2 0.0.3 PlexAPI", + UserAgent: "speakeasy-sdk/go 0.2.5 2.237.2 0.0.3 PlexAPI", ServerDefaults: []map[string]string{ { "protocol": "http",