From 658433ae63905128bcad9547b06338bf3def45aa Mon Sep 17 00:00:00 2001 From: Giems <109511301+Giems@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:11:45 +0100 Subject: [PATCH] update grafana client codegen --- grafana-client-gen/run_codegen.sh | 51 ++- openapi/README.md | 15 - openapi/docs/AccessControlApi.md | 5 +- openapi/docs/AlertQueryExport.md | 2 +- openapi/docs/Certificate.md | 3 +- openapi/docs/CloudMigrationListResponse.md | 11 - openapi/docs/CloudMigrationRequest.md | 11 - openapi/docs/CloudMigrationResponse.md | 14 - openapi/docs/CloudMigrationRunList.md | 11 - openapi/docs/CookiePreferences.md | 6 +- openapi/docs/CorrelationConfig.md | 2 +- openapi/docs/CorrelationConfigUpdateDto.md | 2 +- openapi/docs/CreateAccessTokenResponseDto.md | 11 - openapi/docs/EnterpriseApi.md | 5 +- openapi/docs/FieldConfig.md | 4 +- openapi/docs/IpNet.md | 2 +- ...istAllProvidersSettings200ResponseInner.md | 2 +- openapi/docs/MigrateDataResponseDto.md | 12 - openapi/docs/MigrateDataResponseItemDto.md | 14 - openapi/docs/MigrationsApi.md | 239 ----------- openapi/docs/PublicError.md | 2 +- openapi/docs/QueryStat.md | 4 +- openapi/docs/RecordingRuleJson.md | 2 +- openapi/docs/Unstructured.md | 2 +- openapi/docs/UpdateProviderSettingsRequest.md | 2 +- openapi/docs/Url.md | 2 +- openapi/src/apis/access_control_api.rs | 7 +- openapi/src/apis/enterprise_api.rs | 7 +- openapi/src/apis/folders_api.rs | 265 +++--------- openapi/src/apis/migrations_api.rs | 405 ------------------ openapi/src/apis/mod.rs | 1 - openapi/src/models/alert_query_export.rs | 2 +- openapi/src/models/certificate.rs | 5 - .../models/cloud_migration_list_response.rs | 26 -- openapi/src/models/cloud_migration_request.rs | 26 -- .../src/models/cloud_migration_response.rs | 35 -- .../src/models/cloud_migration_run_list.rs | 26 -- openapi/src/models/cookie_preferences.rs | 6 +- openapi/src/models/correlation_config.rs | 4 +- .../models/correlation_config_update_dto.rs | 2 +- .../create_access_token_response_dto.rs | 26 -- .../src/models/delete_folder_200_response.rs | 26 +- openapi/src/models/field_config.rs | 4 +- openapi/src/models/ip_net.rs | 2 +- ...l_providers_settings_200_response_inner.rs | 2 +- .../src/models/migrate_data_response_dto.rs | 29 -- .../models/migrate_data_response_item_dto.rs | 65 --- openapi/src/models/mod.rs | 14 - openapi/src/models/name.rs | 4 +- openapi/src/models/public_error.rs | 2 +- openapi/src/models/query_stat.rs | 4 +- openapi/src/models/recording_rule_json.rs | 2 +- openapi/src/models/unstructured.rs | 2 +- .../update_provider_settings_request.rs | 2 +- openapi/src/models/url.rs | 6 +- 55 files changed, 160 insertions(+), 1283 deletions(-) delete mode 100755 openapi/docs/CloudMigrationListResponse.md delete mode 100755 openapi/docs/CloudMigrationRequest.md delete mode 100755 openapi/docs/CloudMigrationResponse.md delete mode 100755 openapi/docs/CloudMigrationRunList.md delete mode 100755 openapi/docs/CreateAccessTokenResponseDto.md delete mode 100755 openapi/docs/MigrateDataResponseDto.md delete mode 100755 openapi/docs/MigrateDataResponseItemDto.md delete mode 100755 openapi/docs/MigrationsApi.md delete mode 100755 openapi/src/apis/migrations_api.rs delete mode 100755 openapi/src/models/cloud_migration_list_response.rs delete mode 100755 openapi/src/models/cloud_migration_request.rs delete mode 100755 openapi/src/models/cloud_migration_response.rs delete mode 100755 openapi/src/models/cloud_migration_run_list.rs delete mode 100755 openapi/src/models/create_access_token_response_dto.rs delete mode 100755 openapi/src/models/migrate_data_response_dto.rs delete mode 100755 openapi/src/models/migrate_data_response_item_dto.rs diff --git a/grafana-client-gen/run_codegen.sh b/grafana-client-gen/run_codegen.sh index 326027f3..898ce113 100755 --- a/grafana-client-gen/run_codegen.sh +++ b/grafana-client-gen/run_codegen.sh @@ -1,5 +1,4 @@ #!/bin/bash - # Source both .env files if [ -f .env ]; then export $(cat .env | xargs) @@ -30,12 +29,29 @@ rm -rf $OPENAPI_GENERATOR_DIR echo "Setting up new build directory..." mkdir -p $OPENAPI_GENERATOR_DIR -# Get the commit hash for the version tag -echo "Getting commit hash for Grafana version $GRAFANA_VERSION_CLEAN..." -COMMIT_HASH=$(curl -s "https://api.github.com/repos/grafana/grafana/git/refs/tags/v$GRAFANA_VERSION_CLEAN" | grep -o '"sha": "[^"]*' | cut -d'"' -f4) +# First, get the tag reference +TAG_URL="https://api.github.com/repos/grafana/grafana/git/refs/tags/v$GRAFANA_VERSION_CLEAN" +echo "Fetching from tag URL: $TAG_URL" +TAG_DATA=$(curl -s "$TAG_URL") +echo "Tag API Response:" +echo "$TAG_DATA" + +# Get the SHA of the tag object +TAG_SHA=$(echo "$TAG_DATA" | grep -o '"sha": "[^"]*"' | head -1 | cut -d'"' -f4) +echo "Tag SHA: $TAG_SHA" + +# Now get the actual commit SHA that this tag points to +TAG_URL="https://api.github.com/repos/grafana/grafana/git/tags/$TAG_SHA" +echo "Fetching tag details from: $TAG_URL" +TAG_DETAILS=$(curl -s "$TAG_URL") +echo "Tag Details Response:" +echo "$TAG_DETAILS" -if [ -z "$COMMIT_HASH" ]; then - echo "Failed to get commit hash for version $GRAFANA_VERSION_CLEAN" +# Extract the actual commit SHA +COMMIT_HASH=$(echo "$TAG_DETAILS" | grep -o '"sha": "[^"]*"' | tail -1 | cut -d'"' -f4) + +if [ -z "$COMMIT_HASH" ] || [ "$COMMIT_HASH" = "null" ]; then + echo "Failed to get proper commit hash for version $GRAFANA_VERSION_CLEAN" exit 1 fi @@ -43,7 +59,9 @@ echo "Found commit hash: $COMMIT_HASH" # Download the OpenAPI spec for the specific version echo "Downloading OpenAPI spec for commit $COMMIT_HASH..." -curl -o $OPENAPI_GENERATOR_DIR/openapi3.json "https://raw.githubusercontent.com/grafana/grafana/$COMMIT_HASH/public/openapi3.json" +SPEC_URL="https://raw.githubusercontent.com/grafana/grafana/$COMMIT_HASH/public/openapi3.json" +echo "Downloading from: $SPEC_URL" +curl -L -o $OPENAPI_GENERATOR_DIR/openapi3.json "$SPEC_URL" if [ -f $OPENAPI_GENERATOR_DIR/openapi3.json ]; then echo "OPENAPI file downloaded successfully." @@ -52,11 +70,18 @@ else exit 1 fi +# Get current user's UID and GID +USER_ID=$(id -u) +GROUP_ID=$(id -g) + echo "Running Docker to generate code..." -docker run --rm -v ${PWD}/${OPENAPI_GENERATOR_DIR}:/local openapitools/openapi-generator-cli generate \ --i /local/openapi3.json \ --g $OPENAPI_LANGUAGE \ --o /local/grafana-rust-client +docker run --rm \ + --user $USER_ID:$GROUP_ID \ + -v ${PWD}/${OPENAPI_GENERATOR_DIR}:/local \ + openapitools/openapi-generator-cli generate \ + -i /local/openapi3.json \ + -g $OPENAPI_LANGUAGE \ + -o /local/grafana-rust-client echo "Code generation complete." @@ -73,9 +98,9 @@ if [ -d "$OPENAPI_GENERATOR_DIR/grafana-rust-client/src" ]; then cp -r "$OPENAPI_GENERATOR_DIR/grafana-rust-client" "$TARGET_DIR" echo "Files copied successfully to $TARGET_DIR." - echo "Setting full permissions for $TARGET_DIR..." + echo "Setting permissions for $TARGET_DIR..." chmod -R 777 "$TARGET_DIR" - echo "Permissions set to 777 for all files and directories in $TARGET_DIR." + echo "Permissions set for all files and directories in $TARGET_DIR." else echo "Code generation did not complete successfully; src directory not found." exit 1 diff --git a/openapi/README.md b/openapi/README.md index 7b5165c8..98af9f64 100755 --- a/openapi/README.md +++ b/openapi/README.md @@ -222,14 +222,6 @@ Class | Method | HTTP request | Description *LicensingApi* | [**post_license_token**](docs/LicensingApi.md#post_license_token) | **POST** /licensing/token | Create license token. *LicensingApi* | [**post_renew_license_token**](docs/LicensingApi.md#post_renew_license_token) | **POST** /licensing/token/renew | Manually force license refresh. *LicensingApi* | [**refresh_license_stats**](docs/LicensingApi.md#refresh_license_stats) | **GET** /licensing/refresh-stats | Refresh license stats. -*MigrationsApi* | [**create_cloud_migration_token**](docs/MigrationsApi.md#create_cloud_migration_token) | **POST** /cloudmigration/token | Create gcom access token. -*MigrationsApi* | [**create_migration**](docs/MigrationsApi.md#create_migration) | **POST** /cloudmigration/migration | Create a migration. -*MigrationsApi* | [**delete_cloud_migration**](docs/MigrationsApi.md#delete_cloud_migration) | **DELETE** /cloudmigration/migration/{id} | Delete a migration. -*MigrationsApi* | [**get_cloud_migration**](docs/MigrationsApi.md#get_cloud_migration) | **GET** /cloudmigration/migration/{id} | Get a cloud migration. -*MigrationsApi* | [**get_cloud_migration_run**](docs/MigrationsApi.md#get_cloud_migration_run) | **GET** /cloudmigration/migration/{id}/run/{runID} | Get the result of a single migration run. -*MigrationsApi* | [**get_cloud_migration_run_list**](docs/MigrationsApi.md#get_cloud_migration_run_list) | **GET** /cloudmigration/migration/{id}/run | Get a list of migration runs for a migration. -*MigrationsApi* | [**get_migration_list**](docs/MigrationsApi.md#get_migration_list) | **GET** /cloudmigration/migration | Get a list of all cloud migrations. -*MigrationsApi* | [**run_cloud_migration**](docs/MigrationsApi.md#run_cloud_migration) | **POST** /cloudmigration/migration/{id}/run | Trigger the run of a migration to the Grafana Cloud. *OrgApi* | [**add_org_user_to_current_org**](docs/OrgApi.md#add_org_user_to_current_org) | **POST** /org/users | Add a new user to the current organization. *OrgApi* | [**get_current_org**](docs/OrgApi.md#get_current_org) | **GET** /org | Get current Organization. *OrgApi* | [**get_org_users_for_current_org**](docs/OrgApi.md#get_org_users_for_current_org) | **GET** /org/users | Get all users within the current organization. @@ -446,10 +438,6 @@ Class | Method | HTTP request | Description - [Certificate](docs/Certificate.md) - [ChangeUserPasswordCommand](docs/ChangeUserPasswordCommand.md) - [ClearHelpFlags200Response](docs/ClearHelpFlags200Response.md) - - [CloudMigrationListResponse](docs/CloudMigrationListResponse.md) - - [CloudMigrationRequest](docs/CloudMigrationRequest.md) - - [CloudMigrationResponse](docs/CloudMigrationResponse.md) - - [CloudMigrationRunList](docs/CloudMigrationRunList.md) - [ClusterStatus](docs/ClusterStatus.md) - [Config](docs/Config.md) - [ContactPointExport](docs/ContactPointExport.md) @@ -457,7 +445,6 @@ Class | Method | HTTP request | Description - [Correlation](docs/Correlation.md) - [CorrelationConfig](docs/CorrelationConfig.md) - [CorrelationConfigUpdateDto](docs/CorrelationConfigUpdateDto.md) - - [CreateAccessTokenResponseDto](docs/CreateAccessTokenResponseDto.md) - [CreateCorrelationCommand](docs/CreateCorrelationCommand.md) - [CreateCorrelationResponseBody](docs/CreateCorrelationResponseBody.md) - [CreateDashboardSnapshot200Response](docs/CreateDashboardSnapshot200Response.md) @@ -566,8 +553,6 @@ Class | Method | HTTP request | Description - [MassDeleteAnnotationsCmd](docs/MassDeleteAnnotationsCmd.md) - [Matcher](docs/Matcher.md) - [MetricRequest](docs/MetricRequest.md) - - [MigrateDataResponseDto](docs/MigrateDataResponseDto.md) - - [MigrateDataResponseItemDto](docs/MigrateDataResponseItemDto.md) - [MoveFolderCommand](docs/MoveFolderCommand.md) - [MsTeamsConfig](docs/MsTeamsConfig.md) - [MuteTimeInterval](docs/MuteTimeInterval.md) diff --git a/openapi/docs/AccessControlApi.md b/openapi/docs/AccessControlApi.md index b1573b74..98efbc88 100755 --- a/openapi/docs/AccessControlApi.md +++ b/openapi/docs/AccessControlApi.md @@ -301,10 +301,10 @@ Name | Type | Description | Required | Notes ## list_roles -> Vec list_roles(delegatable, include_hidden) +> Vec list_roles(delegatable) Get all roles. -Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in. You need to have a permission with action `roles:read` and scope `roles:*`. The `delegatable` flag reduces the set of roles to only those for which the signed-in user has permissions to assign. +Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in. You need to have a permission with action `roles:read` and scope `roles:*`. ### Parameters @@ -312,7 +312,6 @@ Gets all existing roles. The response contains all global and organization local Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **delegatable** | Option<**bool**> | | | -**include_hidden** | Option<**bool**> | | | ### Return type diff --git a/openapi/docs/AlertQueryExport.md b/openapi/docs/AlertQueryExport.md index 50c09a87..db5fe0fc 100755 --- a/openapi/docs/AlertQueryExport.md +++ b/openapi/docs/AlertQueryExport.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **datasource_uid** | Option<**String**> | | [optional] -**model** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | | [optional] +**model** | Option<[**serde_json::Value**](.md)> | | [optional] **query_type** | Option<**String**> | | [optional] **ref_id** | Option<**String**> | | [optional] **relative_time_range** | Option<[**models::RelativeTimeRangeExport**](RelativeTimeRangeExport.md)> | | [optional] diff --git a/openapi/docs/Certificate.md b/openapi/docs/Certificate.md index 6ab071ac..9ce30d32 100755 --- a/openapi/docs/Certificate.md +++ b/openapi/docs/Certificate.md @@ -30,8 +30,7 @@ Name | Type | Description | Notes **permitted_email_addresses** | Option<**Vec**> | | [optional] **permitted_ip_ranges** | Option<[**Vec**](IPNet.md)> | | [optional] **permitted_uri_domains** | Option<**Vec**> | | [optional] -**policies** | Option<[**Vec**](serde_json::Value.md)> | Policies contains all policy identifiers included in the certificate. In Go 1.22, encoding/gob cannot handle and ignores this field. | [optional] -**policy_identifiers** | Option<[**Vec>**](Vec.md)> | PolicyIdentifiers contains asn1.ObjectIdentifiers, the components of which are limited to int32. If a certificate contains a policy which cannot be represented by asn1.ObjectIdentifier, it will not be included in PolicyIdentifiers, but will be present in Policies, which contains all parsed policy OIDs. | [optional] +**policy_identifiers** | Option<[**Vec>**](Vec.md)> | | [optional] **public_key** | Option<[**serde_json::Value**](.md)> | | [optional] **public_key_algorithm** | Option<**i64**> | | [optional] **raw** | Option<**Vec**> | | [optional] diff --git a/openapi/docs/CloudMigrationListResponse.md b/openapi/docs/CloudMigrationListResponse.md deleted file mode 100755 index 27cab7c9..00000000 --- a/openapi/docs/CloudMigrationListResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CloudMigrationListResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**migrations** | Option<[**Vec**](CloudMigrationResponse.md)> | | [optional] - -[[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/openapi/docs/CloudMigrationRequest.md b/openapi/docs/CloudMigrationRequest.md deleted file mode 100755 index d7afab7d..00000000 --- a/openapi/docs/CloudMigrationRequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# CloudMigrationRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth_token** | Option<**String**> | | [optional] - -[[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/openapi/docs/CloudMigrationResponse.md b/openapi/docs/CloudMigrationResponse.md deleted file mode 100755 index 65902acd..00000000 --- a/openapi/docs/CloudMigrationResponse.md +++ /dev/null @@ -1,14 +0,0 @@ -# CloudMigrationResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created** | Option<**String**> | | [optional] -**id** | Option<**i64**> | | [optional] -**stack** | Option<**String**> | | [optional] -**updated** | Option<**String**> | | [optional] - -[[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/openapi/docs/CloudMigrationRunList.md b/openapi/docs/CloudMigrationRunList.md deleted file mode 100755 index 936e7cba..00000000 --- a/openapi/docs/CloudMigrationRunList.md +++ /dev/null @@ -1,11 +0,0 @@ -# CloudMigrationRunList - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**runs** | Option<[**Vec**](MigrateDataResponseDTO.md)> | | [optional] - -[[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/openapi/docs/CookiePreferences.md b/openapi/docs/CookiePreferences.md index b9cee54e..d1830af9 100755 --- a/openapi/docs/CookiePreferences.md +++ b/openapi/docs/CookiePreferences.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**analytics** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | | [optional] -**functional** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | | [optional] -**performance** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | | [optional] +**analytics** | Option<[**serde_json::Value**](.md)> | | [optional] +**functional** | Option<[**serde_json::Value**](.md)> | | [optional] +**performance** | Option<[**serde_json::Value**](.md)> | | [optional] [[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/openapi/docs/CorrelationConfig.md b/openapi/docs/CorrelationConfig.md index ce1cd210..e4c1010a 100755 --- a/openapi/docs/CorrelationConfig.md +++ b/openapi/docs/CorrelationConfig.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **field** | **String** | Field used to attach the correlation link | -**target** | [**std::collections::HashMap**](serde_json::Value.md) | Target data query | +**target** | [**serde_json::Value**](.md) | Target data query | **transformations** | Option<[**Vec**](Transformation.md)> | | [optional] **r#type** | **String** | | diff --git a/openapi/docs/CorrelationConfigUpdateDto.md b/openapi/docs/CorrelationConfigUpdateDto.md index 296d0db7..9375f777 100755 --- a/openapi/docs/CorrelationConfigUpdateDto.md +++ b/openapi/docs/CorrelationConfigUpdateDto.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **field** | Option<**String**> | Field used to attach the correlation link | [optional] -**target** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | Target data query | [optional] +**target** | Option<[**serde_json::Value**](.md)> | Target data query | [optional] **transformations** | Option<[**Vec**](Transformation.md)> | Source data transformations | [optional] **r#type** | Option<**String**> | | [optional] diff --git a/openapi/docs/CreateAccessTokenResponseDto.md b/openapi/docs/CreateAccessTokenResponseDto.md deleted file mode 100755 index 70480332..00000000 --- a/openapi/docs/CreateAccessTokenResponseDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateAccessTokenResponseDto - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**token** | Option<**String**> | | [optional] - -[[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/openapi/docs/EnterpriseApi.md b/openapi/docs/EnterpriseApi.md index 99341cd4..83a6c946 100755 --- a/openapi/docs/EnterpriseApi.md +++ b/openapi/docs/EnterpriseApi.md @@ -902,10 +902,10 @@ This endpoint does not need any parameter. ## list_roles -> Vec list_roles(delegatable, include_hidden) +> Vec list_roles(delegatable) Get all roles. -Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in. You need to have a permission with action `roles:read` and scope `roles:*`. The `delegatable` flag reduces the set of roles to only those for which the signed-in user has permissions to assign. +Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in. You need to have a permission with action `roles:read` and scope `roles:*`. ### Parameters @@ -913,7 +913,6 @@ Gets all existing roles. The response contains all global and organization local Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **delegatable** | Option<**bool**> | | | -**include_hidden** | Option<**bool**> | | | ### Return type diff --git a/openapi/docs/FieldConfig.md b/openapi/docs/FieldConfig.md index 30086dea..d3a37fcf 100755 --- a/openapi/docs/FieldConfig.md +++ b/openapi/docs/FieldConfig.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**color** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | Map values to a display color NOTE: this interface is under development in the frontend... so simple map for now | [optional] -**custom** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | Panel Specific Values | [optional] +**color** | Option<[**serde_json::Value**](.md)> | Map values to a display color NOTE: this interface is under development in the frontend... so simple map for now | [optional] +**custom** | Option<[**serde_json::Value**](.md)> | Panel Specific Values | [optional] **decimals** | Option<**i32**> | | [optional] **description** | Option<**String**> | Description is human readable field metadata | [optional] **display_name** | Option<**String**> | DisplayName overrides Grafana default naming, should not be used from a data source | [optional] diff --git a/openapi/docs/IpNet.md b/openapi/docs/IpNet.md index f47cc46f..d87b9d5a 100755 --- a/openapi/docs/IpNet.md +++ b/openapi/docs/IpNet.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ip** | Option<**String**> | | [optional] -**mask** | Option<**Vec**> | See type [IPNet] and func [ParseCIDR] for details. | [optional] +**mask** | Option<**Vec**> | See type IPNet and func ParseCIDR for details. | [optional] [[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/openapi/docs/ListAllProvidersSettings200ResponseInner.md b/openapi/docs/ListAllProvidersSettings200ResponseInner.md index c2c8aede..dcaf183b 100755 --- a/openapi/docs/ListAllProvidersSettings200ResponseInner.md +++ b/openapi/docs/ListAllProvidersSettings200ResponseInner.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | Option<**String**> | | [optional] **provider** | Option<**String**> | | [optional] -**settings** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | | [optional] +**settings** | Option<[**serde_json::Value**](.md)> | | [optional] **source** | Option<**String**> | | [optional] [[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/openapi/docs/MigrateDataResponseDto.md b/openapi/docs/MigrateDataResponseDto.md deleted file mode 100755 index bc9c7fc2..00000000 --- a/openapi/docs/MigrateDataResponseDto.md +++ /dev/null @@ -1,12 +0,0 @@ -# MigrateDataResponseDto - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<**i64**> | | [optional] -**items** | Option<[**Vec**](MigrateDataResponseItemDTO.md)> | | [optional] - -[[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/openapi/docs/MigrateDataResponseItemDto.md b/openapi/docs/MigrateDataResponseItemDto.md deleted file mode 100755 index 33eba195..00000000 --- a/openapi/docs/MigrateDataResponseItemDto.md +++ /dev/null @@ -1,14 +0,0 @@ -# MigrateDataResponseItemDto - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**error** | Option<**String**> | | [optional] -**ref_id** | **String** | | -**status** | **String** | | -**r#type** | **String** | | - -[[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/openapi/docs/MigrationsApi.md b/openapi/docs/MigrationsApi.md deleted file mode 100755 index 42cf6a09..00000000 --- a/openapi/docs/MigrationsApi.md +++ /dev/null @@ -1,239 +0,0 @@ -# \MigrationsApi - -All URIs are relative to */api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_cloud_migration_token**](MigrationsApi.md#create_cloud_migration_token) | **POST** /cloudmigration/token | Create gcom access token. -[**create_migration**](MigrationsApi.md#create_migration) | **POST** /cloudmigration/migration | Create a migration. -[**delete_cloud_migration**](MigrationsApi.md#delete_cloud_migration) | **DELETE** /cloudmigration/migration/{id} | Delete a migration. -[**get_cloud_migration**](MigrationsApi.md#get_cloud_migration) | **GET** /cloudmigration/migration/{id} | Get a cloud migration. -[**get_cloud_migration_run**](MigrationsApi.md#get_cloud_migration_run) | **GET** /cloudmigration/migration/{id}/run/{runID} | Get the result of a single migration run. -[**get_cloud_migration_run_list**](MigrationsApi.md#get_cloud_migration_run_list) | **GET** /cloudmigration/migration/{id}/run | Get a list of migration runs for a migration. -[**get_migration_list**](MigrationsApi.md#get_migration_list) | **GET** /cloudmigration/migration | Get a list of all cloud migrations. -[**run_cloud_migration**](MigrationsApi.md#run_cloud_migration) | **POST** /cloudmigration/migration/{id}/run | Trigger the run of a migration to the Grafana Cloud. - - - -## create_cloud_migration_token - -> models::CreateAccessTokenResponseDto create_cloud_migration_token() -Create gcom access token. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::CreateAccessTokenResponseDto**](CreateAccessTokenResponseDTO.md) - -### Authorization - -[api_key](../README.md#api_key), [basic](../README.md#basic) - -### HTTP request headers - -- **Content-Type**: 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) - - -## create_migration - -> models::CloudMigrationResponse create_migration(cloud_migration_request) -Create a migration. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**cloud_migration_request** | [**CloudMigrationRequest**](CloudMigrationRequest.md) | | [required] | - -### Return type - -[**models::CloudMigrationResponse**](CloudMigrationResponse.md) - -### Authorization - -[api_key](../README.md#api_key), [basic](../README.md#basic) - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## delete_cloud_migration - -> delete_cloud_migration(id) -Delete a migration. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | ID of an migration | [required] | - -### Return type - - (empty response body) - -### Authorization - -[api_key](../README.md#api_key), [basic](../README.md#basic) - -### HTTP request headers - -- **Content-Type**: 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) - - -## get_cloud_migration - -> models::CloudMigrationResponse get_cloud_migration(id) -Get a cloud migration. - -It returns migrations that has been created. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | ID of an migration | [required] | - -### Return type - -[**models::CloudMigrationResponse**](CloudMigrationResponse.md) - -### Authorization - -[api_key](../README.md#api_key), [basic](../README.md#basic) - -### HTTP request headers - -- **Content-Type**: 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) - - -## get_cloud_migration_run - -> models::MigrateDataResponseDto get_cloud_migration_run(id, run_id) -Get the result of a single migration run. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | ID of an migration | [required] | -**run_id** | **i64** | Run ID of a migration run | [required] | - -### Return type - -[**models::MigrateDataResponseDto**](MigrateDataResponseDTO.md) - -### Authorization - -[api_key](../README.md#api_key), [basic](../README.md#basic) - -### HTTP request headers - -- **Content-Type**: 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) - - -## get_cloud_migration_run_list - -> models::CloudMigrationRunList get_cloud_migration_run_list(id) -Get a list of migration runs for a migration. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | ID of an migration | [required] | - -### Return type - -[**models::CloudMigrationRunList**](CloudMigrationRunList.md) - -### Authorization - -[api_key](../README.md#api_key), [basic](../README.md#basic) - -### HTTP request headers - -- **Content-Type**: 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) - - -## get_migration_list - -> models::CloudMigrationListResponse get_migration_list() -Get a list of all cloud migrations. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::CloudMigrationListResponse**](CloudMigrationListResponse.md) - -### Authorization - -[api_key](../README.md#api_key), [basic](../README.md#basic) - -### HTTP request headers - -- **Content-Type**: 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) - - -## run_cloud_migration - -> models::MigrateDataResponseDto run_cloud_migration(id) -Trigger the run of a migration to the Grafana Cloud. - -It returns migrations that has been created. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | ID of an migration | [required] | - -### Return type - -[**models::MigrateDataResponseDto**](MigrateDataResponseDTO.md) - -### Authorization - -[api_key](../README.md#api_key), [basic](../README.md#basic) - -### HTTP request headers - -- **Content-Type**: 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) - diff --git a/openapi/docs/PublicError.md b/openapi/docs/PublicError.md index e260865e..c2d41758 100755 --- a/openapi/docs/PublicError.md +++ b/openapi/docs/PublicError.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**extra** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | Extra Additional information about the error | [optional] +**extra** | Option<[**serde_json::Value**](.md)> | Extra Additional information about the error | [optional] **message** | Option<**String**> | Message A human readable message | [optional] **message_id** | **String** | MessageID A unique identifier for the error | **status_code** | **i64** | StatusCode The HTTP status code returned | diff --git a/openapi/docs/QueryStat.md b/openapi/docs/QueryStat.md index ad445bc2..2197af41 100755 --- a/openapi/docs/QueryStat.md +++ b/openapi/docs/QueryStat.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**color** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | Map values to a display color NOTE: this interface is under development in the frontend... so simple map for now | [optional] -**custom** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | Panel Specific Values | [optional] +**color** | Option<[**serde_json::Value**](.md)> | Map values to a display color NOTE: this interface is under development in the frontend... so simple map for now | [optional] +**custom** | Option<[**serde_json::Value**](.md)> | Panel Specific Values | [optional] **decimals** | Option<**i32**> | | [optional] **description** | Option<**String**> | Description is human readable field metadata | [optional] **display_name** | Option<**String**> | DisplayName overrides Grafana default naming, should not be used from a data source | [optional] diff --git a/openapi/docs/RecordingRuleJson.md b/openapi/docs/RecordingRuleJson.md index 4495cbbe..a02ffb0e 100755 --- a/openapi/docs/RecordingRuleJson.md +++ b/openapi/docs/RecordingRuleJson.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **interval** | Option<**i64**> | | [optional] **name** | Option<**String**> | | [optional] **prom_name** | Option<**String**> | | [optional] -**queries** | Option<[**Vec>**](std::collections::HashMap.md)> | | [optional] +**queries** | Option<[**Vec**](serde_json::Value.md)> | | [optional] **range** | Option<**i64**> | | [optional] **target_ref_id** | Option<**String**> | | [optional] diff --git a/openapi/docs/Unstructured.md b/openapi/docs/Unstructured.md index 720bfa81..264352cf 100755 --- a/openapi/docs/Unstructured.md +++ b/openapi/docs/Unstructured.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**object** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | Object is a JSON compatible map with string, float, int, bool, []interface{}, or map[string]interface{} children. | [optional] +**object** | Option<[**serde_json::Value**](.md)> | Object is a JSON compatible map with string, float, int, bool, []interface{}, or map[string]interface{} children. | [optional] [[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/openapi/docs/UpdateProviderSettingsRequest.md b/openapi/docs/UpdateProviderSettingsRequest.md index a45b3666..99386b04 100755 --- a/openapi/docs/UpdateProviderSettingsRequest.md +++ b/openapi/docs/UpdateProviderSettingsRequest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | Option<**String**> | | [optional] **provider** | Option<**String**> | | [optional] -**settings** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | | [optional] +**settings** | Option<[**serde_json::Value**](.md)> | | [optional] [[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/openapi/docs/Url.md b/openapi/docs/Url.md index 0ad55078..43d53024 100755 --- a/openapi/docs/Url.md +++ b/openapi/docs/Url.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **raw_path** | Option<**String**> | | [optional] **raw_query** | Option<**String**> | | [optional] **scheme** | Option<**String**> | | [optional] -**user** | Option<[**serde_json::Value**](.md)> | The Userinfo type is an immutable encapsulation of username and password details for a [URL]. An existing Userinfo value is guaranteed to have a username set (potentially empty, as allowed by RFC 2396), and optionally a password. | [optional] +**user** | Option<[**serde_json::Value**](.md)> | The Userinfo type is an immutable encapsulation of username and password details for a URL. An existing Userinfo value is guaranteed to have a username set (potentially empty, as allowed by RFC 2396), and optionally a password. | [optional] [[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/openapi/src/apis/access_control_api.rs b/openapi/src/apis/access_control_api.rs index 68564f90..8831998f 100755 --- a/openapi/src/apis/access_control_api.rs +++ b/openapi/src/apis/access_control_api.rs @@ -621,8 +621,8 @@ pub async fn get_role_assignments(configuration: &configuration::Configuration, } } -/// Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in. You need to have a permission with action `roles:read` and scope `roles:*`. The `delegatable` flag reduces the set of roles to only those for which the signed-in user has permissions to assign. -pub async fn list_roles(configuration: &configuration::Configuration, delegatable: Option, include_hidden: Option) -> Result, Error> { +/// Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in. You need to have a permission with action `roles:read` and scope `roles:*`. +pub async fn list_roles(configuration: &configuration::Configuration, delegatable: Option) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -633,9 +633,6 @@ pub async fn list_roles(configuration: &configuration::Configuration, delegatabl if let Some(ref local_var_str) = delegatable { local_var_req_builder = local_var_req_builder.query(&[("delegatable", &local_var_str.to_string())]); } - if let Some(ref local_var_str) = include_hidden { - local_var_req_builder = local_var_req_builder.query(&[("includeHidden", &local_var_str.to_string())]); - } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } diff --git a/openapi/src/apis/enterprise_api.rs b/openapi/src/apis/enterprise_api.rs index 5b917f77..61e40b2e 100755 --- a/openapi/src/apis/enterprise_api.rs +++ b/openapi/src/apis/enterprise_api.rs @@ -1753,8 +1753,8 @@ pub async fn list_recording_rules(configuration: &configuration::Configuration, } } -/// Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in. You need to have a permission with action `roles:read` and scope `roles:*`. The `delegatable` flag reduces the set of roles to only those for which the signed-in user has permissions to assign. -pub async fn list_roles(configuration: &configuration::Configuration, delegatable: Option, include_hidden: Option) -> Result, Error> { +/// Gets all existing roles. The response contains all global and organization local roles, for the organization which user is signed in. You need to have a permission with action `roles:read` and scope `roles:*`. +pub async fn list_roles(configuration: &configuration::Configuration, delegatable: Option) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; @@ -1765,9 +1765,6 @@ pub async fn list_roles(configuration: &configuration::Configuration, delegatabl if let Some(ref local_var_str) = delegatable { local_var_req_builder = local_var_req_builder.query(&[("delegatable", &local_var_str.to_string())]); } - if let Some(ref local_var_str) = include_hidden { - local_var_req_builder = local_var_req_builder.query(&[("includeHidden", &local_var_str.to_string())]); - } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } diff --git a/openapi/src/apis/folders_api.rs b/openapi/src/apis/folders_api.rs index 015952b4..b9a70bc4 100755 --- a/openapi/src/apis/folders_api.rs +++ b/openapi/src/apis/folders_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ + use reqwest; -use super::{configuration, Error}; use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + /// struct for typed errors of method [`create_folder`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -104,22 +106,18 @@ pub enum UpdateFolderError { UnknownValue(serde_json::Value), } + /// If nested folders are enabled then it additionally expects the parent folder UID. -pub async fn create_folder( - configuration: &configuration::Configuration, - create_folder_command: models::CreateFolderCommand, -) -> Result> { +pub async fn create_folder(configuration: &configuration::Configuration, create_folder_command: models::CreateFolderCommand) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/folders", local_var_configuration.base_path); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_apikey) = local_var_configuration.api_key { let local_var_key = local_var_apikey.key.clone(); @@ -130,10 +128,7 @@ pub async fn create_folder( local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); }; if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth( - local_var_auth_conf.0.to_owned(), - local_var_auth_conf.1.to_owned(), - ); + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&create_folder_command); @@ -146,43 +141,26 @@ pub async fn create_folder( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } -// Response for this method has been modified - errors in the original OpenAPI spec /// Deletes an existing folder identified by UID along with all dashboards (and their alerts) stored in the folder. This operation cannot be reverted. If nested folders are enabled then it also deletes all the subfolders. -pub async fn delete_folder( - configuration: &configuration::Configuration, - folder_uid: &str, - force_delete_rules: Option, -) -> Result> { +pub async fn delete_folder(configuration: &configuration::Configuration, folder_uid: &str, force_delete_rules: Option) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!( - "{}/folders/{folder_uid}", - local_var_configuration.base_path, - folder_uid = crate::apis::urlencode(folder_uid) - ); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!("{}/folders/{folder_uid}", local_var_configuration.base_path, folder_uid=crate::apis::urlencode(folder_uid)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); if let Some(ref local_var_str) = force_delete_rules { - local_var_req_builder = - local_var_req_builder.query(&[("forceDeleteRules", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("forceDeleteRules", &local_var_str.to_string())]); } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_apikey) = local_var_configuration.api_key { let local_var_key = local_var_apikey.key.clone(); @@ -193,14 +171,10 @@ pub async fn delete_folder( local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); }; if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth( - local_var_auth_conf.0.to_owned(), - local_var_auth_conf.1.to_owned(), - ); + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); }; let local_var_req = local_var_req_builder.build()?; - println!("req: {:?}", local_var_req); let local_var_resp = local_var_client.execute(local_var_req).await?; let local_var_status = local_var_resp.status(); @@ -209,37 +183,23 @@ pub async fn delete_folder( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// Returns the folder identified by id. This is deprecated. Please refer to [updated API](#/folders/getFolderByUID) instead -pub async fn get_folder_by_id( - configuration: &configuration::Configuration, - folder_id: i64, -) -> Result> { +pub async fn get_folder_by_id(configuration: &configuration::Configuration, folder_id: i64) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!( - "{}/folders/id/{folder_id}", - local_var_configuration.base_path, - folder_id = folder_id - ); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!("{}/folders/id/{folder_id}", local_var_configuration.base_path, folder_id=folder_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_apikey) = local_var_configuration.api_key { let local_var_key = local_var_apikey.key.clone(); @@ -250,10 +210,7 @@ pub async fn get_folder_by_id( local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); }; if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth( - local_var_auth_conf.0.to_owned(), - local_var_auth_conf.1.to_owned(), - ); + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); }; let local_var_req = local_var_req_builder.build()?; @@ -265,36 +222,22 @@ pub async fn get_folder_by_id( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } -pub async fn get_folder_by_uid( - configuration: &configuration::Configuration, - folder_uid: &str, -) -> Result> { +pub async fn get_folder_by_uid(configuration: &configuration::Configuration, folder_uid: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!( - "{}/folders/{folder_uid}", - local_var_configuration.base_path, - folder_uid = crate::apis::urlencode(folder_uid) - ); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!("{}/folders/{folder_uid}", local_var_configuration.base_path, folder_uid=crate::apis::urlencode(folder_uid)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_apikey) = local_var_configuration.api_key { let local_var_key = local_var_apikey.key.clone(); @@ -305,10 +248,7 @@ pub async fn get_folder_by_uid( local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); }; if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth( - local_var_auth_conf.0.to_owned(), - local_var_auth_conf.1.to_owned(), - ); + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); }; let local_var_req = local_var_req_builder.build()?; @@ -320,36 +260,22 @@ pub async fn get_folder_by_uid( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } -pub async fn get_folder_descendant_counts( - configuration: &configuration::Configuration, - folder_uid: &str, -) -> Result, Error> { +pub async fn get_folder_descendant_counts(configuration: &configuration::Configuration, folder_uid: &str) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!( - "{}/folders/{folder_uid}/counts", - local_var_configuration.base_path, - folder_uid = crate::apis::urlencode(folder_uid) - ); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!("{}/folders/{folder_uid}/counts", local_var_configuration.base_path, folder_uid=crate::apis::urlencode(folder_uid)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_apikey) = local_var_configuration.api_key { let local_var_key = local_var_apikey.key.clone(); @@ -360,10 +286,7 @@ pub async fn get_folder_descendant_counts( local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); }; if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth( - local_var_auth_conf.0.to_owned(), - local_var_auth_conf.1.to_owned(), - ); + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); }; let local_var_req = local_var_req_builder.build()?; @@ -375,52 +298,35 @@ pub async fn get_folder_descendant_counts( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// It returns all folders that the authenticated user has permission to view. If nested folders are enabled, it expects an additional query parameter with the parent folder UID and returns the immediate subfolders that the authenticated user has permission to view. If the parameter is not supplied then it returns immediate subfolders under the root that the authenticated user has permission to view. -pub async fn get_folders( - configuration: &configuration::Configuration, - limit: Option, - page: Option, - parent_uid: Option<&str>, - permission: Option<&str>, -) -> Result, Error> { +pub async fn get_folders(configuration: &configuration::Configuration, limit: Option, page: Option, parent_uid: Option<&str>, permission: Option<&str>) -> Result, Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/folders", local_var_configuration.base_path); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_str) = limit { - local_var_req_builder = - local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); } if let Some(ref local_var_str) = page { - local_var_req_builder = - local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); } if let Some(ref local_var_str) = parent_uid { - local_var_req_builder = - local_var_req_builder.query(&[("parentUid", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("parentUid", &local_var_str.to_string())]); } if let Some(ref local_var_str) = permission { - local_var_req_builder = - local_var_req_builder.query(&[("permission", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("permission", &local_var_str.to_string())]); } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_apikey) = local_var_configuration.api_key { let local_var_key = local_var_apikey.key.clone(); @@ -431,10 +337,7 @@ pub async fn get_folders( local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); }; if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth( - local_var_auth_conf.0.to_owned(), - local_var_auth_conf.1.to_owned(), - ); + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); }; let local_var_req = local_var_req_builder.build()?; @@ -446,37 +349,22 @@ pub async fn get_folders( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } -pub async fn move_folder( - configuration: &configuration::Configuration, - folder_uid: &str, - move_folder_command: models::MoveFolderCommand, -) -> Result> { +pub async fn move_folder(configuration: &configuration::Configuration, folder_uid: &str, move_folder_command: models::MoveFolderCommand) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!( - "{}/folders/{folder_uid}/move", - local_var_configuration.base_path, - folder_uid = crate::apis::urlencode(folder_uid) - ); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!("{}/folders/{folder_uid}/move", local_var_configuration.base_path, folder_uid=crate::apis::urlencode(folder_uid)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_apikey) = local_var_configuration.api_key { let local_var_key = local_var_apikey.key.clone(); @@ -487,10 +375,7 @@ pub async fn move_folder( local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); }; if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth( - local_var_auth_conf.0.to_owned(), - local_var_auth_conf.1.to_owned(), - ); + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&move_folder_command); @@ -503,37 +388,22 @@ pub async fn move_folder( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } -pub async fn update_folder( - configuration: &configuration::Configuration, - folder_uid: &str, - update_folder_command: models::UpdateFolderCommand, -) -> Result> { +pub async fn update_folder(configuration: &configuration::Configuration, folder_uid: &str, update_folder_command: models::UpdateFolderCommand) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!( - "{}/folders/{folder_uid}", - local_var_configuration.base_path, - folder_uid = crate::apis::urlencode(folder_uid) - ); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + let local_var_uri_str = format!("{}/folders/{folder_uid}", local_var_configuration.base_path, folder_uid=crate::apis::urlencode(folder_uid)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_apikey) = local_var_configuration.api_key { let local_var_key = local_var_apikey.key.clone(); @@ -544,10 +414,7 @@ pub async fn update_folder( local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); }; if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth( - local_var_auth_conf.0.to_owned(), - local_var_auth_conf.1.to_owned(), - ); + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); }; local_var_req_builder = local_var_req_builder.json(&update_folder_command); @@ -560,13 +427,9 @@ pub async fn update_folder( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } + diff --git a/openapi/src/apis/migrations_api.rs b/openapi/src/apis/migrations_api.rs deleted file mode 100755 index ae8b1529..00000000 --- a/openapi/src/apis/migrations_api.rs +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Grafana HTTP API. - * - * The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, creating users and updating data sources. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: hello@grafana.com - * Generated by: https://openapi-generator.tech - */ - - -use reqwest; - -use crate::{apis::ResponseContent, models}; -use super::{Error, configuration}; - - -/// struct for typed errors of method [`create_cloud_migration_token`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateCloudMigrationTokenError { - Status401(models::ErrorResponseBody), - Status403(models::ErrorResponseBody), - Status500(models::ErrorResponseBody), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`create_migration`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateMigrationError { - Status401(models::ErrorResponseBody), - Status403(models::ErrorResponseBody), - Status500(models::ErrorResponseBody), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_cloud_migration`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteCloudMigrationError { - Status401(models::ErrorResponseBody), - Status403(models::ErrorResponseBody), - Status500(models::ErrorResponseBody), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_cloud_migration`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetCloudMigrationError { - Status401(models::ErrorResponseBody), - Status403(models::ErrorResponseBody), - Status500(models::ErrorResponseBody), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_cloud_migration_run`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetCloudMigrationRunError { - Status401(models::ErrorResponseBody), - Status403(models::ErrorResponseBody), - Status500(models::ErrorResponseBody), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_cloud_migration_run_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetCloudMigrationRunListError { - Status401(models::ErrorResponseBody), - Status403(models::ErrorResponseBody), - Status500(models::ErrorResponseBody), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_migration_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetMigrationListError { - Status401(models::ErrorResponseBody), - Status403(models::ErrorResponseBody), - Status500(models::ErrorResponseBody), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`run_cloud_migration`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RunCloudMigrationError { - Status401(models::ErrorResponseBody), - Status403(models::ErrorResponseBody), - Status500(models::ErrorResponseBody), - UnknownValue(serde_json::Value), -} - - -pub async fn create_cloud_migration_token(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/cloudmigration/token", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn create_migration(configuration: &configuration::Configuration, cloud_migration_request: models::CloudMigrationRequest) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/cloudmigration/migration", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&cloud_migration_request); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn delete_cloud_migration(configuration: &configuration::Configuration, id: i64) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/cloudmigration/migration/{id}", local_var_configuration.base_path, id=id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// It returns migrations that has been created. -pub async fn get_cloud_migration(configuration: &configuration::Configuration, id: i64) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/cloudmigration/migration/{id}", local_var_configuration.base_path, id=id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn get_cloud_migration_run(configuration: &configuration::Configuration, id: i64, run_id: i64) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/cloudmigration/migration/{id}/run/{runID}", local_var_configuration.base_path, id=id, runID=run_id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn get_cloud_migration_run_list(configuration: &configuration::Configuration, id: i64) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/cloudmigration/migration/{id}/run", local_var_configuration.base_path, id=id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -pub async fn get_migration_list(configuration: &configuration::Configuration, ) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/cloudmigration/migration", local_var_configuration.base_path); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - -/// It returns migrations that has been created. -pub async fn run_cloud_migration(configuration: &configuration::Configuration, id: i64) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/cloudmigration/migration/{id}/run", local_var_configuration.base_path, id=id); - let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_apikey) = local_var_configuration.api_key { - let local_var_key = local_var_apikey.key.clone(); - let local_var_value = match local_var_apikey.prefix { - Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), - None => local_var_key, - }; - local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); - }; - if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { - local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; - Err(Error::ResponseError(local_var_error)) - } -} - diff --git a/openapi/src/apis/mod.rs b/openapi/src/apis/mod.rs index 4ca60ac1..55e5a9ed 100755 --- a/openapi/src/apis/mod.rs +++ b/openapi/src/apis/mod.rs @@ -113,7 +113,6 @@ pub mod get_current_org_api; pub mod ldap_debug_api; pub mod library_elements_api; pub mod licensing_api; -pub mod migrations_api; pub mod org_api; pub mod org_invites_api; pub mod org_preferences_api; diff --git a/openapi/src/models/alert_query_export.rs b/openapi/src/models/alert_query_export.rs index 52b277e9..a03a0804 100755 --- a/openapi/src/models/alert_query_export.rs +++ b/openapi/src/models/alert_query_export.rs @@ -15,7 +15,7 @@ pub struct AlertQueryExport { #[serde(rename = "datasourceUid", skip_serializing_if = "Option::is_none")] pub datasource_uid: Option, #[serde(rename = "model", skip_serializing_if = "Option::is_none")] - pub model: Option>, + pub model: Option, #[serde(rename = "queryType", skip_serializing_if = "Option::is_none")] pub query_type: Option, #[serde(rename = "refId", skip_serializing_if = "Option::is_none")] diff --git a/openapi/src/models/certificate.rs b/openapi/src/models/certificate.rs index 5ad0cbdd..9412f3ab 100755 --- a/openapi/src/models/certificate.rs +++ b/openapi/src/models/certificate.rs @@ -74,10 +74,6 @@ pub struct Certificate { pub permitted_ip_ranges: Option>, #[serde(rename = "PermittedURIDomains", skip_serializing_if = "Option::is_none")] pub permitted_uri_domains: Option>, - /// Policies contains all policy identifiers included in the certificate. In Go 1.22, encoding/gob cannot handle and ignores this field. - #[serde(rename = "Policies", skip_serializing_if = "Option::is_none")] - pub policies: Option>, - /// PolicyIdentifiers contains asn1.ObjectIdentifiers, the components of which are limited to int32. If a certificate contains a policy which cannot be represented by asn1.ObjectIdentifier, it will not be included in PolicyIdentifiers, but will be present in Policies, which contains all parsed policy OIDs. #[serde(rename = "PolicyIdentifiers", skip_serializing_if = "Option::is_none")] pub policy_identifiers: Option>>, #[serde(rename = "PublicKey", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] @@ -144,7 +140,6 @@ impl Certificate { permitted_email_addresses: None, permitted_ip_ranges: None, permitted_uri_domains: None, - policies: None, policy_identifiers: None, public_key: None, public_key_algorithm: None, diff --git a/openapi/src/models/cloud_migration_list_response.rs b/openapi/src/models/cloud_migration_list_response.rs deleted file mode 100755 index 853e2868..00000000 --- a/openapi/src/models/cloud_migration_list_response.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Grafana HTTP API. - * - * The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, creating users and updating data sources. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: hello@grafana.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CloudMigrationListResponse { - #[serde(rename = "migrations", skip_serializing_if = "Option::is_none")] - pub migrations: Option>, -} - -impl CloudMigrationListResponse { - pub fn new() -> CloudMigrationListResponse { - CloudMigrationListResponse { - migrations: None, - } - } -} - diff --git a/openapi/src/models/cloud_migration_request.rs b/openapi/src/models/cloud_migration_request.rs deleted file mode 100755 index 9a08210b..00000000 --- a/openapi/src/models/cloud_migration_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Grafana HTTP API. - * - * The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, creating users and updating data sources. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: hello@grafana.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CloudMigrationRequest { - #[serde(rename = "authToken", skip_serializing_if = "Option::is_none")] - pub auth_token: Option, -} - -impl CloudMigrationRequest { - pub fn new() -> CloudMigrationRequest { - CloudMigrationRequest { - auth_token: None, - } - } -} - diff --git a/openapi/src/models/cloud_migration_response.rs b/openapi/src/models/cloud_migration_response.rs deleted file mode 100755 index 09c4bb89..00000000 --- a/openapi/src/models/cloud_migration_response.rs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Grafana HTTP API. - * - * The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, creating users and updating data sources. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: hello@grafana.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CloudMigrationResponse { - #[serde(rename = "created", skip_serializing_if = "Option::is_none")] - pub created: Option, - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "stack", skip_serializing_if = "Option::is_none")] - pub stack: Option, - #[serde(rename = "updated", skip_serializing_if = "Option::is_none")] - pub updated: Option, -} - -impl CloudMigrationResponse { - pub fn new() -> CloudMigrationResponse { - CloudMigrationResponse { - created: None, - id: None, - stack: None, - updated: None, - } - } -} - diff --git a/openapi/src/models/cloud_migration_run_list.rs b/openapi/src/models/cloud_migration_run_list.rs deleted file mode 100755 index 8cdc98a1..00000000 --- a/openapi/src/models/cloud_migration_run_list.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Grafana HTTP API. - * - * The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, creating users and updating data sources. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: hello@grafana.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CloudMigrationRunList { - #[serde(rename = "runs", skip_serializing_if = "Option::is_none")] - pub runs: Option>, -} - -impl CloudMigrationRunList { - pub fn new() -> CloudMigrationRunList { - CloudMigrationRunList { - runs: None, - } - } -} - diff --git a/openapi/src/models/cookie_preferences.rs b/openapi/src/models/cookie_preferences.rs index 3c88f040..e21abba2 100755 --- a/openapi/src/models/cookie_preferences.rs +++ b/openapi/src/models/cookie_preferences.rs @@ -13,11 +13,11 @@ use crate::models; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CookiePreferences { #[serde(rename = "analytics", skip_serializing_if = "Option::is_none")] - pub analytics: Option>, + pub analytics: Option, #[serde(rename = "functional", skip_serializing_if = "Option::is_none")] - pub functional: Option>, + pub functional: Option, #[serde(rename = "performance", skip_serializing_if = "Option::is_none")] - pub performance: Option>, + pub performance: Option, } impl CookiePreferences { diff --git a/openapi/src/models/correlation_config.rs b/openapi/src/models/correlation_config.rs index 2b157546..9843a5a4 100755 --- a/openapi/src/models/correlation_config.rs +++ b/openapi/src/models/correlation_config.rs @@ -17,7 +17,7 @@ pub struct CorrelationConfig { pub field: String, /// Target data query #[serde(rename = "target")] - pub target: std::collections::HashMap, + pub target: serde_json::Value, #[serde(rename = "transformations", skip_serializing_if = "Option::is_none")] pub transformations: Option>, #[serde(rename = "type")] @@ -25,7 +25,7 @@ pub struct CorrelationConfig { } impl CorrelationConfig { - pub fn new(field: String, target: std::collections::HashMap, r#type: String) -> CorrelationConfig { + pub fn new(field: String, target: serde_json::Value, r#type: String) -> CorrelationConfig { CorrelationConfig { field, target, diff --git a/openapi/src/models/correlation_config_update_dto.rs b/openapi/src/models/correlation_config_update_dto.rs index 1572e282..913e7d3d 100755 --- a/openapi/src/models/correlation_config_update_dto.rs +++ b/openapi/src/models/correlation_config_update_dto.rs @@ -17,7 +17,7 @@ pub struct CorrelationConfigUpdateDto { pub field: Option, /// Target data query #[serde(rename = "target", skip_serializing_if = "Option::is_none")] - pub target: Option>, + pub target: Option, /// Source data transformations #[serde(rename = "transformations", skip_serializing_if = "Option::is_none")] pub transformations: Option>, diff --git a/openapi/src/models/create_access_token_response_dto.rs b/openapi/src/models/create_access_token_response_dto.rs deleted file mode 100755 index aac90589..00000000 --- a/openapi/src/models/create_access_token_response_dto.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Grafana HTTP API. - * - * The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, creating users and updating data sources. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: hello@grafana.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateAccessTokenResponseDto { - #[serde(rename = "token", skip_serializing_if = "Option::is_none")] - pub token: Option, -} - -impl CreateAccessTokenResponseDto { - pub fn new() -> CreateAccessTokenResponseDto { - CreateAccessTokenResponseDto { - token: None, - } - } -} - diff --git a/openapi/src/models/delete_folder_200_response.rs b/openapi/src/models/delete_folder_200_response.rs index c0bd3c85..29242300 100755 --- a/openapi/src/models/delete_folder_200_response.rs +++ b/openapi/src/models/delete_folder_200_response.rs @@ -10,32 +10,26 @@ use crate::models; -// Response has been modified - errors in the original OpenAPI spec #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct DeleteFolder200Response { + /// ID Identifier of the deleted folder. + #[serde(rename = "id")] + pub id: i64, /// Message Message of the deleted folder. #[serde(rename = "message")] pub message: String, + /// Title of the deleted folder. + #[serde(rename = "title")] + pub title: String, } -// pub struct DeleteFolder200Response { -// /// ID Identifier of the deleted folder. -// #[serde(rename = "id")] -// pub id: i64, -// /// Message Message of the deleted folder. -// #[serde(rename = "message")] -// pub message: String, -// /// Title of the deleted folder. -// #[serde(rename = "title")] -// pub title: String, -// } - impl DeleteFolder200Response { - pub fn new(message: String) -> DeleteFolder200Response { + pub fn new(id: i64, message: String, title: String) -> DeleteFolder200Response { DeleteFolder200Response { - // id, + id, message, - // title, + title, } } } + diff --git a/openapi/src/models/field_config.rs b/openapi/src/models/field_config.rs index 27194ea5..4cb93594 100755 --- a/openapi/src/models/field_config.rs +++ b/openapi/src/models/field_config.rs @@ -14,10 +14,10 @@ use crate::models; pub struct FieldConfig { /// Map values to a display color NOTE: this interface is under development in the frontend... so simple map for now #[serde(rename = "color", skip_serializing_if = "Option::is_none")] - pub color: Option>, + pub color: Option, /// Panel Specific Values #[serde(rename = "custom", skip_serializing_if = "Option::is_none")] - pub custom: Option>, + pub custom: Option, #[serde(rename = "decimals", skip_serializing_if = "Option::is_none")] pub decimals: Option, /// Description is human readable field metadata diff --git a/openapi/src/models/ip_net.rs b/openapi/src/models/ip_net.rs index 358b21db..b49da88b 100755 --- a/openapi/src/models/ip_net.rs +++ b/openapi/src/models/ip_net.rs @@ -14,7 +14,7 @@ use crate::models; pub struct IpNet { #[serde(rename = "IP", skip_serializing_if = "Option::is_none")] pub ip: Option, - /// See type [IPNet] and func [ParseCIDR] for details. + /// See type IPNet and func ParseCIDR for details. #[serde(rename = "Mask", skip_serializing_if = "Option::is_none")] pub mask: Option>, } diff --git a/openapi/src/models/list_all_providers_settings_200_response_inner.rs b/openapi/src/models/list_all_providers_settings_200_response_inner.rs index f73990dc..5daf9422 100755 --- a/openapi/src/models/list_all_providers_settings_200_response_inner.rs +++ b/openapi/src/models/list_all_providers_settings_200_response_inner.rs @@ -17,7 +17,7 @@ pub struct ListAllProvidersSettings200ResponseInner { #[serde(rename = "provider", skip_serializing_if = "Option::is_none")] pub provider: Option, #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] - pub settings: Option>, + pub settings: Option, #[serde(rename = "source", skip_serializing_if = "Option::is_none")] pub source: Option, } diff --git a/openapi/src/models/migrate_data_response_dto.rs b/openapi/src/models/migrate_data_response_dto.rs deleted file mode 100755 index db15d097..00000000 --- a/openapi/src/models/migrate_data_response_dto.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Grafana HTTP API. - * - * The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, creating users and updating data sources. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: hello@grafana.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MigrateDataResponseDto { - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "items", skip_serializing_if = "Option::is_none")] - pub items: Option>, -} - -impl MigrateDataResponseDto { - pub fn new() -> MigrateDataResponseDto { - MigrateDataResponseDto { - id: None, - items: None, - } - } -} - diff --git a/openapi/src/models/migrate_data_response_item_dto.rs b/openapi/src/models/migrate_data_response_item_dto.rs deleted file mode 100755 index 80678301..00000000 --- a/openapi/src/models/migrate_data_response_item_dto.rs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Grafana HTTP API. - * - * The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, creating users and updating data sources. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: hello@grafana.com - * Generated by: https://openapi-generator.tech - */ - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MigrateDataResponseItemDto { - #[serde(rename = "error", skip_serializing_if = "Option::is_none")] - pub error: Option, - #[serde(rename = "refId")] - pub ref_id: String, - #[serde(rename = "status")] - pub status: Status, - #[serde(rename = "type")] - pub r#type: Type, -} - -impl MigrateDataResponseItemDto { - pub fn new(ref_id: String, status: Status, r#type: Type) -> MigrateDataResponseItemDto { - MigrateDataResponseItemDto { - error: None, - ref_id, - status, - r#type, - } - } -} -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Status { - #[serde(rename = "OK")] - Ok, - #[serde(rename = "ERROR")] - Error, -} - -impl Default for Status { - fn default() -> Status { - Self::Ok - } -} -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Type { - #[serde(rename = "DASHBOARD")] - Dashboard, - #[serde(rename = "DATASOURCE")] - Datasource, - #[serde(rename = "FOLDER")] - Folder, -} - -impl Default for Type { - fn default() -> Type { - Self::Dashboard - } -} - diff --git a/openapi/src/models/mod.rs b/openapi/src/models/mod.rs index e34e8801..1163e976 100755 --- a/openapi/src/models/mod.rs +++ b/openapi/src/models/mod.rs @@ -112,14 +112,6 @@ pub mod change_user_password_command; pub use self::change_user_password_command::ChangeUserPasswordCommand; pub mod clear_help_flags_200_response; pub use self::clear_help_flags_200_response::ClearHelpFlags200Response; -pub mod cloud_migration_list_response; -pub use self::cloud_migration_list_response::CloudMigrationListResponse; -pub mod cloud_migration_request; -pub use self::cloud_migration_request::CloudMigrationRequest; -pub mod cloud_migration_response; -pub use self::cloud_migration_response::CloudMigrationResponse; -pub mod cloud_migration_run_list; -pub use self::cloud_migration_run_list::CloudMigrationRunList; pub mod cluster_status; pub use self::cluster_status::ClusterStatus; pub mod config; @@ -134,8 +126,6 @@ pub mod correlation_config; pub use self::correlation_config::CorrelationConfig; pub mod correlation_config_update_dto; pub use self::correlation_config_update_dto::CorrelationConfigUpdateDto; -pub mod create_access_token_response_dto; -pub use self::create_access_token_response_dto::CreateAccessTokenResponseDto; pub mod create_correlation_command; pub use self::create_correlation_command::CreateCorrelationCommand; pub mod create_correlation_response_body; @@ -352,10 +342,6 @@ pub mod matcher; pub use self::matcher::Matcher; pub mod metric_request; pub use self::metric_request::MetricRequest; -pub mod migrate_data_response_dto; -pub use self::migrate_data_response_dto::MigrateDataResponseDto; -pub mod migrate_data_response_item_dto; -pub use self::migrate_data_response_item_dto::MigrateDataResponseItemDto; pub mod move_folder_command; pub use self::move_folder_command::MoveFolderCommand; pub mod ms_teams_config; diff --git a/openapi/src/models/name.rs b/openapi/src/models/name.rs index 734bc167..daab3d20 100755 --- a/openapi/src/models/name.rs +++ b/openapi/src/models/name.rs @@ -10,7 +10,7 @@ use crate::models; -/// Name : Name represents an X.509 distinguished name. This only includes the common elements of a DN. Note that Name is only an approximation of the X.509 structure. If an accurate representation is needed, asn1.Unmarshal the raw subject or issuer as an [RDNSequence]. +/// Name : Name represents an X.509 distinguished name. This only includes the common elements of a DN. Note that Name is only an approximation of the X.509 structure. If an accurate representation is needed, asn1.Unmarshal the raw subject or issuer as an RDNSequence. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Name { #[serde(rename = "Country", skip_serializing_if = "Option::is_none")] @@ -30,7 +30,7 @@ pub struct Name { } impl Name { - /// Name represents an X.509 distinguished name. This only includes the common elements of a DN. Note that Name is only an approximation of the X.509 structure. If an accurate representation is needed, asn1.Unmarshal the raw subject or issuer as an [RDNSequence]. + /// Name represents an X.509 distinguished name. This only includes the common elements of a DN. Note that Name is only an approximation of the X.509 structure. If an accurate representation is needed, asn1.Unmarshal the raw subject or issuer as an RDNSequence. pub fn new() -> Name { Name { country: None, diff --git a/openapi/src/models/public_error.rs b/openapi/src/models/public_error.rs index 16a7257c..deda112d 100755 --- a/openapi/src/models/public_error.rs +++ b/openapi/src/models/public_error.rs @@ -15,7 +15,7 @@ use crate::models; pub struct PublicError { /// Extra Additional information about the error #[serde(rename = "extra", skip_serializing_if = "Option::is_none")] - pub extra: Option>, + pub extra: Option, /// Message A human readable message #[serde(rename = "message", skip_serializing_if = "Option::is_none")] pub message: Option, diff --git a/openapi/src/models/query_stat.rs b/openapi/src/models/query_stat.rs index 2d549cac..1720bfeb 100755 --- a/openapi/src/models/query_stat.rs +++ b/openapi/src/models/query_stat.rs @@ -15,10 +15,10 @@ use crate::models; pub struct QueryStat { /// Map values to a display color NOTE: this interface is under development in the frontend... so simple map for now #[serde(rename = "color", skip_serializing_if = "Option::is_none")] - pub color: Option>, + pub color: Option, /// Panel Specific Values #[serde(rename = "custom", skip_serializing_if = "Option::is_none")] - pub custom: Option>, + pub custom: Option, #[serde(rename = "decimals", skip_serializing_if = "Option::is_none")] pub decimals: Option, /// Description is human readable field metadata diff --git a/openapi/src/models/recording_rule_json.rs b/openapi/src/models/recording_rule_json.rs index 593eb6d7..3d9eeb17 100755 --- a/openapi/src/models/recording_rule_json.rs +++ b/openapi/src/models/recording_rule_json.rs @@ -30,7 +30,7 @@ pub struct RecordingRuleJson { #[serde(rename = "prom_name", skip_serializing_if = "Option::is_none")] pub prom_name: Option, #[serde(rename = "queries", skip_serializing_if = "Option::is_none")] - pub queries: Option>>, + pub queries: Option>, #[serde(rename = "range", skip_serializing_if = "Option::is_none")] pub range: Option, #[serde(rename = "target_ref_id", skip_serializing_if = "Option::is_none")] diff --git a/openapi/src/models/unstructured.rs b/openapi/src/models/unstructured.rs index 5f655bc9..8aba0d3d 100755 --- a/openapi/src/models/unstructured.rs +++ b/openapi/src/models/unstructured.rs @@ -15,7 +15,7 @@ use crate::models; pub struct Unstructured { /// Object is a JSON compatible map with string, float, int, bool, []interface{}, or map[string]interface{} children. #[serde(rename = "Object", skip_serializing_if = "Option::is_none")] - pub object: Option>, + pub object: Option, } impl Unstructured { diff --git a/openapi/src/models/update_provider_settings_request.rs b/openapi/src/models/update_provider_settings_request.rs index 4ad59f1f..91ffc2b6 100755 --- a/openapi/src/models/update_provider_settings_request.rs +++ b/openapi/src/models/update_provider_settings_request.rs @@ -17,7 +17,7 @@ pub struct UpdateProviderSettingsRequest { #[serde(rename = "provider", skip_serializing_if = "Option::is_none")] pub provider: Option, #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] - pub settings: Option>, + pub settings: Option, } impl UpdateProviderSettingsRequest { diff --git a/openapi/src/models/url.rs b/openapi/src/models/url.rs index f8879d6f..2ad8af25 100755 --- a/openapi/src/models/url.rs +++ b/openapi/src/models/url.rs @@ -10,7 +10,7 @@ use crate::models; -/// Url : The general form represented is: [scheme:][//[userinfo@]host][/]path[?query][#fragment] URLs that do not start with a slash after the scheme are interpreted as: scheme:opaque[?query][#fragment] The Host field contains the host and port subcomponents of the URL. When the port is present, it is separated from the host with a colon. When the host is an IPv6 address, it must be enclosed in square brackets: \"[fe80::1]:80\". The [net.JoinHostPort] function combines a host and port into a string suitable for the Host field, adding square brackets to the host when necessary. Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. A consequence is that it is impossible to tell which slashes in the Path were slashes in the raw URL and which were %2f. This distinction is rarely important, but when it is, the code should use the [URL.EscapedPath] method, which preserves the original encoding of Path. The RawPath field is an optional field which is only set when the default encoding of Path is different from the escaped path. See the EscapedPath method for more details. URL's String method uses the EscapedPath method to obtain the path. +/// Url : The general form represented is: [scheme:][//[userinfo@]host][/]path[?query][#fragment] URLs that do not start with a slash after the scheme are interpreted as: scheme:opaque[?query][#fragment] Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. A consequence is that it is impossible to tell which slashes in the Path were slashes in the raw URL and which were %2f. This distinction is rarely important, but when it is, the code should use the EscapedPath method, which preserves the original encoding of Path. The RawPath field is an optional field which is only set when the default encoding of Path is different from the escaped path. See the EscapedPath method for more details. URL's String method uses the EscapedPath method to obtain the path. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Url { #[serde(rename = "ForceQuery", skip_serializing_if = "Option::is_none")] @@ -33,13 +33,13 @@ pub struct Url { pub raw_query: Option, #[serde(rename = "Scheme", skip_serializing_if = "Option::is_none")] pub scheme: Option, - /// The Userinfo type is an immutable encapsulation of username and password details for a [URL]. An existing Userinfo value is guaranteed to have a username set (potentially empty, as allowed by RFC 2396), and optionally a password. + /// The Userinfo type is an immutable encapsulation of username and password details for a URL. An existing Userinfo value is guaranteed to have a username set (potentially empty, as allowed by RFC 2396), and optionally a password. #[serde(rename = "User", skip_serializing_if = "Option::is_none")] pub user: Option, } impl Url { - /// The general form represented is: [scheme:][//[userinfo@]host][/]path[?query][#fragment] URLs that do not start with a slash after the scheme are interpreted as: scheme:opaque[?query][#fragment] The Host field contains the host and port subcomponents of the URL. When the port is present, it is separated from the host with a colon. When the host is an IPv6 address, it must be enclosed in square brackets: \"[fe80::1]:80\". The [net.JoinHostPort] function combines a host and port into a string suitable for the Host field, adding square brackets to the host when necessary. Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. A consequence is that it is impossible to tell which slashes in the Path were slashes in the raw URL and which were %2f. This distinction is rarely important, but when it is, the code should use the [URL.EscapedPath] method, which preserves the original encoding of Path. The RawPath field is an optional field which is only set when the default encoding of Path is different from the escaped path. See the EscapedPath method for more details. URL's String method uses the EscapedPath method to obtain the path. + /// The general form represented is: [scheme:][//[userinfo@]host][/]path[?query][#fragment] URLs that do not start with a slash after the scheme are interpreted as: scheme:opaque[?query][#fragment] Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. A consequence is that it is impossible to tell which slashes in the Path were slashes in the raw URL and which were %2f. This distinction is rarely important, but when it is, the code should use the EscapedPath method, which preserves the original encoding of Path. The RawPath field is an optional field which is only set when the default encoding of Path is different from the escaped path. See the EscapedPath method for more details. URL's String method uses the EscapedPath method to obtain the path. pub fn new() -> Url { Url { force_query: None,