|
| 1 | +import "@azure-tools/typespec-azure-core"; |
| 2 | +import "@azure-tools/typespec-azure-resource-manager"; |
| 3 | +import "@azure-tools/typespec-client-generator-core"; |
| 4 | +import "@typespec/openapi"; |
| 5 | +import "@typespec/rest"; |
| 6 | +import "./models.tsp"; |
| 7 | + |
| 8 | +using Azure.ClientGenerator.Core; |
| 9 | +using Azure.ResourceManager; |
| 10 | +using TypeSpec.Http; |
| 11 | +using TypeSpec.OpenAPI; |
| 12 | +using TypeSpec.Rest; |
| 13 | + |
| 14 | +namespace Microsoft.Portal; |
| 15 | +/** |
| 16 | + * The shared dashboard resource definition. |
| 17 | + */ |
| 18 | +@doc("The shared dashboard resource definition.") |
| 19 | +model Dashboard |
| 20 | + is Azure.ResourceManager.TrackedResource<DashboardPropertiesWithProvisioningState> { |
| 21 | + ...ResourceNameParameter<Resource = Dashboard>; |
| 22 | +} |
| 23 | + |
| 24 | +@armResourceOperations |
| 25 | +interface Dashboards { |
| 26 | + /** |
| 27 | + * Gets the Dashboard. |
| 28 | + */ |
| 29 | + get is ArmResourceRead<Dashboard>; |
| 30 | + |
| 31 | + /** |
| 32 | + * Creates or updates a Dashboard. |
| 33 | + */ |
| 34 | + createOrUpdate is ArmResourceCreateOrReplaceSync<Dashboard>; |
| 35 | + |
| 36 | + /** |
| 37 | + * Updates an existing Dashboard. |
| 38 | + */ |
| 39 | + @parameterVisibility |
| 40 | + update is ArmCustomPatchSync<Dashboard, PatchableDashboard>; |
| 41 | + |
| 42 | + /** |
| 43 | + * Deletes the Dashboard. |
| 44 | + */ |
| 45 | + delete is ArmResourceDeleteSync<Dashboard>; |
| 46 | + |
| 47 | + /** |
| 48 | + * Gets all the Dashboards within a resource group. |
| 49 | + */ |
| 50 | + listByResourceGroup is ArmResourceListByParent<Dashboard>; |
| 51 | + |
| 52 | + /** |
| 53 | + * Gets all the dashboards within a subscription. |
| 54 | + */ |
| 55 | + listBySubscription is ArmListBySubscription<Dashboard>; |
| 56 | +} |
| 57 | + |
| 58 | +@@maxLength(Dashboard.name, 64); |
| 59 | +@@minLength(Dashboard.name, 3); |
| 60 | +@@doc(Dashboard.name, "The name of the dashboard."); |
| 61 | +@@doc(Dashboards.createOrUpdate::parameters.resource, |
| 62 | + "The parameters required to create or update a dashboard." |
| 63 | +); |
| 64 | +@@doc(Dashboards.update::parameters.properties, |
| 65 | + "The updatable fields of a Dashboard." |
| 66 | +); |
| 67 | +@@encodedName(Dashboards.createOrUpdate::parameters.resource, |
| 68 | + "application/json", |
| 69 | + "dashboard" |
| 70 | +); |
| 71 | +@@encodedName(Dashboards.update::parameters.properties, |
| 72 | + "application/json", |
| 73 | + "dashboard" |
| 74 | +); |
0 commit comments