← ClaudeAtlas

csharp-calling-endpointslisted

Call operations on the PayPal Server SDK C# SDK. Load before the first call, and when building a request body or reading a response. The signature won't tell you controllers are properties on the client, that sync and async forms differ in which one takes a `CancellationToken`, or what an optional parameter's default actually puts on the wire.
MuHamza30/paypal-api-plugin · ★ 0 · API & Backend · score 70
Install: claude install-skill MuHamza30/paypal-api-plugin
# Calling endpoints on an APIMatic C# SDK Operations are methods on a **controller you read off the client as a property** — you never construct one: ```csharp using PaypalServerSdk.Standard; using PaypalServerSdk.Standard.Controllers; // only when you spell the controller type instead of `var` var client = new PaypalServerSdkClient.Builder()./* ... */.Build(); var controller = client.{Controller}; // the property's declared type varies per build var response = await controller.{Operation}Async(/* ... */); ``` The property is named after the controller class and is backed by a `Lazy<T>`, so the instance is created on first access and shared thereafter (see **csharp-client-initialization**). Every controller's constructor is **`internal`**, so `new {Controller}(...)` does not compile. **The class suffix varies per SDK** — some builds carry none — so read the names off the **Controllers** table in `doc/client.md`. ## Two method shapes — blocking and `{Operation}Async` Each operation is generated as a pair, side by side in the same file: ```csharp public {ReturnType} {Operation}({params}) public async Task<{ReturnType}> {Operation}Async({params}, CancellationToken cancellationToken = default) ``` - On a non-paginated operation the sync form is a one-line `CoreHelper.RunTask(...)` delegation that **blocks the calling thread** and drops the `CancellationToken`, so **a sync call cannot be cancelled**. A server-sent-events operation gets the `...Async` form only.