@azure-tools/typespec-azure-resource-manager 0.71.0-dev.11 → 0.71.0-dev.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,7 +56,8 @@ internal model AgentDefinition {
56
56
  /**
57
57
  * Appliance deployment model of AgentDefinition.
58
58
  * Properties controlled by `@baseTypeOptional` are invisible when the corresponding
59
- * template parameter is false, or read-only when present.
59
+ * template parameter is false. When present, `instructions` is read-only while
60
+ * `modelDeploymentRef` stays writable so the client can point the agent at a model deployment.
60
61
  * @template HasModelDeploymentRef Whether the modelDeploymentRef property is present.
61
62
  * @template HasInstructions Whether the instructions property is present.
62
63
  */
@@ -72,8 +73,8 @@ model AgentDefinitionAppliance<
72
73
  @baseTypeOptional(HasInstructions, true)
73
74
  instructions: string;
74
75
 
75
- /** Optional RP-specific reference to an underlying model deployment. */
76
- @baseTypeOptional(HasModelDeploymentRef, true)
76
+ /** Optional RP-specific reference to an underlying model deployment. Writable in both deployment models. */
77
+ @baseTypeOptional(HasModelDeploymentRef, false)
77
78
  modelDeploymentRef?: string;
78
79
  }
79
80
 
@@ -125,7 +126,10 @@ internal model AgentProperties {
125
126
 
126
127
  /**
127
128
  * Appliance deployment model of AgentProperties.
128
- * All properties are read-only (the appliance owns and reports state).
129
+ * All properties are read-only (the appliance owns and reports state), except the `definition`
130
+ * container itself: it stays writable so the client can send the fields the agent definition
131
+ * marks as writable, such as `modelDeploymentRef`. Every service-owned field inside the
132
+ * definition remains read-only.
129
133
  * @template AgentDefinitionType The user-defined agent definition model (must extend AgentDefinition).
130
134
  */
131
135
  model AgentPropertiesAppliance<AgentDefinitionType extends AgentDefinition> {
@@ -141,8 +145,7 @@ model AgentPropertiesAppliance<AgentDefinitionType extends AgentDefinition> {
141
145
  @visibility(Lifecycle.Read)
142
146
  description: string;
143
147
 
144
- /** Inline agent definition. */
145
- @visibility(Lifecycle.Read)
148
+ /** Inline agent definition. The container is writable so the client can set the definition fields that are not service-owned. */
146
149
  definition: AgentDefinitionType;
147
150
 
148
151
  /** Tool bindings. Read-only in the Appliance deployment model. */
@@ -0,0 +1,211 @@
1
+ using Azure.Core;
2
+ using Versioning;
3
+
4
+ namespace Azure.ResourceManager.CommonTypes;
5
+
6
+ /**
7
+ * Billing Data
8
+ */
9
+ @added(Versions.v6)
10
+ model BillingData {
11
+ /**
12
+ * The system ID of the resource. Globally unique per cloud.
13
+ */
14
+ @visibility(Lifecycle.Read)
15
+ systemId?: uuid;
16
+
17
+ /**
18
+ * Indicates the billing state of the resource.
19
+ */
20
+ @visibility(Lifecycle.Read)
21
+ state?: BillingState = BillingState.Pending;
22
+
23
+ /**
24
+ * Indicates reason(s) for the current billing state of the resource.
25
+ */
26
+ @visibility(Lifecycle.Read)
27
+ reasons?: BillingStateReason[];
28
+
29
+ /**
30
+ * The product identifier referencing a product in the catalog.
31
+ */
32
+ productCode: uuid;
33
+
34
+ /**
35
+ * Product token (JWT) identifying a specific version of the product.
36
+ */
37
+ @visibility(Lifecycle.Create, Lifecycle.Update)
38
+ productToken?: string;
39
+
40
+ /**
41
+ * The number of instances of the product.
42
+ */
43
+ quantity: int64 = 1;
44
+
45
+ /**
46
+ * Start date indicating the beginning of the term for which the resource is committed.
47
+ */
48
+ startDate?: utcDateTime;
49
+
50
+ /**
51
+ * End date indicating the end of the term for which the resource is committed.
52
+ */
53
+ endDate?: utcDateTime;
54
+
55
+ /**
56
+ * Billing token (JWT) representing additional billing context.
57
+ */
58
+ @visibility(Lifecycle.Create, Lifecycle.Update)
59
+ billingToken?: string;
60
+
61
+ /**
62
+ * The resource's billing schedule.
63
+ */
64
+ schedule?: BillingSchedule;
65
+ }
66
+
67
+ /**
68
+ * Billing schedule.
69
+ */
70
+ @added(Versions.v6)
71
+ model BillingSchedule {
72
+ /**
73
+ * Indicates the renewal behavior of this resource.
74
+ */
75
+ renewal: BillingRenewalType = BillingRenewalType.Automatic;
76
+
77
+ /**
78
+ * Schedules billing changes for this resource.
79
+ */
80
+ changes?: BillingScheduleChange[];
81
+ }
82
+
83
+ /**
84
+ * Billing schedule change.
85
+ */
86
+ @added(Versions.v6)
87
+ model BillingScheduleChange {
88
+ /**
89
+ * Indicates when the change is expected to become effective.
90
+ */
91
+ effective: BillingScheduleChangeEffectiveType = BillingScheduleChangeEffectiveType.Renewal;
92
+
93
+ /**
94
+ * The absolute date when the change is expected to become effective. Required when `effective` = `AbsoluteDate`.
95
+ */
96
+ effectiveDate?: utcDateTime;
97
+
98
+ /**
99
+ * The kind of change.
100
+ */
101
+ kind: BillingScheduleChangeKind = BillingScheduleChangeKind.Update;
102
+
103
+ /**
104
+ * The new product identifier. When not specified, the resource's product code remains unchanged.
105
+ */
106
+ productCode?: uuid;
107
+
108
+ /**
109
+ * Product token (JWT) identifying a specific version of the scheduled product. Can only be
110
+ * specified when productCode is specified also.
111
+ */
112
+ @visibility(Lifecycle.Create, Lifecycle.Update)
113
+ productToken?: string;
114
+
115
+ /**
116
+ * The new number of instances of the product. When not specified, the resource's quantity remains unchanged.
117
+ */
118
+ quantity?: int64;
119
+
120
+ /**
121
+ * The new (coterminous) end date of the product. Can only be specified when effective = renewal.
122
+ * When not specified, the resource's end date is calculated based on the renewal date and the
123
+ * product's term duration.
124
+ */
125
+ endDate?: utcDateTime;
126
+
127
+ /**
128
+ * Billing token (JWT) representing additional billing context.
129
+ */
130
+ @visibility(Lifecycle.Create, Lifecycle.Update)
131
+ billingToken?: string;
132
+ }
133
+
134
+ /**
135
+ * Billing state.
136
+ */
137
+ @added(Versions.v6)
138
+ union BillingState {
139
+ /** Resource's billing has not yet started. */
140
+ Pending: "Pending",
141
+
142
+ /** Resource's billing is activate. */
143
+ Active: "Active",
144
+
145
+ /** Resource's billing is in a warning state. */
146
+ Warned: "Warned",
147
+
148
+ /** Resource's billing is inactive. */
149
+ Inactive: "Inactive",
150
+
151
+ string,
152
+ }
153
+
154
+ /**
155
+ * Billing state reason.
156
+ */
157
+ @added(Versions.v6)
158
+ union BillingStateReason {
159
+ /** Resource's billing has been suspended by Microsoft. */
160
+ Suspended: "Suspended",
161
+
162
+ /** Resource has been canceled by the customer. */
163
+ Canceled: "Canceled",
164
+
165
+ /** Resource's billing has expired. */
166
+ Expired: "Expired",
167
+
168
+ string,
169
+ }
170
+
171
+ /**
172
+ * Type of renewal.
173
+ */
174
+ @added(Versions.v6)
175
+ union BillingRenewalType {
176
+ /** Automatically renew the product when its term ends. */
177
+ Automatic: "Automatic",
178
+
179
+ /** Don't automatically renew the product. */
180
+ None: "None",
181
+
182
+ string,
183
+ }
184
+
185
+ /**
186
+ * When a scheduled change is expected to become effective.
187
+ */
188
+ @added(Versions.v6)
189
+ union BillingScheduleChangeEffectiveType {
190
+ /** At a specified date. */
191
+ AbsoluteDate: "AbsoluteDate",
192
+
193
+ /** At time of term renewal. */
194
+ Renewal: "Renewal",
195
+
196
+ string,
197
+ }
198
+
199
+ /**
200
+ * Type of scheduled change.
201
+ */
202
+ @added(Versions.v6)
203
+ union BillingScheduleChangeKind {
204
+ /** Update the resource. */
205
+ Update: "Update",
206
+
207
+ /** Cancel the resource. */
208
+ Cancel: "Cancel",
209
+
210
+ string,
211
+ }
@@ -12,5 +12,5 @@ import "./versions.tsp";
12
12
  import "./mobo-ref.tsp";
13
13
  import "./network-security-perimeter-ref.tsp";
14
14
  import "./nsp-operations.tsp";
15
-
15
+ import "./billing-data.tsp";
16
16
  namespace Azure.ResourceManager.CommonTypes;
package/lib/models.tsp CHANGED
@@ -452,4 +452,21 @@ model AvailabilityZonesProperty {
452
452
  zones?: string[];
453
453
  }
454
454
 
455
+ /**
456
+ * Standard resource billing data property to represent the resource's current billing state.
457
+ * Spread this model directly into your resource property model when modeling e.g. prepaid resources.
458
+ *
459
+ * @example
460
+ *
461
+ * ```typespec
462
+ * model FooProperties {
463
+ * ...BillingDataProperty,
464
+ * }
465
+ * ```
466
+ */
467
+ model BillingDataProperty {
468
+ /** The billing data of the resource. */
469
+ billingData: CommonTypes.BillingData;
470
+ }
471
+
455
472
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-azure-resource-manager",
3
- "version": "0.71.0-dev.11",
3
+ "version": "0.71.0-dev.13",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec Azure Resource Manager library",
6
6
  "homepage": "https://azure.github.io/typespec-azure",
@@ -49,10 +49,10 @@
49
49
  "peerDependencies": {
50
50
  "@azure-tools/typespec-azure-core": "^0.70.0 || >= 0.71.0-dev.4",
51
51
  "@typespec/compiler": "^1.14.0",
52
- "@typespec/http": "^1.14.0",
53
- "@typespec/rest": "^0.84.0",
54
52
  "@typespec/openapi": "^1.14.0",
55
- "@typespec/versioning": "^0.84.0"
53
+ "@typespec/versioning": "^0.84.0",
54
+ "@typespec/http": "^1.14.0",
55
+ "@typespec/rest": "^0.84.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@azure-tools/typespec-azure-core": "^0.70.0 || >= 0.71.0-dev.4",
@@ -64,11 +64,11 @@
64
64
  "typescript": "~6.0.2",
65
65
  "vitest": "^4.1.3",
66
66
  "@typespec/compiler": "^1.14.0",
67
- "@typespec/library-linter": "^0.84.0",
68
67
  "@typespec/http": "^1.14.0",
69
- "@typespec/versioning": "^0.84.0",
70
68
  "@typespec/rest": "^0.84.0",
71
69
  "@typespec/tspd": "^0.76.0",
70
+ "@typespec/versioning": "^0.84.0",
71
+ "@typespec/library-linter": "^0.84.0",
72
72
  "@typespec/openapi": "^1.14.0"
73
73
  },
74
74
  "scripts": {