forked from Azure/azure-rest-api-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EG] GA client.tsp updates (Azure#29208)
* try this * ver * update * details * update * renew locks result rename * add new version - testing * remove diff * ga version * update * try alias * all operations mark as internal to allow for topic/sub customization * remove * tsp format * alias change * details * changes * after merge required regen * nit * try * tsp format * edits off of lang * only python * nit * Fixing some names for Go, based on Go arch feedback. * One more rename * Update specification/eventgrid/Azure.Messaging.EventGrid/client.tsp * fixing go diff * update * update internal --------- Co-authored-by: ripark <ripark@microsoft.com>
- Loading branch information
1 parent
bf97382
commit 8713240
Showing
6 changed files
with
351 additions
and
293 deletions.
There are no files selected for viewing
146 changes: 143 additions & 3 deletions
146
specification/eventgrid/Azure.Messaging.EventGrid/client.tsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,148 @@ | ||
import "@azure-tools/typespec-client-generator-core"; | ||
import "./main.tsp"; | ||
import "@typespec/versioning"; | ||
|
||
using Azure.ClientGenerator.Core; | ||
using Microsoft.EventGrid; | ||
|
||
@@access(Microsoft.EventGrid.publishCloudEvent, Access.internal, "python"); | ||
@@access(Microsoft.EventGrid.publishCloudEvents, Access.internal, "python"); | ||
@@access(Microsoft.EventGrid.receiveCloudEvents, Access.internal, "python"); | ||
@TypeSpec.Versioning.useDependency(ServiceApiVersions.v2024_06_01) | ||
namespace Customizations { | ||
@client( | ||
{ | ||
name: "EventGridPublisherClient", | ||
service: Microsoft.EventGrid, | ||
}, | ||
"python" | ||
) | ||
interface Client1 { | ||
send is publishCloudEvent; | ||
sendEvents is publishCloudEvents; | ||
} | ||
|
||
@client( | ||
{ | ||
name: "EventGridConsumerClient", | ||
service: Microsoft.EventGrid, | ||
}, | ||
"python" | ||
) | ||
interface Client2 { | ||
receive is receiveCloudEvents; | ||
acknowledge is acknowledgeCloudEvents; | ||
release is releaseCloudEvents; | ||
reject is rejectCloudEvents; | ||
renewLocks is renewCloudEventLocks; | ||
} | ||
|
||
@client( | ||
{ | ||
name: "EventGridSenderClient", | ||
service: Microsoft.EventGrid, | ||
}, | ||
"csharp" | ||
) | ||
interface ClientSender { | ||
send is publishCloudEvent; | ||
sendEvents is publishCloudEvents; | ||
} | ||
|
||
@client( | ||
{ | ||
name: "EventGridReceiverClient", | ||
service: Microsoft.EventGrid, | ||
}, | ||
"csharp" | ||
) | ||
interface ClientReceiver { | ||
receive is receiveCloudEvents; | ||
acknowledge is acknowledgeCloudEvents; | ||
release is releaseCloudEvents; | ||
reject is rejectCloudEvents; | ||
renewLocks is renewCloudEventLocks; | ||
} | ||
|
||
@client( | ||
{ | ||
name: "EventGridSenderClient", | ||
service: Microsoft.EventGrid, | ||
}, | ||
"java" | ||
) | ||
interface ClientSender2 { | ||
send is publishCloudEvent; | ||
sendEvents is publishCloudEvents; | ||
} | ||
|
||
@client( | ||
{ | ||
name: "EventGridReceiverClient", | ||
service: Microsoft.EventGrid, | ||
}, | ||
"java" | ||
) | ||
interface ClientReceiver2 { | ||
receive is receiveCloudEvents; | ||
acknowledge is acknowledgeCloudEvents; | ||
release is releaseCloudEvents; | ||
reject is rejectCloudEvents; | ||
renewLocks is renewCloudEventLocks; | ||
} | ||
|
||
@client( | ||
{ | ||
name: "SenderClient", | ||
service: Microsoft.EventGrid, | ||
}, | ||
"go" | ||
) | ||
interface ClientSenderGo { | ||
sendEvent is publishCloudEvent; | ||
sendEvents is publishCloudEvents; | ||
} | ||
|
||
@client( | ||
{ | ||
name: "ReceiverClient", | ||
service: Microsoft.EventGrid, | ||
}, | ||
"go" | ||
) | ||
interface ClientReceiverGo { | ||
receiveEvents is receiveCloudEvents; | ||
acknowledgeEvents is acknowledgeCloudEvents; | ||
releaseEvents is releaseCloudEvents; | ||
rejectEvents is rejectCloudEvents; | ||
renewEventLocks is renewCloudEventLocks; | ||
} | ||
} | ||
|
||
// All Language customizations | ||
|
||
// publishCloudEvent access level | ||
@@access(publishCloudEvent, Access.internal, "python"); | ||
|
||
// publishCloudEvents access level | ||
@@access(publishCloudEvents, Access.internal, "python"); | ||
|
||
@@access(receiveCloudEvents, Access.internal, "python"); | ||
@@access(acknowledgeCloudEvents, Access.internal, "python"); | ||
@@access(releaseCloudEvents, Access.internal, "python"); | ||
@@access(rejectCloudEvents, Access.internal, "python"); | ||
@@access(renewCloudEventLocks, Access.internal, "python"); | ||
|
||
@@access(AcknowledgeResult, Access.public); | ||
@@access(ReleaseResult, Access.public); | ||
@@access(RejectResult, Access.public); | ||
@@access(RenewCloudEventLocksResult, Access.public); | ||
@@access(ReleaseDelay, Access.public); | ||
@@access(FailedLockToken, Access.public); | ||
|
||
@@clientName(ReleaseDelay.By0Seconds, "NoDelay"); | ||
@@clientName(ReleaseDelay.By10Seconds, "TenSeconds"); | ||
@@clientName(ReleaseDelay.By3600Seconds, "OneHour"); | ||
@@clientName(ReleaseDelay.By600Seconds, "TenMinutes"); | ||
@@clientName(ReleaseDelay.By60Seconds, "OneMinute"); | ||
|
||
@@clientName(RenewCloudEventLocksResult, "RenewLocksResult"); | ||
|
||
@@clientName(ReceiveResult.value, "details"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.