Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"base-exception-class-name": "CloudPDFException",
"base-api-exception-class-name": "CloudPDFApiException"
},
"originGitCommit": "3a88df90980e5c0546a5ebbfd1252d8fca77ff9b",
"originGitCommit": "0606e988ebff3773183ef02e0a820c36b3a25f8d",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "3.0.0-next.18",
"requestedVersion": "3.0.0-next.19",
"ciProvider": "github",
"sdkVersion": "3.0.0-next.18"
"sdkVersion": "3.0.0-next.19"
}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,25 +218,25 @@ This SDK uses forward-compatible enums that can handle unknown values gracefully
using CloudPDF;

// Using a built-in value
var sharesCreateRequestLayerMode = SharesCreateRequestLayerMode.Shared;
var grantsCreateRequestLayerMode = GrantsCreateRequestLayerMode.Shared;

// Using a custom value
var customSharesCreateRequestLayerMode = SharesCreateRequestLayerMode.FromCustom("custom-value");
var customGrantsCreateRequestLayerMode = GrantsCreateRequestLayerMode.FromCustom("custom-value");

// Using in a switch statement
switch (sharesCreateRequestLayerMode.Value)
switch (grantsCreateRequestLayerMode.Value)
{
case SharesCreateRequestLayerMode.Values.Shared:
case GrantsCreateRequestLayerMode.Values.Shared:
Console.WriteLine("Shared");
break;
default:
Console.WriteLine($"Unknown value: {sharesCreateRequestLayerMode.Value}");
Console.WriteLine($"Unknown value: {grantsCreateRequestLayerMode.Value}");
break;
}

// Explicit casting
string sharesCreateRequestLayerModeString = (string)SharesCreateRequestLayerMode.Shared;
SharesCreateRequestLayerMode sharesCreateRequestLayerModeFromString = (SharesCreateRequestLayerMode)"shared";
string grantsCreateRequestLayerModeString = (string)GrantsCreateRequestLayerMode.Shared;
GrantsCreateRequestLayerMode grantsCreateRequestLayerModeFromString = (GrantsCreateRequestLayerMode)"shared";
```

## Contributing
Expand Down
8 changes: 4 additions & 4 deletions cloudpdf-generation.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"language": "csharp",
"canonicalVersion": "3.0.0-next.18",
"sdkVersion": "3.0.0-next.18",
"canonicalVersion": "3.0.0-next.19",
"sdkVersion": "3.0.0-next.19",
"source": {
"repository": "embedpdf/embed-pdf-viewer",
"openapi": "cloudpdf/contract/openapi.json",
"openapiSha256": "ad2a3baa628061e7b3e8b597cfd15bcda7f103d0f829cb01388a0fed6c4f5873",
"gitCommit": "3a88df90980e5c0546a5ebbfd1252d8fca77ff9b",
"openapiSha256": "e88e02ed71f422ad08b2393abeda474e8dcf6707b6e753af74ba2f40da8e7d6b",
"gitCommit": "0606e988ebff3773183ef02e0a820c36b3a25f8d",
"gitCommitIsDirty": false
},
"fern": {
Expand Down
78 changes: 39 additions & 39 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ await client.Doc.TextAsync(
</dl>
</details>

## Shares
<details><summary><code>client.Shares.<a href="/src/CloudPDF/Shares/SharesClient.cs">ExchangeAsync</a>(SharesExchangeRequest { ... }) -> WithRawResponseTask&lt;SharesExchange200Response&gt;</code></summary>
## Grants
<details><summary><code>client.Grants.<a href="/src/CloudPDF/Grants/GrantsClient.cs">ExchangeAsync</a>(GrantsExchangeRequest { ... }) -> WithRawResponseTask&lt;GrantsExchange200Response&gt;</code></summary>
<dl>
<dd>

Expand All @@ -387,7 +387,7 @@ await client.Doc.TextAsync(
<dl>
<dd>

Unauthenticated, but requires a browser Origin header, checked against the grant allowlist. Unknown, revoked, and disabled tokens are indistinguishable (404). Passphrase-protected grants return 422 SharePasswordRequired until `password` is supplied. A link that asks its visitors who they are on open returns 422 VisitorIdentityRequired until the required answers are given; `error.details` carries `fields` (what the link asks), `missing`, `invalid`, `purpose` and `privacyUrl`. A link that asks before the first change issues the session at once with `visitor.identityRequest`, and writes answer 403 VisitorIdentityRequired with the same details until the visitor exchanges again with their answers. Answers that can not be taken answer 422 on any link. Mounted only when the deployment can sign (HS256 mode).
Unauthenticated, but requires a browser Origin header, checked against the grant allowlist. Unknown, deleted, paused and archived grants are indistinguishable (404). Passphrase-protected grants return 422 GrantPassphraseRequired until `passphrase` is supplied. A grant that asks its visitors who they are on open returns 422 VisitorIdentityRequired until the required answers are given; `error.details` carries `fields` (what the grant asks), `missing`, `invalid`, `purpose` and `privacyUrl`. A grant that asks before the first change issues the session at once with `visitor.identityRequest`, and writes answer 403 VisitorIdentityRequired with the same details until the visitor exchanges again with their answers. Answers that can not be taken answer 422 on any grant. Mounted only when the deployment can sign (HS256 mode).
</dd>
</dl>
</dd>
Expand All @@ -402,7 +402,7 @@ Unauthenticated, but requires a browser Origin header, checked against the grant
<dd>

```csharp
await client.Shares.ExchangeAsync(new SharesExchangeRequest { ShareToken = "shareToken" });
await client.Grants.ExchangeAsync(new GrantsExchangeRequest { Grant = "grant" });
```
</dd>
</dl>
Expand All @@ -417,7 +417,7 @@ await client.Shares.ExchangeAsync(new SharesExchangeRequest { ShareToken = "shar
<dl>
<dd>

**request:** `SharesExchangeRequest`
**request:** `GrantsExchangeRequest`

</dd>
</dl>
Expand All @@ -429,7 +429,7 @@ await client.Shares.ExchangeAsync(new SharesExchangeRequest { ShareToken = "shar
</dl>
</details>

<details><summary><code>client.Shares.<a href="/src/CloudPDF/Shares/SharesClient.cs">ListAsync</a>(ListSharesRequest { ... }) -> WithRawResponseTask&lt;SharesList200Response&gt;</code></summary>
<details><summary><code>client.Grants.<a href="/src/CloudPDF/Grants/GrantsClient.cs">ListAsync</a>(ListGrantsRequest { ... }) -> WithRawResponseTask&lt;GrantsList200Response&gt;</code></summary>
<dl>
<dd>

Expand All @@ -442,7 +442,7 @@ await client.Shares.ExchangeAsync(new SharesExchangeRequest { ShareToken = "shar
<dd>

```csharp
await client.Shares.ListAsync(new ListSharesRequest { TenantId = "tenantId" });
await client.Grants.ListAsync(new ListGrantsRequest { TenantId = "tenantId" });
```
</dd>
</dl>
Expand All @@ -457,7 +457,7 @@ await client.Shares.ListAsync(new ListSharesRequest { TenantId = "tenantId" });
<dl>
<dd>

**request:** `ListSharesRequest`
**request:** `ListGrantsRequest`

</dd>
</dl>
Expand All @@ -469,7 +469,7 @@ await client.Shares.ListAsync(new ListSharesRequest { TenantId = "tenantId" });
</dl>
</details>

<details><summary><code>client.Shares.<a href="/src/CloudPDF/Shares/SharesClient.cs">CreateAsync</a>(SharesCreateRequest { ... }) -> WithRawResponseTask&lt;SharesCreate200Response&gt;</code></summary>
<details><summary><code>client.Grants.<a href="/src/CloudPDF/Grants/GrantsClient.cs">CreateAsync</a>(GrantsCreateRequest { ... }) -> WithRawResponseTask&lt;GrantsCreate200Response&gt;</code></summary>
<dl>
<dd>

Expand All @@ -481,7 +481,7 @@ await client.Shares.ListAsync(new ListSharesRequest { TenantId = "tenantId" });
<dl>
<dd>

The returned share id is the public share token. Mounted only when the deployment can sign (HS256 mode) — exchange mints session JWTs, so grants exist only where minting does.
The returned id is what a link page or an embed opens. Mounted only when the deployment can sign (HS256 mode) — exchange mints session JWTs, so grants exist only where minting does.
</dd>
</dl>
</dd>
Expand All @@ -496,8 +496,8 @@ The returned share id is the public share token. Mounted only when the deploymen
<dd>

```csharp
await client.Shares.CreateAsync(
new SharesCreateRequest
await client.Grants.CreateAsync(
new GrantsCreateRequest
{
TenantId = "tenantId",
DocId = "docId",
Expand All @@ -518,7 +518,7 @@ await client.Shares.CreateAsync(
<dl>
<dd>

**request:** `SharesCreateRequest`
**request:** `GrantsCreateRequest`

</dd>
</dl>
Expand All @@ -530,7 +530,7 @@ await client.Shares.CreateAsync(
</dl>
</details>

<details><summary><code>client.Shares.<a href="/src/CloudPDF/Shares/SharesClient.cs">GetAsync</a>(GetSharesRequest { ... }) -> WithRawResponseTask&lt;SharesGet200Response&gt;</code></summary>
<details><summary><code>client.Grants.<a href="/src/CloudPDF/Grants/GrantsClient.cs">GetAsync</a>(GetGrantsRequest { ... }) -> WithRawResponseTask&lt;GrantsGet200Response&gt;</code></summary>
<dl>
<dd>

Expand All @@ -543,7 +543,7 @@ await client.Shares.CreateAsync(
<dd>

```csharp
await client.Shares.GetAsync(new GetSharesRequest { TenantId = "tenantId", ShareId = "shareId" });
await client.Grants.GetAsync(new GetGrantsRequest { TenantId = "tenantId", GrantId = "grantId" });
```
</dd>
</dl>
Expand All @@ -558,7 +558,7 @@ await client.Shares.GetAsync(new GetSharesRequest { TenantId = "tenantId", Share
<dl>
<dd>

**request:** `GetSharesRequest`
**request:** `GetGrantsRequest`

</dd>
</dl>
Expand All @@ -570,7 +570,7 @@ await client.Shares.GetAsync(new GetSharesRequest { TenantId = "tenantId", Share
</dl>
</details>

<details><summary><code>client.Shares.<a href="/src/CloudPDF/Shares/SharesClient.cs">DeleteAsync</a>(DeleteSharesRequest { ... }) -> WithRawResponseTask</code></summary>
<details><summary><code>client.Grants.<a href="/src/CloudPDF/Grants/GrantsClient.cs">DeleteAsync</a>(DeleteGrantsRequest { ... }) -> WithRawResponseTask</code></summary>
<dl>
<dd>

Expand All @@ -583,8 +583,8 @@ await client.Shares.GetAsync(new GetSharesRequest { TenantId = "tenantId", Share
<dd>

```csharp
await client.Shares.DeleteAsync(
new DeleteSharesRequest { TenantId = "tenantId", ShareId = "shareId" }
await client.Grants.DeleteAsync(
new DeleteGrantsRequest { TenantId = "tenantId", GrantId = "grantId" }
);
```
</dd>
Expand All @@ -600,7 +600,7 @@ await client.Shares.DeleteAsync(
<dl>
<dd>

**request:** `DeleteSharesRequest`
**request:** `DeleteGrantsRequest`

</dd>
</dl>
Expand All @@ -612,7 +612,7 @@ await client.Shares.DeleteAsync(
</dl>
</details>

<details><summary><code>client.Shares.<a href="/src/CloudPDF/Shares/SharesClient.cs">UpdateAsync</a>(SharesUpdateRequest { ... }) -> WithRawResponseTask&lt;SharesUpdate200Response&gt;</code></summary>
<details><summary><code>client.Grants.<a href="/src/CloudPDF/Grants/GrantsClient.cs">UpdateAsync</a>(GrantsUpdateRequest { ... }) -> WithRawResponseTask&lt;GrantsUpdate200Response&gt;</code></summary>
<dl>
<dd>

Expand All @@ -625,8 +625,8 @@ await client.Shares.DeleteAsync(
<dd>

```csharp
await client.Shares.UpdateAsync(
new SharesUpdateRequest { TenantId = "tenantId", ShareId = "shareId" }
await client.Grants.UpdateAsync(
new GrantsUpdateRequest { TenantId = "tenantId", GrantId = "grantId" }
);
```
</dd>
Expand All @@ -642,7 +642,7 @@ await client.Shares.UpdateAsync(
<dl>
<dd>

**request:** `SharesUpdateRequest`
**request:** `GrantsUpdateRequest`

</dd>
</dl>
Expand All @@ -654,7 +654,7 @@ await client.Shares.UpdateAsync(
</dl>
</details>

<details><summary><code>client.Shares.<a href="/src/CloudPDF/Shares/SharesClient.cs">ArchiveAsync</a>(ArchiveSharesRequest { ... }) -> WithRawResponseTask&lt;SharesArchive200Response&gt;</code></summary>
<details><summary><code>client.Grants.<a href="/src/CloudPDF/Grants/GrantsClient.cs">ArchiveAsync</a>(ArchiveGrantsRequest { ... }) -> WithRawResponseTask&lt;GrantsArchive200Response&gt;</code></summary>
<dl>
<dd>

Expand All @@ -666,7 +666,7 @@ await client.Shares.UpdateAsync(
<dl>
<dd>

Archiving is final: an archived link never exchanges again, and to share again you create a new link. Pausing (`disabled`) is the reversible stop. An archived link no longer counts as using its shared layer, so that layer can be deleted.
Archiving is final: an archived grant never exchanges again, and to give access again you create a new grant. Pausing (`disabled`) is the reversible stop. An archived grant no longer counts as using its shared layer, so that layer can be deleted.
</dd>
</dl>
</dd>
Expand All @@ -681,8 +681,8 @@ Archiving is final: an archived link never exchanges again, and to share again y
<dd>

```csharp
await client.Shares.ArchiveAsync(
new ArchiveSharesRequest { TenantId = "tenantId", ShareId = "shareId" }
await client.Grants.ArchiveAsync(
new ArchiveGrantsRequest { TenantId = "tenantId", GrantId = "grantId" }
);
```
</dd>
Expand All @@ -698,7 +698,7 @@ await client.Shares.ArchiveAsync(
<dl>
<dd>

**request:** `ArchiveSharesRequest`
**request:** `ArchiveGrantsRequest`

</dd>
</dl>
Expand Down Expand Up @@ -991,7 +991,7 @@ await client.Tenants.SuspendAsync(new TenantsSuspendRequest { TenantId = "tenant
<dl>
<dd>

Facts only — no limits or billing state. Views count share exchanges plus authorized /v1/access grants, deduplicated across the two.
Facts only — no limits or billing state. Views count grant exchanges plus authorized /v1/access requests, deduplicated across the two.
</dd>
</dl>
</dd>
Expand Down Expand Up @@ -1662,7 +1662,7 @@ await client.Folders.GetAsync(
<dl>
<dd>

Without recursive, a folder with anything inside is refused: 409 Conflict with `details.reason` `not-empty` and what it holds, counted over every level below, in `details.folders` and `details.documents`. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit.
Without recursive, a folder with anything inside is refused: 409 Conflict with `details.reason` `not-empty` and what it holds, counted over every level below, in `details.folders` and `details.documents`. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its grants at once; their stored files and grants are removed in the background. Uploads into those folders that have not committed cannot commit.
</dd>
</dl>
</dd>
Expand Down Expand Up @@ -4173,8 +4173,8 @@ await client.Documents.Layers.DeleteAsync(
</dl>
</details>

## Shares Visitors
<details><summary><code>client.Shares.Visitors.<a href="/src/CloudPDF/Shares/Visitors/VisitorsClient.cs">ListAsync</a>(ListVisitorsRequest { ... }) -> WithRawResponseTask&lt;SharesVisitorsList200Response&gt;</code></summary>
## Grants Visitors
<details><summary><code>client.Grants.Visitors.<a href="/src/CloudPDF/Grants/Visitors/VisitorsClient.cs">ListAsync</a>(ListVisitorsRequest { ... }) -> WithRawResponseTask&lt;GrantsVisitorsList200Response&gt;</code></summary>
<dl>
<dd>

Expand All @@ -4186,7 +4186,7 @@ await client.Documents.Layers.DeleteAsync(
<dl>
<dd>

An archived link's visitors are listed too.
An archived grant's visitors are listed too.
</dd>
</dl>
</dd>
Expand All @@ -4201,8 +4201,8 @@ An archived link's visitors are listed too.
<dd>

```csharp
await client.Shares.Visitors.ListAsync(
new ListVisitorsRequest { TenantId = "tenantId", ShareId = "shareId" }
await client.Grants.Visitors.ListAsync(
new ListVisitorsRequest { TenantId = "tenantId", GrantId = "grantId" }
);
```
</dd>
Expand Down Expand Up @@ -4230,7 +4230,7 @@ await client.Shares.Visitors.ListAsync(
</dl>
</details>

<details><summary><code>client.Shares.Visitors.<a href="/src/CloudPDF/Shares/Visitors/VisitorsClient.cs">DeleteAsync</a>(DeleteVisitorsRequest { ... }) -> WithRawResponseTask</code></summary>
<details><summary><code>client.Grants.Visitors.<a href="/src/CloudPDF/Grants/Visitors/VisitorsClient.cs">DeleteAsync</a>(DeleteVisitorsRequest { ... }) -> WithRawResponseTask</code></summary>
<dl>
<dd>

Expand All @@ -4257,11 +4257,11 @@ Their handle brings them back as a new visitor, who is asked again. Deleting a v
<dd>

```csharp
await client.Shares.Visitors.DeleteAsync(
await client.Grants.Visitors.DeleteAsync(
new DeleteVisitorsRequest
{
TenantId = "tenantId",
ShareId = "shareId",
GrantId = "grantId",
VisitorId = "visitorId",
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public async Task MockServerTest_1()
{
"docId": "docId",
"layerName": "layerName",
"shareId": "shareId",
"grantId": "grantId",
"visitorId": "visitorId",
"storageSizeBytes": 1.1,
"createdAt": 1.1,
Expand All @@ -28,7 +28,7 @@ public async Task MockServerTest_1()
{
"docId": "docId",
"layerName": "layerName",
"shareId": "shareId",
"grantId": "grantId",
"visitorId": "visitorId",
"storageSizeBytes": 1.1,
"createdAt": 1.1,
Expand Down Expand Up @@ -69,7 +69,7 @@ public async Task MockServerTest_2()
{
"docId": "docId",
"layerName": "layerName",
"shareId": "shareId",
"grantId": "grantId",
"visitorId": "visitorId",
"storageSizeBytes": 1.1,
"createdAt": 1.1,
Expand Down
Loading
Loading