Skip to content

Commit

Permalink
[AppConfig] Migrate App Configuration swagger to TypeSpec (#28634)
Browse files Browse the repository at this point in the history
* initial commit + cleanup

* add docs + cleanup linter warnings

* add auth + update swagger

* convert models to resources

* update routes with standard ops + more accuracy

* regenerate openapi

* add examples

* flavor: azure

* tsp format

* add spec examples

* fix accept header + spec consistency

* fix nextLink + headers

* use encodedName

* fix accept header

* fix enums

* format

* move accept header

* remove comment

* format

* spelling

* test examples

* fix examples

* wip

* content type header

* fix delete content type + getlabels op

* clean up

* update suppression

* add consumes

* fix error

* rename alias

* alias sync token header

* tsp compile

* fix errors

* improvements

* more improvements

* fix datetimes

* client generation fixes

* more clean up

* add scope + request id headers

* add service op template

* improve template

* client request id header

* property type fix

* tsp compile

* client.tsp

* tsp update

---------

Co-authored-by: Catalina Peralta <[email protected]>
  • Loading branch information
catalinaperalta and cperaltah authored May 14, 2024
1 parent da326fe commit 3531504
Show file tree
Hide file tree
Showing 84 changed files with 4,955 additions and 1,140 deletions.
9 changes: 9 additions & 0 deletions specification/appconfiguration/AppConfiguration/client.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import "./main.tsp";
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
using AzureAppConfiguration;

namespace SdkCustomizations;

@@clientName(Error, "AppConfigError", "python");
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"operationId": "CheckKeyValue",
"title": "Requests the headers and status of the given resource.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01",
"key": "Message"
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.kv+json",
"ETag": "W/\"7XpB48ET4VAlB9068ft6fKMyA3m\"",
"Last-Modified": "Tue, 27 Aug 2019 16:52:32 GMT",
"Sync-Token": "zAJw6V16=NjotMSM3ODk3NjM=;sn=789763"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"operationId": "CheckKeyValue",
"title": "Requests the headers and status of the given resource using the If-Match header.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01",
"key": "Message",
"If-Match": "\"L10qpBghN693OaxydgTkLmrBbV5\""
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.kv+json",
"ETag": "W/\"L10qpBghN693OaxydgTkLmrBbV5\"",
"Last-Modified": "Tue, 27 Aug 2019 16:52:32 GMT",
"Sync-Token": "zAJw6V16=NjotMSM3ODk3NjM=;sn=789763"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"operationId": "CheckKeyValue",
"title": "Requests the headers and status of the given resource using the If-None-Match header.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01",
"key": "Message",
"If-None-Match": "L10qpBghN693OaxydgTkLmrBbV5"
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.kv+json",
"ETag": "W/\"7XpB48ET4VAlB9068ft6fKMyA3m\"",
"Last-Modified": "Tue, 27 Aug 2019 16:52:32 GMT",
"Sync-Token": "zAJw6V16=NjotMSM3ODk3NjM=;sn=789763"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"operationId": "CheckKeyValues",
"title": "Requests the headers and status of the given resource.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01"
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.kvset+json"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"operationId": "CheckKeyValues",
"title": "Requests the headers and status of the given resource using the If-Match header.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01",
"If-Match": "\"L10qpBghN693OaxydgTkLmrBbV5\""
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.kvset+json",
"ETag": "W/\"L10qpBghN693OaxydgTkLmrBbV5\""
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"operationId": "CheckKeyValues",
"title": "Requests the headers and status of the given resource using the If-None-Match header.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01",
"If-None-Match": "\"L10qpBghN693OaxydgTkLmrBbV5\""
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.kvset+json",
"ETag": "W/\"7XpB48ET4VAlB9068ft6fKMyA3m\""
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"operationId": "CheckKeys",
"title": "Check keys",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01"
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.keyset+json"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"operationId": "CheckLabels",
"title": "Requests the headers and status of the given resource.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01"
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.labelset+json"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"operationId": "CheckRevisions",
"title": "Requests the headers and status of the given resource.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01"
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.kvset+json"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"operationId": "CheckSnapshot",
"title": "Requests the headers and status of the given resource.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01",
"name": "Prod-2022-08-01"
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.snapshot+json",
"ETag": "W/\"4f6dd610dd5e4deebc7fbaef685fb903\"",
"Last-Modified": "Tue, 01 Aug 2022 16:52:32 GMT",
"Sync-Token": "zAJw6V16=NjotMSM3ODk3NjM=;sn=789763",
"Link": "</kv?snapshot=Prod-2022-08-01?api-version={api-ver}>; rel=\"items\""
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"operationId": "CheckSnapshot",
"title": "Requests the headers and status of the given resource using If-Match header.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01",
"name": "Prod-2022-08-01",
"If-Match": "\"4f6dd610dd5e4deebc7fbaef685fb903\""
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.snapshot+json",
"ETag": "W/\"4f6dd610dd5e4deebc7fbaef685fb903\"",
"Last-Modified": "Tue, 01 Aug 2022 16:52:32 GMT",
"Sync-Token": "zAJw6V16=NjotMSM3ODk3NjM=;sn=789763",
"Link": "</kv?snapshot=Prod-2022-08-01?api-version={api-ver}>; rel=\"items\""
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"operationId": "CheckSnapshot",
"title": "Requests the headers and status of the given resource using If-None-Match header",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01",
"name": "Prod-2022-08-01",
"If-None-Match": "\"L10qpBghN693OaxydgTkLmrBbV5\""
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.snapshot+json",
"ETag": "W/\"4f6dd610dd5e4deebc7fbaef685fb903\"",
"Last-Modified": "Tue, 01 Aug 2022 16:52:32 GMT",
"Sync-Token": "zAJw6V16=NjotMSM3ODk3NjM=;sn=789763",
"Link": "</kv?snapshot=Prod-2022-08-01?api-version={api-ver}>; rel=\"items\""
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"operationId": "CheckSnapshots",
"title": "Requests the headers and status of the given resource.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01"
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.snapshotset+json"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"operationId": "CreateSnapshot",
"title": "Creates a key-value snapshot.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01",
"name": "Prod-2022-08-01",
"entity": {
"filters": [
{
"key": "app1/*",
"label": "Production"
}
],
"retention_period": 3600
}
},
"responses": {
"201": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.snapshot+json",
"ETag": "W/\"4f6dd610dd5e4deebc7fbaef685fb903\"",
"Last-Modified": "Tue, 01 Aug 2022 16:52:32 GMT",
"Sync-Token": "zAJw6V16=NjotMSM3ODk3NjM=;sn=789763",
"Operation-Location": "https://{exampleAppConfigurationName}.azconfig.io/operations?snapshot=Prod-2022-08-01&Api-Version=2023-11-01"
},
"body": {
"etag": "4f6dd610dd5e4deebc7fbaef685fb903",
"name": "Prod-2022-08-01",
"status": "provisioning",
"filters": [
{
"key": "app1/*",
"label": "Production"
}
],
"composition_type": "all",
"created": "2022-08-01T22:19:40+00:00",
"size": 0,
"items_count": 0,
"retention_period": 3600,
"tags": {}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"operationId": "DeleteKeyValue",
"title": "Deletes a key-value.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01",
"key": "Message"
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.kv+json",
"ETag": "W/\"7XpB48ET4VAlB9068ft6fKMyA3m\"",
"Last-Modified": "Tue, 27 Aug 2019 16:52:32 GMT",
"Sync-Token": "zAJw6V16=NjotMSM3ODk3NjM=;sn=789763"
},
"body": {
"etag": "7XpB48ET4VAlB9068ft6fKMyA3m",
"key": "Message",
"label": null,
"content_type": null,
"value": "Hello World!",
"tags": {},
"locked": false,
"last_modified": "2019-08-27T16:52:32+00:00"
}
},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"operationId": "DeleteKeyValue",
"title": "Deletes a key-value using If-Match header",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01",
"key": "Message",
"If-Match": "\"L10qpBghN693OaxydgTkLmrBbV5\""
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.kv+json",
"ETag": "W/\"L10qpBghN693OaxydgTkLmrBbV5\"",
"Last-Modified": "Tue, 27 Aug 2019 16:52:32 GMT",
"Sync-Token": "zAJw6V16=NjotMSM3ODk3NjM=;sn=789763"
},
"body": {
"etag": "L10qpBghN693OaxydgTkLmrBbV5",
"key": "Message",
"label": null,
"content_type": null,
"value": "Hello World!",
"tags": {},
"locked": false,
"last_modified": "2019-08-27T16:52:32+00:00"
}
},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"operationId": "DeleteLock",
"title": "Unlocks a key-value.",
"parameters": {
"endpoint": "https://{exampleAppConfigurationName}.azconfig.io",
"api-version": "2023-11-01",
"key": "Message"
},
"responses": {
"200": {
"headers": {
"Content-Type": "application/vnd.microsoft.appconfig.kv+json",
"ETag": "W/\"0BGYCoQ6iNdp5NtQ7N8shrobo6s\"",
"Last-Modified": "Tue, 27 Aug 2019 16:52:32 GMT",
"Sync-Token": "zAJw6V16=NjotMSM3ODk3NjM=;sn=789763"
},
"body": {
"etag": "0BGYCoQ6iNdp5NtQ7N8shrobo6s",
"key": "Message",
"label": null,
"content_type": null,
"value": "Hello World!",
"tags": {},
"locked": false,
"last_modified": "2019-08-27T16:52:32+00:00"
}
}
}
}
Loading

0 comments on commit 3531504

Please sign in to comment.