Skip to content

Commit

Permalink
[Contoso.Management] Use ArmResourcePatchSync instead of ArmCustomPat…
Browse files Browse the repository at this point in the history
…chSync (Azure#31279)

- Recommended to use ArmResourcePatchSync when possible
  • Loading branch information
mikeharder authored Oct 30, 2024
1 parent 3b822e9 commit d764a6e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,7 @@ union ProvisioningState {
interface Employees {
get is ArmResourceRead<Employee>;
createOrUpdate is ArmResourceCreateOrReplaceAsync<Employee>;
update is ArmCustomPatchSync<
Employee,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
Employee,
EmployeeProperties
>
>;
update is ArmResourcePatchSync<Employee, EmployeeProperties>;
delete is ArmResourceDeleteWithoutOkAsync<Employee>;
listByResourceGroup is ArmResourceListByParent<Employee>;
listBySubscription is ArmListBySubscription<Employee>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ options:
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/contoso.json"
emit-common-types-schema: "never"
"@azure-tools/typespec-csharp":
flavor: azure
package-dir: "Azure.ResourceManager.Contoso"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,24 @@
}
},
"definitions": {
"Azure.ResourceManager.CommonTypes.TrackedResourceUpdate": {
"type": "object",
"description": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'",
"properties": {
"tags": {
"type": "object",
"description": "Resource tags.",
"additionalProperties": {
"type": "string"
}
}
},
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/Resource"
}
]
},
"Employee": {
"type": "object",
"description": "Employee resource",
Expand Down Expand Up @@ -465,40 +483,18 @@
},
"EmployeeUpdate": {
"type": "object",
"description": "The type used for update operations of the Employee.",
"description": "Employee resource",
"properties": {
"tags": {
"type": "object",
"description": "Resource tags.",
"additionalProperties": {
"type": "string"
}
},
"properties": {
"$ref": "#/definitions/EmployeeUpdateProperties",
"$ref": "#/definitions/EmployeeProperties",
"description": "The resource-specific properties for this resource."
}
}
},
"EmployeeUpdateProperties": {
"type": "object",
"description": "The updatable properties of the Employee.",
"properties": {
"age": {
"type": "integer",
"format": "int32",
"description": "Age of employee"
},
"city": {
"type": "string",
"description": "City of employee"
},
"profile": {
"type": "string",
"format": "base64url",
"description": "Profile of employee"
},
"allOf": [
{
"$ref": "#/definitions/Azure.ResourceManager.CommonTypes.TrackedResourceUpdate"
}
}
]
},
"ProvisioningState": {
"type": "string",
Expand Down

0 comments on commit d764a6e

Please sign in to comment.