From 85a91e0416f16e8dcf3f7942450f9e1f6d9f68de Mon Sep 17 00:00:00 2001 From: "devopsarr[bot]" <127950054+devopsarr[bot]@users.noreply.github.com> Date: Fri, 21 Jul 2023 09:27:04 +0000 Subject: [PATCH] fix: set pydantic version --- README.md | 2 +- sonarr/api/openapi.yaml | 8 +++- sonarr/api_custom_format.go | 69 ++++++++++++++++++++-------------- sonarr/docs/CustomFormatApi.md | 34 +++++++++-------- 4 files changed, 66 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index d7ef45d..8a3ab00 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,8 @@ Class | Method | HTTP request | Description *CustomFormatApi* | [**CreateCustomFormat**](sonarr/docs/CustomFormatApi.md#createcustomformat) | **Post** /api/v3/customformat | *CustomFormatApi* | [**DeleteCustomFormat**](sonarr/docs/CustomFormatApi.md#deletecustomformat) | **Delete** /api/v3/customformat/{id} | *CustomFormatApi* | [**GetCustomFormatById**](sonarr/docs/CustomFormatApi.md#getcustomformatbyid) | **Get** /api/v3/customformat/{id} | -*CustomFormatApi* | [**GetCustomFormatSchema**](sonarr/docs/CustomFormatApi.md#getcustomformatschema) | **Get** /api/v3/customformat/schema | *CustomFormatApi* | [**ListCustomFormat**](sonarr/docs/CustomFormatApi.md#listcustomformat) | **Get** /api/v3/customformat | +*CustomFormatApi* | [**ListCustomFormatSchema**](sonarr/docs/CustomFormatApi.md#listcustomformatschema) | **Get** /api/v3/customformat/schema | *CustomFormatApi* | [**UpdateCustomFormat**](sonarr/docs/CustomFormatApi.md#updatecustomformat) | **Put** /api/v3/customformat/{id} | *CutoffApi* | [**GetWantedCutoff**](sonarr/docs/CutoffApi.md#getwantedcutoff) | **Get** /api/v3/wanted/cutoff | *CutoffApi* | [**GetWantedCutoffById**](sonarr/docs/CutoffApi.md#getwantedcutoffbyid) | **Get** /api/v3/wanted/cutoff/{id} | diff --git a/sonarr/api/openapi.yaml b/sonarr/api/openapi.yaml index aab043f..50b04f1 100644 --- a/sonarr/api/openapi.yaml +++ b/sonarr/api/openapi.yaml @@ -722,9 +722,15 @@ paths: - CustomFormat /api/v3/customformat/schema: get: - operationId: GetCustomFormatSchema + operationId: ListCustomFormatSchema responses: "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/CustomFormatSpecificationSchema' + type: array description: Success tags: - CustomFormat diff --git a/sonarr/api_custom_format.go b/sonarr/api_custom_format.go index b4156ad..89cbe75 100644 --- a/sonarr/api_custom_format.go +++ b/sonarr/api_custom_format.go @@ -399,42 +399,44 @@ func (a *CustomFormatApiService) GetCustomFormatByIdExecute(r ApiGetCustomFormat return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetCustomFormatSchemaRequest struct { +type ApiListCustomFormatRequest struct { ctx context.Context ApiService *CustomFormatApiService } -func (r ApiGetCustomFormatSchemaRequest) Execute() (*http.Response, error) { - return r.ApiService.GetCustomFormatSchemaExecute(r) +func (r ApiListCustomFormatRequest) Execute() ([]*CustomFormatResource, *http.Response, error) { + return r.ApiService.ListCustomFormatExecute(r) } /* -GetCustomFormatSchema Method for GetCustomFormatSchema +ListCustomFormat Method for ListCustomFormat @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetCustomFormatSchemaRequest + @return ApiListCustomFormatRequest */ -func (a *CustomFormatApiService) GetCustomFormatSchema(ctx context.Context) ApiGetCustomFormatSchemaRequest { - return ApiGetCustomFormatSchemaRequest{ +func (a *CustomFormatApiService) ListCustomFormat(ctx context.Context) ApiListCustomFormatRequest { + return ApiListCustomFormatRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -func (a *CustomFormatApiService) GetCustomFormatSchemaExecute(r ApiGetCustomFormatSchemaRequest) (*http.Response, error) { +// @return []CustomFormatResource +func (a *CustomFormatApiService) ListCustomFormatExecute(r ApiListCustomFormatRequest) ([]*CustomFormatResource, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile + localVarReturnValue []*CustomFormatResource ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CustomFormatApiService.GetCustomFormatSchema") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CustomFormatApiService.ListCustomFormat") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v3/customformat/schema" + localVarPath := localBasePath + "/api/v3/customformat" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -450,7 +452,7 @@ func (a *CustomFormatApiService) GetCustomFormatSchemaExecute(r ApiGetCustomForm } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -487,19 +489,19 @@ func (a *CustomFormatApiService) GetCustomFormatSchemaExecute(r ApiGetCustomForm } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -507,49 +509,58 @@ func (a *CustomFormatApiService) GetCustomFormatSchemaExecute(r ApiGetCustomForm body: localVarBody, error: localVarHTTPResponse.Status, } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -type ApiListCustomFormatRequest struct { +type ApiListCustomFormatSchemaRequest struct { ctx context.Context ApiService *CustomFormatApiService } -func (r ApiListCustomFormatRequest) Execute() ([]*CustomFormatResource, *http.Response, error) { - return r.ApiService.ListCustomFormatExecute(r) +func (r ApiListCustomFormatSchemaRequest) Execute() ([]*CustomFormatSpecificationSchema, *http.Response, error) { + return r.ApiService.ListCustomFormatSchemaExecute(r) } /* -ListCustomFormat Method for ListCustomFormat +ListCustomFormatSchema Method for ListCustomFormatSchema @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListCustomFormatRequest + @return ApiListCustomFormatSchemaRequest */ -func (a *CustomFormatApiService) ListCustomFormat(ctx context.Context) ApiListCustomFormatRequest { - return ApiListCustomFormatRequest{ +func (a *CustomFormatApiService) ListCustomFormatSchema(ctx context.Context) ApiListCustomFormatSchemaRequest { + return ApiListCustomFormatSchemaRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -// @return []CustomFormatResource -func (a *CustomFormatApiService) ListCustomFormatExecute(r ApiListCustomFormatRequest) ([]*CustomFormatResource, *http.Response, error) { +// @return []CustomFormatSpecificationSchema +func (a *CustomFormatApiService) ListCustomFormatSchemaExecute(r ApiListCustomFormatSchemaRequest) ([]*CustomFormatSpecificationSchema, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue []*CustomFormatResource + localVarReturnValue []*CustomFormatSpecificationSchema ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CustomFormatApiService.ListCustomFormat") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CustomFormatApiService.ListCustomFormatSchema") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/api/v3/customformat" + localVarPath := localBasePath + "/api/v3/customformat/schema" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/sonarr/docs/CustomFormatApi.md b/sonarr/docs/CustomFormatApi.md index ae46347..c1fb34f 100644 --- a/sonarr/docs/CustomFormatApi.md +++ b/sonarr/docs/CustomFormatApi.md @@ -7,8 +7,8 @@ Method | HTTP request | Description [**CreateCustomFormat**](CustomFormatApi.md#CreateCustomFormat) | **Post** /api/v3/customformat | [**DeleteCustomFormat**](CustomFormatApi.md#DeleteCustomFormat) | **Delete** /api/v3/customformat/{id} | [**GetCustomFormatById**](CustomFormatApi.md#GetCustomFormatById) | **Get** /api/v3/customformat/{id} | -[**GetCustomFormatSchema**](CustomFormatApi.md#GetCustomFormatSchema) | **Get** /api/v3/customformat/schema | [**ListCustomFormat**](CustomFormatApi.md#ListCustomFormat) | **Get** /api/v3/customformat | +[**ListCustomFormatSchema**](CustomFormatApi.md#ListCustomFormatSchema) | **Get** /api/v3/customformat/schema | [**UpdateCustomFormat**](CustomFormatApi.md#UpdateCustomFormat) | **Put** /api/v3/customformat/{id} | @@ -211,9 +211,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetCustomFormatSchema +## ListCustomFormat -> GetCustomFormatSchema(ctx).Execute() +> []CustomFormatResource ListCustomFormat(ctx).Execute() @@ -233,11 +233,13 @@ func main() { configuration := sonarrClient.NewConfiguration() apiClient := sonarrClient.NewAPIClient(configuration) - resp, r, err := apiClient.CustomFormatApi.GetCustomFormatSchema(context.Background()).Execute() + resp, r, err := apiClient.CustomFormatApi.ListCustomFormat(context.Background()).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CustomFormatApi.GetCustomFormatSchema``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CustomFormatApi.ListCustomFormat``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `ListCustomFormat`: []CustomFormatResource + fmt.Fprintf(os.Stdout, "Response from `CustomFormatApi.ListCustomFormat`: %v\n", resp) } ``` @@ -247,12 +249,12 @@ This endpoint does not need any parameter. ### Other Parameters -Other parameters are passed through a pointer to a apiGetCustomFormatSchemaRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiListCustomFormatRequest struct via the builder pattern ### Return type - (empty response body) +[**[]CustomFormatResource**](CustomFormatResource.md) ### Authorization @@ -261,16 +263,16 @@ Other parameters are passed through a pointer to a apiGetCustomFormatSchemaReque ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: Not defined +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## ListCustomFormat +## ListCustomFormatSchema -> []CustomFormatResource ListCustomFormat(ctx).Execute() +> []CustomFormatSpecificationSchema ListCustomFormatSchema(ctx).Execute() @@ -290,13 +292,13 @@ func main() { configuration := sonarrClient.NewConfiguration() apiClient := sonarrClient.NewAPIClient(configuration) - resp, r, err := apiClient.CustomFormatApi.ListCustomFormat(context.Background()).Execute() + resp, r, err := apiClient.CustomFormatApi.ListCustomFormatSchema(context.Background()).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `CustomFormatApi.ListCustomFormat``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `CustomFormatApi.ListCustomFormatSchema``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `ListCustomFormat`: []CustomFormatResource - fmt.Fprintf(os.Stdout, "Response from `CustomFormatApi.ListCustomFormat`: %v\n", resp) + // response from `ListCustomFormatSchema`: []CustomFormatSpecificationSchema + fmt.Fprintf(os.Stdout, "Response from `CustomFormatApi.ListCustomFormatSchema`: %v\n", resp) } ``` @@ -306,12 +308,12 @@ This endpoint does not need any parameter. ### Other Parameters -Other parameters are passed through a pointer to a apiListCustomFormatRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiListCustomFormatSchemaRequest struct via the builder pattern ### Return type -[**[]CustomFormatResource**](CustomFormatResource.md) +[**[]CustomFormatSpecificationSchema**](CustomFormatSpecificationSchema.md) ### Authorization