Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating ProvisioningState from enum to union #521

Merged
merged 12 commits into from
Apr 17, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: breaking
packages:
- "@azure-tools/typespec-azure-core"
- "@azure-tools/typespec-azure-resource-manager"
---

Switching ProvisioningState from enum to Open union
36 changes: 18 additions & 18 deletions docs/libraries/azure-resource-manager/reference/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -1106,51 +1106,51 @@ The type of identity to use.
enum Azure.ResourceManager.KeyEncryptionIdentity
```

### `Versions` {#Azure.ResourceManager.Versions}

Supported versions of Azure.ResourceManager building blocks.

```typespec
enum Azure.ResourceManager.Versions
```

### `PrivateEndpointConnectionProvisioningState` {#Azure.ResourceManager.PrivateEndpointConnectionProvisioningState}

The provisioning state of the connection

```typespec
enum Azure.ResourceManager.PrivateEndpointConnectionProvisioningState
union Azure.ResourceManager.PrivateEndpointConnectionProvisioningState
```

### `PrivateEndpointServiceConnectionStatus` {#Azure.ResourceManager.PrivateEndpointServiceConnectionStatus}

The private endpoint connection status

```typespec
enum Azure.ResourceManager.PrivateEndpointServiceConnectionStatus
union Azure.ResourceManager.PrivateEndpointServiceConnectionStatus
```

### `ResourceProvisioningState` {#Azure.ResourceManager.ResourceProvisioningState}

Standard terminal provisioning state of resource type. You can spread into your
Standard terminal provisioning state of resource type. You can include in your
custom provision state to avoid duplication and ensure consistency

```typespec
enum Azure.ResourceManager.ResourceProvisioningState
union Azure.ResourceManager.ResourceProvisioningState
```

#### Examples

```typespec
enum FooProvisioningState {
...ResourceProvisioningState, // include standard provisioning states
starting,
started,
stopping,
stopped,
union FooProvisioningState {
ResourceProvisioningState, // include standard provisioning states
starting: "starting",
started: "started",
stopping: "stopping",
stopped: "stopped",
}
```

### `Versions` {#Azure.ResourceManager.Versions}

Supported versions of Azure.ResourceManager building blocks.

```typespec
enum Azure.ResourceManager.Versions
```

### `ResourceIdentifier` {#Azure.ResourceManager.ResourceIdentifier}

A type definition that refers the id to an Azure Resource Manager resource.
Expand Down
23 changes: 13 additions & 10 deletions eng/feeds/arm/employee.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,23 @@ model EmployeeProperties {

/** The resource provisioning state. */
@lroStatus
enum ProvisioningState {
...ResourceProvisioningState,
union ProvisioningState {
ResourceProvisioningState,

/** The resource is being provisioned. */
Provisioning,
/** The resource is being provisioned */
Provisioning: "Provisioning",

/** The resource is being updated. */
Updating,
/** The resource is updating */
Updating: "Updating",

/** The resource is being deleted. */
Deleting,
/** The resource is being deleted */
Deleting: "Deleting",

/** The resource provisioning request has been accepted. */
Accepted,
/** The resource create request has been accepted */
Accepted: "Accepted",

/** modelAsString=true */
string,
}

interface Operations extends Azure.ResourceManager.Operations {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,23 @@ model RoleAssignmentProperties {

/** The provisioning state of a resource. */
@lroStatus
enum ProvisioningState {
...ResourceProvisioningState,
union ProvisioningState {
ResourceProvisioningState,

/** The resource is being provisioned */
Provisioning,
Provisioning: "Provisioning",

/** The resource is updating */
Updating,
Updating: "Updating",

/** The resource is being deleted */
Deleting,
Deleting: "Deleting",

/** The resource create request has been accepted */
Accepted,
Accepted: "Accepted",

/** modelAsString=true */
string,
}

interface Operations extends Azure.ResourceManager.Operations {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,23 @@ model EmployeeProperties {

/** The provisioning state of a resource. */
@lroStatus
enum ProvisioningState {
...ResourceProvisioningState,
union ProvisioningState {
ResourceProvisioningState,

/** The resource is being provisioned */
Provisioning,
Provisioning: "Provisioning",

/** The resource is updating */
Updating,
Updating: "Updating",

/** The resource is being deleted */
Deleting,
Deleting: "Deleting",

/** The resource create request has been accepted */
Accepted,
Accepted: "Accepted",

/** modelAsString=true */
string,
}

interface Operations extends Azure.ResourceManager.Operations {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,23 @@ model EmployeeProperties {

/** The provisioning state of a resource. */
@lroStatus
enum ProvisioningState {
...ResourceProvisioningState,
union ProvisioningState {
ResourceProvisioningState,

/** The resource is being provisioned */
Provisioning,
Provisioning: "Provisioning",

/** The resource is updating */
Updating,
Updating: "Updating",

/** The resource is being deleted */
Deleting,
Deleting: "Deleting",

/** The resource create request has been accepted */
Accepted,
Accepted: "Accepted",

/** modelAsString=true */
allenjzhang marked this conversation as resolved.
Show resolved Hide resolved
string,
}

interface Operations extends Azure.ResourceManager.Operations {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,23 @@ model EmployeeProperties {

/** The provisioning state of a resource. */
@lroStatus
enum ProvisioningState {
...ResourceProvisioningState,
union ProvisioningState {
ResourceProvisioningState,

/** The resource is being provisioned */
Provisioning,
Provisioning: "Provisioning",

/** The resource is updating */
Updating,
Updating: "Updating",

/** The resource is being deleted */
Deleting,
Deleting: "Deleting",

/** The resource create request has been accepted */
Accepted,
Accepted: "Accepted",

/** modelAsString=true */
string,
}

interface Operations extends Azure.ResourceManager.Operations {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,23 @@ model EmployeeProperties {

/** The provisioning state of a resource. */
@lroStatus
enum ProvisioningState {
...ResourceProvisioningState,
union ProvisioningState {
ResourceProvisioningState,

/** The resource is being provisioned */
Provisioning,
Provisioning: "Provisioning",

/** The resource is updating */
Updating,
Updating: "Updating",

/** The resource is being deleted */
Deleting,
Deleting: "Deleting",

/** The resource create request has been accepted */
Accepted,
Accepted: "Accepted",

/** modelAsString=true */
string,
}

interface Operations extends Azure.ResourceManager.Operations {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,23 @@ model EmployeeProperties {

/** The provisioning state of a resource. */
@lroStatus
enum ProvisioningState {
...ResourceProvisioningState,
union ProvisioningState {
ResourceProvisioningState,

/** The resource is being provisioned */
Provisioning,
Provisioning: "Provisioning",

/** The resource is updating */
Updating,
Updating: "Updating",

/** The resource is being deleted */
Deleting,
Deleting: "Deleting",

/** The resource create request has been accepted */
Accepted,
Accepted: "Accepted",

/** modelAsString=true */
string,
}

interface Operations extends Azure.ResourceManager.Operations {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,23 @@ model EmployeeProperties {

/** The provisioning state of a resource. */
@lroStatus
enum ProvisioningState {
...ResourceProvisioningState,
union ProvisioningState {
ResourceProvisioningState,

/** The resource is being provisioned */
Provisioning,
Provisioning: "Provisioning",

/** The resource is updating */
Updating,
Updating: "Updating",

/** The resource is being deleted */
Deleting,
Deleting: "Deleting",

/** The resource create request has been accepted */
Accepted,
Accepted: "Accepted",

/** modelAsString=true */
string,
}

interface Operations extends Azure.ResourceManager.Operations {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,23 @@ model EmployeeProperties {

/** The provisioning state of a resource. */
@lroStatus
enum ProvisioningState {
...ResourceProvisioningState,
union ProvisioningState {
ResourceProvisioningState,

/** The resource is being provisioned */
Provisioning,
Provisioning: "Provisioning",

/** The resource is updating */
Updating,
Updating: "Updating",

/** The resource is being deleted */
Deleting,
Deleting: "Deleting",

/** The resource create request has been accepted */
Accepted,
Accepted: "Accepted",

/** modelAsString=true */
string,
}

interface Operations extends Azure.ResourceManager.Operations {}
Expand Down
Loading
Loading