Skip to content

Commit 018733d

Browse files
committed
Exclude undocumented resources and properties from the generated SDK
Filter blueprint resources, events, action attempts, and their properties on isUndocumented, dropping resource object classes such as PhoneSession and BridgeClientSession that are not part of the public SDK. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EjeywMUAsXPYML3H7imc4H
1 parent 914a6fe commit 018733d

57 files changed

Lines changed: 33 additions & 1846 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

codegen/lib/resource-model.ts

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,36 @@ export const createResourceObjectModel = (
3333
const baseResources = new Map<string, Property[]>()
3434

3535
for (const resource of blueprint.resources) {
36-
baseResources.set(resource.resourceType, resource.properties)
36+
if (resource.isUndocumented) continue
37+
baseResources.set(
38+
resource.resourceType,
39+
documentedProperties(resource.properties),
40+
)
3741
}
3842

3943
// The blueprint models events and action attempts as one resource per
4044
// variant. The PHP SDK has a single class for each, so the variants are
4145
// merged into one schema.
42-
if (blueprint.events.length > 0) {
46+
const events = blueprint.events.filter((event) => !event.isUndocumented)
47+
if (events.length > 0) {
4348
baseResources.set(
4449
'event',
45-
mergeProperties(blueprint.events.map((event) => event.properties)),
50+
mergeProperties(
51+
events.map((event) => documentedProperties(event.properties)),
52+
),
4653
)
4754
}
4855

49-
if (blueprint.actionAttempts.length > 0) {
56+
const actionAttempts = blueprint.actionAttempts.filter(
57+
(actionAttempt) => !actionAttempt.isUndocumented,
58+
)
59+
if (actionAttempts.length > 0) {
5060
baseResources.set(
5161
'action_attempt',
5262
mergeProperties(
53-
blueprint.actionAttempts.map((actionAttempt) => actionAttempt.properties),
63+
actionAttempts.map((actionAttempt) =>
64+
documentedProperties(actionAttempt.properties),
65+
),
5466
),
5567
)
5668
}
@@ -94,17 +106,25 @@ const createResourceObjectProperty = (
94106
): ResourceObjectProperty => {
95107
const referenceName = pascalCase(`${baseName}_${property.name}`)
96108

97-
if (property.format === 'object' && property.properties.length > 0) {
98-
addSchema(referenceName, property.properties, baseName)
99-
return { name: property.name, kind: 'objectReference', referenceName }
109+
if (property.format === 'object') {
110+
const properties = documentedProperties(property.properties)
111+
112+
if (properties.length > 0) {
113+
addSchema(referenceName, properties, baseName)
114+
return { name: property.name, kind: 'objectReference', referenceName }
115+
}
100116
}
101117

102118
if (property.format === 'list') {
103119
const itemProperties =
104120
property.itemFormat === 'object'
105-
? property.itemProperties
121+
? documentedProperties(property.itemProperties)
106122
: property.itemFormat === 'discriminated_object'
107-
? mergeProperties(property.variants.map((variant) => variant.properties))
123+
? mergeProperties(
124+
property.variants.map((variant) =>
125+
documentedProperties(variant.properties),
126+
),
127+
)
108128
: []
109129

110130
if (itemProperties.length > 0) {
@@ -120,6 +140,9 @@ const createResourceObjectProperty = (
120140
}
121141
}
122142

143+
const documentedProperties = (properties: Property[]): Property[] =>
144+
properties.filter((property) => !property.isUndocumented)
145+
123146
const mergeProperties = (propertyLists: Property[][]): Property[] => {
124147
const merged = new Map<string, Property>()
125148

src/Objects/AcsCredentialPool.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/Objects/AcsCredentialProvisioningAutomation.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/Objects/AcsUser.php

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Objects/Batch.php

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Objects/BridgeClientSession.php

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/Objects/BridgeClientSessionErrors.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/Objects/BridgeConnectedSystems.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/Objects/ConnectWebview.php

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Objects/Customer.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)