diff --git a/oxide-api/src/Api.ts b/oxide-api/src/Api.ts index bc0c7b9..b8f45da 100644 --- a/oxide-api/src/Api.ts +++ b/oxide-api/src/Api.ts @@ -52,7 +52,7 @@ export type Address = { /** The address lot this address is drawn from. */ addressLot: NameOrId; /** Optional VLAN ID for this address */ - vlanId?: number; + vlanId?: number | null; }; /** @@ -120,7 +120,7 @@ export type AddressLotBlockResultsPage = { /** list of items on this page of results */ items: AddressLotBlock[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -152,7 +152,7 @@ export type AddressLotResultsPage = { /** list of items on this page of results */ items: AddressLot[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -260,7 +260,7 @@ export type AffinityGroupMemberResultsPage = { /** list of items on this page of results */ items: AffinityGroupMember[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -270,13 +270,16 @@ export type AffinityGroupResultsPage = { /** list of items on this page of results */ items: AffinityGroup[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** * Updateable properties of an `AffinityGroup` */ -export type AffinityGroupUpdate = { description?: string; name?: Name }; +export type AffinityGroupUpdate = { + description?: string | null; + name?: Name | null; +}; export type BgpMessageHistory = Record; @@ -387,7 +390,7 @@ export type AntiAffinityGroupMemberResultsPage = { /** list of items on this page of results */ items: AntiAffinityGroupMember[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -397,13 +400,16 @@ export type AntiAffinityGroupResultsPage = { /** list of items on this page of results */ items: AntiAffinityGroup[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** * Updateable properties of an `AntiAffinityGroup` */ -export type AntiAffinityGroupUpdate = { description?: string; name?: Name }; +export type AntiAffinityGroupUpdate = { + description?: string | null; + name?: Name | null; +}; /** * Authorization scope for a timeseries. @@ -450,7 +456,7 @@ export type BfdSessionEnable = { /** The negotiated Control packet transmission interval, multiplied by this variable, will be the Detection Time for this session (as seen by the remote system) */ detectionThreshold: number; /** Address the Oxide switch will listen on for BFD traffic. If `None` then the unspecified address (0.0.0.0 or ::) is used. */ - local?: string; + local?: string | null; /** Select either single-hop (RFC 5881) or multi-hop (RFC 5883) */ mode: BfdMode; /** Address of the remote peer to establish a BFD session with. */ @@ -476,7 +482,7 @@ export type BfdState = export type BfdStatus = { detectionThreshold: number; - local?: string; + local?: string | null; mode: BfdMode; peer: string; requiredRx: number; @@ -549,7 +555,7 @@ export type BgpConfig = { /** timestamp when this resource was last modified */ timeModified: Date; /** Optional virtual routing and forwarding identifier for this BGP configuration. */ - vrf?: string; + vrf?: string | null; }; /** @@ -562,7 +568,7 @@ export type BgpConfigCreate = { description: string; name: Name; /** Optional virtual routing and forwarding identifier for this BGP configuration. */ - vrf?: Name; + vrf?: Name | null; }; /** @@ -572,7 +578,7 @@ export type BgpConfigResultsPage = { /** list of items on this page of results */ items: BgpConfig[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -633,17 +639,17 @@ export type BgpPeer = { /** How often to send keepalive requests (seconds). */ keepalive: number; /** Apply a local preference to routes received from this peer. */ - localPref?: number; + localPref?: number | null; /** Use the given key for TCP-MD5 authentication with the peer. */ - md5AuthKey?: string; + md5AuthKey?: string | null; /** Require messages from a peer have a minimum IP time to live field. */ - minTtl?: number; + minTtl?: number | null; /** Apply the provided multi-exit discriminator (MED) updates sent to the peer. */ - multiExitDiscriminator?: number; + multiExitDiscriminator?: number | null; /** Require that a peer has a specified ASN. */ - remoteAsn?: number; + remoteAsn?: number | null; /** Associate a VLAN ID with a peer. */ - vlanId?: number; + vlanId?: number | null; }; export type BgpPeerConfig = { peers: BgpPeer[] }; @@ -977,7 +983,7 @@ export type CertificateResultsPage = { /** list of items on this page of results */ items: Certificate[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -1385,7 +1391,7 @@ export type DatumType = | "histogram_f32" | "histogram_f64"; -export type MissingDatum = { datumType: DatumType; startTime?: Date }; +export type MissingDatum = { datumType: DatumType; startTime?: Date | null }; /** * A `Datum` is a single sampled data point from a metric. @@ -1479,13 +1485,13 @@ export type Disk = { /** unique, immutable, system-controlled identifier for each resource */ id: string; /** ID of image from which disk was created, if any */ - imageId?: string; + imageId?: string | null; /** unique, mutable, user-controlled identifier for each resource */ name: Name; projectId: string; size: ByteCount; /** ID of snapshot from which disk was created, if any */ - snapshotId?: string; + snapshotId?: string | null; state: DiskState; /** timestamp when this resource was created */ timeCreated: Date; @@ -1534,7 +1540,7 @@ export type DiskResultsPage = { /** list of items on this page of results */ items: Disk[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -1545,11 +1551,11 @@ export type DiskResultsPage = { export type Distributiondouble = { bins: number[]; counts: number[]; - max?: number; - min?: number; - p50?: Quantile; - p90?: Quantile; - p99?: Quantile; + max?: number | null; + min?: number | null; + p50?: Quantile | null; + p90?: Quantile | null; + p99?: Quantile | null; squaredMean: number; sumOfSamples: number; }; @@ -1562,11 +1568,11 @@ export type Distributiondouble = { export type Distributionint64 = { bins: number[]; counts: number[]; - max?: number; - min?: number; - p50?: Quantile; - p90?: Quantile; - p99?: Quantile; + max?: number | null; + min?: number | null; + p50?: Quantile | null; + p90?: Quantile | null; + p99?: Quantile | null; squaredMean: number; sumOfSamples: number; }; @@ -1576,7 +1582,7 @@ export type Distributionint64 = { */ export type EphemeralIpCreate = { /** Name or ID of the IP pool used to allocate an address */ - pool?: NameOrId; + pool?: NameOrId | null; }; export type ExternalIp = @@ -1588,7 +1594,7 @@ export type ExternalIp = /** unique, immutable, system-controlled identifier for each resource */ id: string; /** The ID of the instance that this Floating IP is attached to, if it is presently in use. */ - instanceId?: string; + instanceId?: string | null; /** The IP address held by this resource. */ ip: string; /** The ID of the IP pool this resource belongs to. */ @@ -1609,7 +1615,7 @@ export type ExternalIp = */ export type ExternalIpCreate = /** An IP address providing both inbound and outbound access. The address is automatically-assigned from the provided IP Pool, or the current silo's default pool if not specified. */ - | { pool?: NameOrId; type: "ephemeral" } + | { pool?: NameOrId | null; type: "ephemeral" } /** An IP address providing both inbound and outbound access. The address is an existing floating IP object assigned to the current project. The floating IP must not be in use by another instance or service. */ @@ -1622,7 +1628,7 @@ export type ExternalIpResultsPage = { /** list of items on this page of results */ items: ExternalIp[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -1679,7 +1685,7 @@ export type FieldValue = */ export type FinalizeDisk = { /** If specified a snapshot of the disk will be created with the given name during finalization. If not specified, a snapshot for the disk will _not_ be created. A snapshot can be manually created once the disk transitions into the `Detached` state. */ - snapshotName?: Name; + snapshotName?: Name | null; }; export type FleetRole = "admin" | "collaborator" | "viewer"; @@ -1719,7 +1725,7 @@ export type FloatingIp = { /** unique, immutable, system-controlled identifier for each resource */ id: string; /** The ID of the instance that this Floating IP is attached to, if it is presently in use. */ - instanceId?: string; + instanceId?: string | null; /** The IP address held by this resource. */ ip: string; /** The ID of the IP pool this resource belongs to. */ @@ -1755,10 +1761,10 @@ export type FloatingIpAttach = { export type FloatingIpCreate = { description: string; /** An IP address to reserve for use as a floating IP. This field is optional: when not set, an address will be automatically chosen from `pool`. If set, then the IP must be available in the resolved `pool`. */ - ip?: string; + ip?: string | null; name: Name; /** The parent IP pool that a floating IP is pulled from. If unset, the default pool is selected. */ - pool?: NameOrId; + pool?: NameOrId | null; }; /** @@ -1768,13 +1774,16 @@ export type FloatingIpResultsPage = { /** list of items on this page of results */ items: FloatingIp[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** * Updateable identity-related parameters */ -export type FloatingIpUpdate = { description?: string; name?: Name }; +export type FloatingIpUpdate = { + description?: string | null; + name?: Name | null; +}; /** * View of a Group @@ -1794,7 +1803,7 @@ export type GroupResultsPage = { /** list of items on this page of results */ items: Group[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -1831,7 +1840,7 @@ export type IdentityProviderResultsPage = { /** list of items on this page of results */ items: IdentityProvider[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; export type IdpMetadataSource = @@ -1849,7 +1858,7 @@ export type Image = { /** human-readable free-form text about a resource */ description: string; /** Hash of the image contents, if applicable */ - digest?: Digest; + digest?: Digest | null; /** unique, immutable, system-controlled identifier for each resource */ id: string; /** unique, mutable, user-controlled identifier for each resource */ @@ -1857,7 +1866,7 @@ export type Image = { /** The family of the operating system like Debian, Ubuntu, etc. */ os: string; /** ID of the parent project if the image is a project image */ - projectId?: string; + projectId?: string | null; /** total size in bytes */ size: ByteCount; /** timestamp when this resource was created */ @@ -1894,7 +1903,7 @@ export type ImageResultsPage = { /** list of items on this page of results */ items: Image[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -1927,15 +1936,15 @@ export type Instance = { /** The time at which the auto-restart cooldown period for this instance completes, permitting it to be automatically restarted again. If the instance enters the `Failed` state, it will not be restarted until after this time. If this is not present, then either the instance has never been automatically restarted, or the cooldown period has already expired, allowing the instance to be restarted immediately if it fails. */ - autoRestartCooldownExpiration?: Date; + autoRestartCooldownExpiration?: Date | null; /** `true` if this instance's auto-restart policy will permit the control plane to automatically restart it if it enters the `Failed` state. */ autoRestartEnabled: boolean; /** The auto-restart policy configured for this instance, or `null` if no explicit policy has been configured. This policy determines whether the instance should be automatically restarted by the control plane on failure. If this is `null`, the control plane will use the default policy when determining whether or not to automatically restart this instance, which may or may not allow it to be restarted. The value of the `auto_restart_enabled` field indicates whether the instance will be auto-restarted, based on its current policy or the default if it has no configured policy. */ - autoRestartPolicy?: InstanceAutoRestartPolicy; + autoRestartPolicy?: InstanceAutoRestartPolicy | null; /** the ID of the disk used to boot this Instance, if a specific one is assigned. */ - bootDiskId?: string; + bootDiskId?: string | null; /** human-readable free-form text about a resource */ description: string; /** RFC1035-compliant hostname for the Instance. */ @@ -1956,7 +1965,7 @@ This policy determines whether the instance should be automatically restarted by /** The timestamp of the most recent time this instance was automatically restarted by the control plane. If this is not present, then this instance has not been automatically restarted. */ - timeLastAutoRestarted?: Date; + timeLastAutoRestarted?: Date | null; /** timestamp when this resource was last modified */ timeModified: Date; timeRunStateUpdated: Date; @@ -1989,7 +1998,7 @@ export type InstanceDiskAttachment = export type InstanceNetworkInterfaceCreate = { description: string; /** The IP address for the interface. One will be auto-assigned if not provided. */ - ip?: string; + ip?: string | null; name: Name; /** The VPC Subnet in which to create the interface. */ subnetName: Name; @@ -2021,13 +2030,13 @@ export type InstanceCreate = { This policy determines whether the instance should be automatically restarted by the control plane on failure. If this is `null`, no auto-restart policy will be explicitly configured for this instance, and the control plane will select the default policy when determining whether the instance can be automatically restarted. Currently, the global default auto-restart policy is "best-effort", so instances with `null` auto-restart policies will be automatically restarted. However, in the future, the default policy may be configurable through other mechanisms, such as on a per-project basis. In that case, any configured default policy will be used if this is `null`. */ - autoRestartPolicy?: InstanceAutoRestartPolicy; + autoRestartPolicy?: InstanceAutoRestartPolicy | null; /** The disk this instance should boot into. This disk can either be attached if it already exists, or created, if it should be a new disk. It is strongly recommended to either provide a boot disk at instance creation, or update the instance after creation to set a boot disk. An instance without an explicit boot disk can be booted: the options are as managed by UEFI, and as controlled by the guest OS, but with some risk. If this instance later has a disk attached or detached, it is possible that boot options can end up reordered, with the intended boot disk moved after the EFI shell in boot priority. This may result in an instance that only boots to the EFI shell until the desired disk is set as an explicit boot disk and the instance rebooted. */ - bootDisk?: InstanceDiskAttachment; + bootDisk?: InstanceDiskAttachment | null; description: string; /** The disks to be created or attached for this instance. */ disks?: InstanceDiskAttachment[]; @@ -2047,7 +2056,7 @@ By default, all instances have outbound connectivity, but no inbound connectivit /** An allowlist of SSH public keys to be transferred to the instance via cloud-init during instance creation. If not provided, all SSH public keys from the user's profile will be sent. If an empty list is provided, no public keys will be transmitted to the instance. */ - sshPublicKeys?: NameOrId[]; + sshPublicKeys?: NameOrId[] | null; /** Should this instance be started upon creation; true by default. */ start?: boolean; /** User data for instance initialization systems (such as cloud-init). Must be a Base64-encoded string, as specified in RFC 4648 § 4 (+ and / characters with padding). Maximum 32 KiB unencoded data. */ @@ -2098,7 +2107,7 @@ export type InstanceNetworkInterfaceResultsPage = { /** list of items on this page of results */ items: InstanceNetworkInterface[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2107,8 +2116,8 @@ export type InstanceNetworkInterfaceResultsPage = { * Note that modifying IP addresses for an interface is not yet supported, a new interface must be created instead. */ export type InstanceNetworkInterfaceUpdate = { - description?: string; - name?: Name; + description?: string | null; + name?: Name | null; /** Make a secondary interface the instance's primary interface. If applied to a secondary interface, that interface will become the primary on the next reboot of the instance. Note that this may have implications for routing between instances, as the new primary interface will be on a distinct subnet from the previous primary interface. @@ -2126,7 +2135,7 @@ export type InstanceResultsPage = { /** list of items on this page of results */ items: Instance[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2148,11 +2157,11 @@ export type InstanceUpdate = { This policy determines whether the instance should be automatically restarted by the control plane on failure. If this is `null`, any explicitly configured auto-restart policy will be unset, and the control plane will select the default policy when determining whether the instance can be automatically restarted. Currently, the global default auto-restart policy is "best-effort", so instances with `null` auto-restart policies will be automatically restarted. However, in the future, the default policy may be configurable through other mechanisms, such as on a per-project basis. In that case, any configured default policy will be used if this is `null`. */ - autoRestartPolicy?: InstanceAutoRestartPolicy; + autoRestartPolicy?: InstanceAutoRestartPolicy | null; /** Name or ID of the disk the instance should be instructed to boot from. If not provided, unset the instance's boot disk. */ - bootDisk?: NameOrId; + bootDisk?: NameOrId | null; /** The amount of memory to assign to this instance. */ memory: ByteCount; /** The number of CPUs to assign to this instance. */ @@ -2218,7 +2227,7 @@ export type InternetGatewayIpAddressResultsPage = { /** list of items on this page of results */ items: InternetGatewayIpAddress[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2257,7 +2266,7 @@ export type InternetGatewayIpPoolResultsPage = { /** list of items on this page of results */ items: InternetGatewayIpPool[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2267,7 +2276,7 @@ export type InternetGatewayResultsPage = { /** list of items on this page of results */ items: InternetGateway[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2327,7 +2336,7 @@ export type IpPoolRangeResultsPage = { /** list of items on this page of results */ items: IpPoolRange[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2337,7 +2346,7 @@ export type IpPoolResultsPage = { /** list of items on this page of results */ items: IpPool[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2357,7 +2366,7 @@ export type IpPoolSiloLinkResultsPage = { /** list of items on this page of results */ items: IpPoolSiloLink[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; export type IpPoolSiloUpdate = { @@ -2368,7 +2377,7 @@ export type IpPoolSiloUpdate = { /** * Parameters for updating an IP Pool */ -export type IpPoolUpdate = { description?: string; name?: Name }; +export type IpPoolUpdate = { description?: string | null; name?: Name | null }; export type Ipv4Utilization = { /** The number of IPv4 addresses allocated from this pool */ @@ -2416,19 +2425,19 @@ export type LinkFec = */ export type LldpLinkConfigCreate = { /** The LLDP chassis identifier TLV. */ - chassisId?: string; + chassisId?: string | null; /** Whether or not LLDP is enabled. */ enabled: boolean; /** The LLDP link description TLV. */ - linkDescription?: string; + linkDescription?: string | null; /** The LLDP link name TLV. */ - linkName?: string; + linkName?: string | null; /** The LLDP management IP TLV. */ - managementIp?: string; + managementIp?: string | null; /** The LLDP system description TLV. */ - systemDescription?: string; + systemDescription?: string | null; /** The LLDP system name TLV. */ - systemName?: string; + systemName?: string | null; }; /** @@ -2467,15 +2476,15 @@ export type LinkSpeed = */ export type TxEqConfig = { /** Main tap */ - main?: number; + main?: number | null; /** Post-cursor tap1 */ - post1?: number; + post1?: number | null; /** Post-cursor tap2 */ - post2?: number; + post2?: number | null; /** Pre-cursor tap1 */ - pre1?: number; + pre1?: number | null; /** Pre-cursor tap2 */ - pre2?: number; + pre2?: number | null; }; /** @@ -2485,7 +2494,7 @@ export type LinkConfigCreate = { /** Whether or not to set autonegotiation */ autoneg: boolean; /** The requested forward-error correction method. If this is not specified, the standard FEC for the underlying media will be applied if it can be determined. */ - fec?: LinkFec; + fec?: LinkFec | null; /** The link-layer discovery protocol (LLDP) configuration for the link. */ lldp: LldpLinkConfigCreate; /** Maximum transmission unit for the link. */ @@ -2493,7 +2502,7 @@ export type LinkConfigCreate = { /** The speed of the link. */ speed: LinkSpeed; /** Optional tx_eq settings */ - txEq?: TxEqConfig; + txEq?: TxEqConfig | null; }; /** @@ -2501,21 +2510,21 @@ export type LinkConfigCreate = { */ export type LldpLinkConfig = { /** The LLDP chassis identifier TLV. */ - chassisId?: string; + chassisId?: string | null; /** Whether or not the LLDP service is enabled. */ enabled: boolean; /** The id of this LLDP service instance. */ id: string; /** The LLDP link description TLV. */ - linkDescription?: string; + linkDescription?: string | null; /** The LLDP link name TLV. */ - linkName?: string; + linkName?: string | null; /** The LLDP management IP TLV. */ - managementIp?: IpNet; + managementIp?: IpNet | null; /** The LLDP system description TLV. */ - systemDescription?: string; + systemDescription?: string | null; /** The LLDP system name TLV. */ - systemName?: string; + systemName?: string | null; }; /** @@ -2529,7 +2538,7 @@ export type LldpNeighbor = { /** Most recent sighting of this LldpNeighbor */ lastSeen: Date; /** The LLDP link description advertised by the neighbor */ - linkDescription?: string; + linkDescription?: string | null; /** The LLDP link name advertised by the neighbor */ linkName: string; /** The port on which the neighbor was seen */ @@ -2537,9 +2546,9 @@ export type LldpNeighbor = { /** The LLDP management IP(s) advertised by the neighbor */ managementIp: IpNet[]; /** The LLDP system description advertised by the neighbor */ - systemDescription?: string; + systemDescription?: string | null; /** The LLDP system name advertised by the neighbor */ - systemName?: string; + systemName?: string | null; }; /** @@ -2549,7 +2558,7 @@ export type LldpNeighborResultsPage = { /** list of items on this page of results */ items: LldpNeighbor[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2593,7 +2602,7 @@ export type LoopbackAddressResultsPage = { /** list of items on this page of results */ items: LoopbackAddress[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2608,7 +2617,7 @@ export type MeasurementResultsPage = { /** list of items on this page of results */ items: Measurement[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2662,12 +2671,12 @@ export type NetworkInterface = { * Each element is an option, where `None` represents a missing sample. */ export type ValueArray = - | { type: "integer"; values: number[] } - | { type: "double"; values: number[] } - | { type: "boolean"; values: boolean[] } - | { type: "string"; values: string[] } - | { type: "integer_distribution"; values: Distributionint64[] } - | { type: "double_distribution"; values: Distributiondouble[] }; + | { type: "integer"; values: (number | null)[] } + | { type: "double"; values: (number | null)[] } + | { type: "boolean"; values: (boolean | null)[] } + | { type: "string"; values: (string | null)[] } + | { type: "integer_distribution"; values: (Distributionint64 | null)[] } + | { type: "double_distribution"; values: (Distributiondouble | null)[] }; /** * A single list of values, for one dimension of a timeseries. @@ -2683,7 +2692,7 @@ export type Values = { * Timepoints and values for one timeseries. */ export type Points = { - startTimes?: Date[]; + startTimes?: Date[] | null; timestamps: Date[]; values: Values[]; }; @@ -2761,7 +2770,7 @@ export type PhysicalDisk = { policy: PhysicalDiskPolicy; serial: string; /** The sled to which this disk is attached, if any. */ - sledId?: string; + sledId?: string | null; /** The current state Nexus believes the disk to be in. */ state: PhysicalDiskState; /** timestamp when this resource was created */ @@ -2778,7 +2787,7 @@ export type PhysicalDiskResultsPage = { /** list of items on this page of results */ items: PhysicalDisk[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; export type PingStatus = "ok"; @@ -2810,7 +2819,7 @@ export type Probe = { */ export type ProbeCreate = { description: string; - ipPool?: NameOrId; + ipPool?: NameOrId | null; name: Name; sled: string; }; @@ -2839,7 +2848,7 @@ export type ProbeInfoResultsPage = { /** list of items on this page of results */ items: ProbeInfo[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2870,7 +2879,7 @@ export type ProjectResultsPage = { /** list of items on this page of results */ items: Project[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; export type ProjectRole = "admin" | "collaborator" | "viewer"; @@ -2899,7 +2908,7 @@ export type ProjectRolePolicy = { /** * Updateable properties of a `Project` */ -export type ProjectUpdate = { description?: string; name?: Name }; +export type ProjectUpdate = { description?: string | null; name?: Name | null }; /** * View of an Rack @@ -2920,7 +2929,7 @@ export type RackResultsPage = { /** list of items on this page of results */ items: Rack[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2942,7 +2951,7 @@ export type RoleResultsPage = { /** list of items on this page of results */ items: Role[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -2954,9 +2963,9 @@ export type Route = { /** The route gateway. */ gw: string; /** Local preference for route. Higher preference indictes precedence within and across protocols. */ - ribPriority?: number; + ribPriority?: number | null; /** VLAN id the gateway is reachable over. */ - vid?: number; + vid?: number | null; }; /** @@ -3068,17 +3077,17 @@ export type RouterRouteResultsPage = { /** list of items on this page of results */ items: RouterRoute[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** * Updateable properties of a `RouterRoute` */ export type RouterRouteUpdate = { - description?: string; + description?: string | null; /** Selects which traffic this routing rule will apply to. */ destination: RouteDestination; - name?: Name; + name?: Name | null; /** The location that matched packets should be forwarded to. */ target: RouteTarget; }; @@ -3092,7 +3101,7 @@ export type SamlIdentityProvider = { /** human-readable free-form text about a resource */ description: string; /** If set, attributes with this name will be considered to denote a user's group membership, where the values will be the group names. */ - groupAttributeName?: string; + groupAttributeName?: string | null; /** unique, immutable, system-controlled identifier for each resource */ id: string; /** IdP's entity id */ @@ -3100,7 +3109,7 @@ export type SamlIdentityProvider = { /** unique, mutable, user-controlled identifier for each resource */ name: Name; /** Optional request signing public certificate (base64 encoded der file) */ - publicCert?: string; + publicCert?: string | null; /** Service provider endpoint where the idp should send log out requests */ sloUrl: string; /** SP's client id */ @@ -3121,14 +3130,14 @@ export type SamlIdentityProviderCreate = { acsUrl: string; description: string; /** If set, SAML attributes with this name will be considered to denote a user's group membership, where the attribute value(s) should be a comma-separated list of group names. */ - groupAttributeName?: string; + groupAttributeName?: string | null; /** idp's entity id */ idpEntityId: string; /** the source of an identity provider metadata descriptor */ idpMetadataSource: IdpMetadataSource; name: Name; /** request signing key pair */ - signingKeypair?: DerEncodedKeyPair; + signingKeypair?: DerEncodedKeyPair | null; /** service provider endpoint where the idp should send log out requests */ sloUrl: string; /** sp's client id */ @@ -3200,7 +3209,7 @@ export type SiloCreate = { /** If set, this group will be created during Silo creation and granted the "Silo Admin" role. Identity providers can assert that users belong to this group and those users can log in and further initialize the Silo. Note that if configuring a SAML based identity provider, group_attribute_name must be set for users to be considered part of a group. See `SamlIdentityProviderCreate` for more information. */ - adminGroupName?: string; + adminGroupName?: string | null; description: string; discoverable: boolean; identityMode: SiloIdentityMode; @@ -3240,7 +3249,7 @@ export type SiloIpPoolResultsPage = { /** list of items on this page of results */ items: SiloIpPool[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -3263,7 +3272,7 @@ export type SiloQuotasResultsPage = { /** list of items on this page of results */ items: SiloQuotas[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -3271,11 +3280,11 @@ export type SiloQuotasResultsPage = { */ export type SiloQuotasUpdate = { /** The amount of virtual CPUs available for running instances in the Silo */ - cpus?: number; + cpus?: number | null; /** The amount of RAM (in bytes) available for running instances in the Silo */ - memory?: ByteCount; + memory?: ByteCount | null; /** The amount of storage (in bytes) available for disks or snapshots */ - storage?: ByteCount; + storage?: ByteCount | null; }; /** @@ -3285,7 +3294,7 @@ export type SiloResultsPage = { /** list of items on this page of results */ items: Silo[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; export type SiloRole = "admin" | "collaborator" | "viewer"; @@ -3342,7 +3351,7 @@ export type SiloUtilizationResultsPage = { /** list of items on this page of results */ items: SiloUtilization[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -3422,7 +3431,7 @@ export type SledInstance = { /** unique, immutable, system-controlled identifier for each resource */ id: string; memory: number; - migrationId?: string; + migrationId?: string | null; name: Name; ncpus: number; projectName: Name; @@ -3441,7 +3450,7 @@ export type SledInstanceResultsPage = { /** list of items on this page of results */ items: SledInstance[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -3469,7 +3478,7 @@ export type SledResultsPage = { /** list of items on this page of results */ items: Sled[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; export type SnapshotState = "creating" | "ready" | "faulted" | "destroyed"; @@ -3511,7 +3520,7 @@ export type SnapshotResultsPage = { /** list of items on this page of results */ items: Snapshot[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -3551,7 +3560,7 @@ export type SshKeyResultsPage = { /** list of items on this page of results */ items: SshKey[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; export type TypedUuidForSupportBundleKind = string; @@ -3580,7 +3589,7 @@ The record of the bundle still exists for readability, but the only valid operat export type SupportBundleInfo = { id: TypedUuidForSupportBundleKind; reasonForCreation: string; - reasonForFailure?: string; + reasonForFailure?: string | null; state: SupportBundleState; timeCreated: Date; }; @@ -3592,7 +3601,7 @@ export type SupportBundleInfoResultsPage = { /** list of items on this page of results */ items: SupportBundleInfo[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -3675,7 +3684,7 @@ export type SwitchPort = { /** The name of this switch port. */ portName: string; /** The primary settings group of this switch port. Will be `None` until this switch port is configured. */ - portSettingsId?: string; + portSettingsId?: string | null; /** The rack this switch port belongs to. */ rackId: string; /** The switch location of this switch port. */ @@ -3695,7 +3704,7 @@ export type SwitchPortAddressConfig = { /** The port settings object this address configuration belongs to. */ portSettingsId: string; /** An optional VLAN ID */ - vlanId?: number; + vlanId?: number | null; }; /** @@ -3757,11 +3766,11 @@ export type SwitchPortLinkConfig = { /** Whether or not the link has autonegotiation enabled. */ autoneg: boolean; /** The requested forward-error correction method. If this is not specified, the standard FEC for the underlying media will be applied if it can be determined. */ - fec?: LinkFec; + fec?: LinkFec | null; /** The name of this link. */ linkName: string; /** The link-layer discovery protocol service configuration id for this link. */ - lldpLinkConfigId?: string; + lldpLinkConfigId?: string | null; /** The maximum transmission unit for this link. */ mtu: number; /** The port settings this link configuration belongs to. */ @@ -3769,7 +3778,7 @@ export type SwitchPortLinkConfig = { /** The configured speed of the link. */ speed: LinkSpeed; /** The tx_eq configuration id for this link. */ - txEqConfigId?: string; + txEqConfigId?: string | null; }; /** @@ -3779,7 +3788,7 @@ export type SwitchPortResultsPage = { /** list of items on this page of results */ items: SwitchPort[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -3795,9 +3804,9 @@ export type SwitchPortRouteConfig = { /** The port settings object this route configuration belongs to. */ portSettingsId: string; /** RIB Priority indicating priority within and across protocols. */ - ribPriority?: number; + ribPriority?: number | null; /** The VLAN identifier for the route. Use this if the gateway is reachable over an 802.1Q tagged L2 segment. */ - vlanId?: number; + vlanId?: number | null; }; /** @@ -3853,7 +3862,7 @@ export type SwitchPortSettingsResultsPage = { /** list of items on this page of results */ items: SwitchPortSettings[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -3889,7 +3898,7 @@ export type SwitchPortSettingsView = { /** The primary switch port settings handle. */ settings: SwitchPortSettings; /** TX equalization settings. These are optional, and most links will not need them. */ - txEq: TxEqConfig[]; + txEq: (TxEqConfig | null)[]; /** Vlan interface settings. */ vlanInterfaces: SwitchVlanInterfaceConfig[]; }; @@ -3901,7 +3910,7 @@ export type SwitchResultsPage = { /** list of items on this page of results */ items: Switch[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -3987,7 +3996,7 @@ export type TimeseriesSchemaResultsPage = { /** list of items on this page of results */ items: TimeseriesSchema[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -4011,7 +4020,7 @@ export type UninitializedSledResultsPage = { /** list of items on this page of results */ items: UninitializedSled[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -4050,7 +4059,7 @@ export type UserBuiltinResultsPage = { /** list of items on this page of results */ items: UserBuiltin[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -4086,7 +4095,7 @@ export type UserResultsPage = { /** list of items on this page of results */ items: User[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -4140,7 +4149,7 @@ export type VpcCreate = { /** The IPv6 prefix for this VPC All IPv6 subnets created from this VPC must be taken from this range, which should be a Unique Local Address in the range `fd00::/48`. The default VPC Subnet will have the first `/64` range from this prefix. */ - ipv6Prefix?: Ipv6Net; + ipv6Prefix?: Ipv6Net | null; name: Name; }; @@ -4173,11 +4182,11 @@ export type VpcFirewallRuleProtocol = "TCP" | "UDP" | "ICMP"; */ export type VpcFirewallRuleFilter = { /** If present, host filters match the "other end" of traffic from the target’s perspective: for an inbound rule, they match the source of traffic. For an outbound rule, they match the destination. */ - hosts?: VpcFirewallRuleHostFilter[]; + hosts?: VpcFirewallRuleHostFilter[] | null; /** If present, the destination ports or port ranges this rule applies to. */ - ports?: L4PortRange[]; + ports?: L4PortRange[] | null; /** If present, the networking protocols this rule applies to. */ - protocols?: VpcFirewallRuleProtocol[]; + protocols?: VpcFirewallRuleProtocol[] | null; }; export type VpcFirewallRuleStatus = "disabled" | "enabled"; @@ -4266,7 +4275,7 @@ export type VpcResultsPage = { /** list of items on this page of results */ items: Vpc[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; export type VpcRouterKind = "system" | "custom"; @@ -4302,20 +4311,23 @@ export type VpcRouterResultsPage = { /** list of items on this page of results */ items: VpcRouter[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** * Updateable properties of a `VpcRouter` */ -export type VpcRouterUpdate = { description?: string; name?: Name }; +export type VpcRouterUpdate = { + description?: string | null; + name?: Name | null; +}; /** * A VPC subnet represents a logical grouping for instances that allows network traffic between them, within a IPv4 subnetwork or optionally an IPv6 subnetwork. */ export type VpcSubnet = { /** ID for an attached custom router. */ - customRouterId?: string; + customRouterId?: string | null; /** human-readable free-form text about a resource */ description: string; /** unique, immutable, system-controlled identifier for each resource */ @@ -4341,7 +4353,7 @@ export type VpcSubnetCreate = { /** An optional router, used to direct packets sent from hosts in this subnet to any destination address. Custom routers apply in addition to the VPC-wide *system* router, and have higher priority than the system router for an otherwise equal-prefix-length match. */ - customRouter?: NameOrId; + customRouter?: NameOrId | null; description: string; /** The IPv4 address range for this subnet. @@ -4350,7 +4362,7 @@ It must be allocated from an RFC 1918 private address range, and must not overla /** The IPv6 address range for this subnet. It must be allocated from the RFC 4193 Unique Local Address range, with the prefix equal to the parent VPC's prefix. A random `/64` block will be assigned if one is not provided. It must not overlap with any existing subnet in the VPC. */ - ipv6Block?: Ipv6Net; + ipv6Block?: Ipv6Net | null; name: Name; }; @@ -4361,7 +4373,7 @@ export type VpcSubnetResultsPage = { /** list of items on this page of results */ items: VpcSubnet[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; }; /** @@ -4369,15 +4381,19 @@ export type VpcSubnetResultsPage = { */ export type VpcSubnetUpdate = { /** An optional router, used to direct packets sent from hosts in this subnet to any destination address. */ - customRouter?: NameOrId; - description?: string; - name?: Name; + customRouter?: NameOrId | null; + description?: string | null; + name?: Name | null; }; /** * Updateable properties of a `Vpc` */ -export type VpcUpdate = { description?: string; dnsName?: Name; name?: Name }; +export type VpcUpdate = { + description?: string | null; + dnsName?: Name | null; + name?: Name | null; +}; /** * Supported set of sort modes for scanning by name or id @@ -4425,8 +4441,8 @@ export type SystemMetricName = export type NameSortMode = "name_ascending"; export interface ProbeListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4452,8 +4468,8 @@ export interface ProbeDeleteQueryParams { } export interface SupportBundleListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } @@ -4493,8 +4509,8 @@ export interface LoginSamlPathParams { } export interface AffinityGroupListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4532,8 +4548,8 @@ export interface AffinityGroupMemberListPathParams { } export interface AffinityGroupMemberListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4566,8 +4582,8 @@ export interface AffinityGroupMemberInstanceDeleteQueryParams { } export interface AntiAffinityGroupListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4605,8 +4621,8 @@ export interface AntiAffinityGroupMemberListPathParams { } export interface AntiAffinityGroupMemberListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4639,8 +4655,8 @@ export interface AntiAffinityGroupMemberInstanceDeleteQueryParams { } export interface CertificateListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: NameOrIdSortMode; } @@ -4653,8 +4669,8 @@ export interface CertificateDeletePathParams { } export interface DiskListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4718,16 +4734,16 @@ export interface DiskMetricsListPathParams { export interface DiskMetricsListQueryParams { endTime?: Date; - limit?: number; + limit?: number | null; order?: PaginationOrder; - pageToken?: string; + pageToken?: string | null; startTime?: Date; project?: NameOrId; } export interface FloatingIpListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4777,8 +4793,8 @@ export interface FloatingIpDetachQueryParams { } export interface GroupListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } @@ -4787,8 +4803,8 @@ export interface GroupViewPathParams { } export interface ImageListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4830,8 +4846,8 @@ export interface ImagePromoteQueryParams { } export interface InstanceListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4869,8 +4885,8 @@ export interface InstanceAffinityGroupListPathParams { } export interface InstanceAffinityGroupListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4880,8 +4896,8 @@ export interface InstanceAntiAffinityGroupListPathParams { } export interface InstanceAntiAffinityGroupListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4891,8 +4907,8 @@ export interface InstanceDiskListPathParams { } export interface InstanceDiskListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4950,9 +4966,9 @@ export interface InstanceSerialConsolePathParams { } export interface InstanceSerialConsoleQueryParams { - fromStart?: number; - maxBytes?: number; - mostRecent?: number; + fromStart?: number | null; + maxBytes?: number | null; + mostRecent?: number | null; project?: NameOrId; } @@ -4961,7 +4977,7 @@ export interface InstanceSerialConsoleStreamPathParams { } export interface InstanceSerialConsoleStreamQueryParams { - mostRecent?: number; + mostRecent?: number | null; project?: NameOrId; } @@ -4970,8 +4986,8 @@ export interface InstanceSshPublicKeyListPathParams { } export interface InstanceSshPublicKeyListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -4994,8 +5010,8 @@ export interface InstanceStopQueryParams { export interface InternetGatewayIpAddressListQueryParams { gateway?: NameOrId; - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; vpc?: NameOrId; @@ -5020,8 +5036,8 @@ export interface InternetGatewayIpAddressDeleteQueryParams { export interface InternetGatewayIpPoolListQueryParams { gateway?: NameOrId; - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; vpc?: NameOrId; @@ -5045,8 +5061,8 @@ export interface InternetGatewayIpPoolDeleteQueryParams { } export interface InternetGatewayListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; vpc?: NameOrId; @@ -5077,8 +5093,8 @@ export interface InternetGatewayDeleteQueryParams { } export interface ProjectIpPoolListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: NameOrIdSortMode; } @@ -5091,14 +5107,14 @@ export interface LoginLocalPathParams { } export interface CurrentUserGroupsQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } export interface CurrentUserSshKeyListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: NameOrIdSortMode; } @@ -5116,17 +5132,17 @@ export interface SiloMetricPathParams { export interface SiloMetricQueryParams { endTime?: Date; - limit?: number; + limit?: number | null; order?: PaginationOrder; - pageToken?: string; + pageToken?: string | null; startTime?: Date; project?: NameOrId; } export interface InstanceNetworkInterfaceListQueryParams { instance?: NameOrId; - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -5164,8 +5180,8 @@ export interface InstanceNetworkInterfaceDeleteQueryParams { } export interface ProjectListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: NameOrIdSortMode; } @@ -5190,8 +5206,8 @@ export interface ProjectPolicyUpdatePathParams { } export interface SnapshotListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -5217,8 +5233,8 @@ export interface SnapshotDeleteQueryParams { } export interface PhysicalDiskListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } @@ -5233,14 +5249,14 @@ export interface NetworkingSwitchPortLldpNeighborsPathParams { } export interface NetworkingSwitchPortLldpNeighborsQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } export interface RackListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } @@ -5249,8 +5265,8 @@ export interface RackViewPathParams { } export interface SledListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } @@ -5263,8 +5279,8 @@ export interface SledPhysicalDiskListPathParams { } export interface SledPhysicalDiskListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } @@ -5273,8 +5289,8 @@ export interface SledInstanceListPathParams { } export interface SledInstanceListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } @@ -5283,15 +5299,15 @@ export interface SledSetProvisionPolicyPathParams { } export interface SledListUninitializedQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; } export interface NetworkingSwitchPortListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; - switchPortId?: string; + switchPortId?: string | null; } export interface NetworkingSwitchPortLldpConfigViewPathParams { @@ -5340,8 +5356,8 @@ export interface NetworkingSwitchPortStatusQueryParams { } export interface SwitchListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } @@ -5350,8 +5366,8 @@ export interface SwitchViewPathParams { } export interface SiloIdentityProviderListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; silo?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -5389,8 +5405,8 @@ export interface SamlIdentityProviderViewQueryParams { } export interface IpPoolListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: NameOrIdSortMode; } @@ -5411,8 +5427,8 @@ export interface IpPoolRangeListPathParams { } export interface IpPoolRangeListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; } export interface IpPoolRangeAddPathParams { @@ -5428,8 +5444,8 @@ export interface IpPoolSiloListPathParams { } export interface IpPoolSiloListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } @@ -5452,8 +5468,8 @@ export interface IpPoolUtilizationViewPathParams { } export interface IpPoolServiceRangeListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; } export interface SystemMetricPathParams { @@ -5462,16 +5478,16 @@ export interface SystemMetricPathParams { export interface SystemMetricQueryParams { endTime?: Date; - limit?: number; + limit?: number | null; order?: PaginationOrder; - pageToken?: string; + pageToken?: string | null; startTime?: Date; silo?: NameOrId; } export interface NetworkingAddressLotListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: NameOrIdSortMode; } @@ -5484,14 +5500,14 @@ export interface NetworkingAddressLotBlockListPathParams { } export interface NetworkingAddressLotBlockListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } export interface NetworkingBgpConfigListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: NameOrIdSortMode; } @@ -5500,8 +5516,8 @@ export interface NetworkingBgpConfigDeleteQueryParams { } export interface NetworkingBgpAnnounceSetListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: NameOrIdSortMode; } @@ -5522,8 +5538,8 @@ export interface NetworkingBgpImportedRoutesIpv4QueryParams { } export interface NetworkingLoopbackAddressListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } @@ -5535,8 +5551,8 @@ export interface NetworkingLoopbackAddressDeletePathParams { } export interface NetworkingSwitchPortSettingsListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; portSettings?: NameOrId; sortBy?: NameOrIdSortMode; } @@ -5550,8 +5566,8 @@ export interface NetworkingSwitchPortSettingsViewPathParams { } export interface RoleListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; } export interface RoleViewPathParams { @@ -5559,14 +5575,14 @@ export interface RoleViewPathParams { } export interface SystemQuotasListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } export interface SiloListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: NameOrIdSortMode; } @@ -5583,8 +5599,8 @@ export interface SiloIpPoolListPathParams { } export interface SiloIpPoolListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: NameOrIdSortMode; } @@ -5605,13 +5621,13 @@ export interface SiloQuotasUpdatePathParams { } export interface SystemTimeseriesSchemaListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; } export interface SiloUserListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; silo?: NameOrId; sortBy?: IdSortMode; } @@ -5625,8 +5641,8 @@ export interface SiloUserViewQueryParams { } export interface UserBuiltinListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: NameSortMode; } @@ -5635,8 +5651,8 @@ export interface UserBuiltinViewPathParams { } export interface SiloUtilizationListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; sortBy?: NameOrIdSortMode; } @@ -5649,9 +5665,9 @@ export interface TimeseriesQueryQueryParams { } export interface UserListQueryParams { - group?: string; - limit?: number; - pageToken?: string; + group?: string | null; + limit?: number | null; + pageToken?: string | null; sortBy?: IdSortMode; } @@ -5666,8 +5682,8 @@ export interface VpcFirewallRulesUpdateQueryParams { } export interface VpcRouterRouteListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; router?: NameOrId; sortBy?: NameOrIdSortMode; @@ -5711,8 +5727,8 @@ export interface VpcRouterRouteDeleteQueryParams { } export interface VpcRouterListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; vpc?: NameOrId; @@ -5751,8 +5767,8 @@ export interface VpcRouterDeleteQueryParams { } export interface VpcSubnetListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; vpc?: NameOrId; @@ -5795,16 +5811,16 @@ export interface VpcSubnetListNetworkInterfacesPathParams { } export interface VpcSubnetListNetworkInterfacesQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; vpc?: NameOrId; } export interface VpcListQueryParams { - limit?: number; - pageToken?: string; + limit?: number | null; + pageToken?: string | null; project?: NameOrId; sortBy?: NameOrIdSortMode; } diff --git a/oxide-openapi-gen-ts/package-lock.json b/oxide-openapi-gen-ts/package-lock.json index 1e30d32..a909c9b 100644 --- a/oxide-openapi-gen-ts/package-lock.json +++ b/oxide-openapi-gen-ts/package-lock.json @@ -1,12 +1,12 @@ { "name": "@oxide/openapi-gen-ts", - "version": "0.6.2", + "version": "0.7.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@oxide/openapi-gen-ts", - "version": "0.6.2", + "version": "0.7.0", "license": "MPL-2.0", "dependencies": { "minimist": "^1.2.8", diff --git a/oxide-openapi-gen-ts/package.json b/oxide-openapi-gen-ts/package.json index 358fc65..3212200 100644 --- a/oxide-openapi-gen-ts/package.json +++ b/oxide-openapi-gen-ts/package.json @@ -1,6 +1,6 @@ { "name": "@oxide/openapi-gen-ts", - "version": "0.6.2", + "version": "0.7.0", "description": "OpenAPI client generator used to generate Oxide TypeScript SDK", "keywords": [ "oxide", diff --git a/oxide-openapi-gen-ts/src/schema/types.test.ts b/oxide-openapi-gen-ts/src/schema/types.test.ts index 0fdf173..b14e538 100644 --- a/oxide-openapi-gen-ts/src/schema/types.test.ts +++ b/oxide-openapi-gen-ts/src/schema/types.test.ts @@ -42,13 +42,13 @@ test("Disk", () => { /** unique, immutable, system-controlled identifier for each resource */ id: string; /** ID of image from which disk was created, if any */ - imageId?: string; + imageId?: string | null; /** unique, mutable, user-controlled identifier for each resource */ name: Name; projectId: string; size: ByteCount; /** ID of snapshot from which disk was created, if any */ - snapshotId?: string; + snapshotId?: string | null; state: DiskState; /** timestamp when this resource was created */ timeCreated: Date; @@ -64,15 +64,15 @@ test("Instance", () => { /** The time at which the auto-restart cooldown period for this instance completes, permitting it to be automatically restarted again. If the instance enters the \`Failed\` state, it will not be restarted until after this time. If this is not present, then either the instance has never been automatically restarted, or the cooldown period has already expired, allowing the instance to be restarted immediately if it fails. */ - autoRestartCooldownExpiration?: Date; + autoRestartCooldownExpiration?: Date | null; /** \`true\` if this instance's auto-restart policy will permit the control plane to automatically restart it if it enters the \`Failed\` state. */ autoRestartEnabled: boolean; /** The auto-restart policy configured for this instance, or \`null\` if no explicit policy has been configured. This policy determines whether the instance should be automatically restarted by the control plane on failure. If this is \`null\`, the control plane will use the default policy when determining whether or not to automatically restart this instance, which may or may not allow it to be restarted. The value of the \`auto_restart_enabled\` field indicates whether the instance will be auto-restarted, based on its current policy or the default if it has no configured policy. */ - autoRestartPolicy?: InstanceAutoRestartPolicy; + autoRestartPolicy?: InstanceAutoRestartPolicy | null; /** the ID of the disk used to boot this Instance, if a specific one is assigned. */ - bootDiskId?: string; + bootDiskId?: string | null; /** human-readable free-form text about a resource */ description: string; /** RFC1035-compliant hostname for the Instance. */ @@ -93,7 +93,7 @@ test("Instance", () => { /** The timestamp of the most recent time this instance was automatically restarted by the control plane. If this is not present, then this instance has not been automatically restarted. */ - timeLastAutoRestarted?: Date; + timeLastAutoRestarted?: Date | null; /** timestamp when this resource was last modified */ timeModified: Date; timeRunStateUpdated: Date; @@ -109,7 +109,7 @@ test("number", () => { format: "uint32", minimum: 1, }) - ).toMatchInlineSnapshot(`"type X = number;"`); + ).toMatchInlineSnapshot(`"type X = number | null;"`); }); test("string", () => { @@ -118,7 +118,7 @@ test("string", () => { nullable: true, type: "string", }) - ).toMatchInlineSnapshot(`"type X = string;"`); + ).toMatchInlineSnapshot(`"type X = string | null;"`); }); test("oneOf to string union (AddressLotKind)", () => { @@ -138,14 +138,14 @@ test("ResultsPage array (InternetGatewayResultsPage)", () => { /** list of items on this page of results */ items: InternetGateway[]; /** token used to fetch the next page of results (if any) */ - nextPage?: string; + nextPage?: string | null; };" `); }); test("VpcRouterUpdate", () => { expect(genType(schemas.VpcRouterUpdate)).toMatchInlineSnapshot( - `"type X = { description?: string; name?: Name };"` + `"type X = { description?: string | null; name?: Name | null };"` ); }); @@ -164,3 +164,15 @@ test("discriminated union (VpcFirewallRuleTarget)", () => { | { type: "ip_net"; value: IpNet };" `); }); + +test("Array of nullable item (ValueArray)", () => { + expect(genType(schemas.ValueArray)).toMatchInlineSnapshot(` + "type X = + | { type: "integer"; values: (number | null)[] } + | { type: "double"; values: (number | null)[] } + | { type: "boolean"; values: (boolean | null)[] } + | { type: "string"; values: (string | null)[] } + | { type: "integer_distribution"; values: (Distributionint64 | null)[] } + | { type: "double_distribution"; values: (Distributiondouble | null)[] };" + `); +}); diff --git a/oxide-openapi-gen-ts/src/schema/types.ts b/oxide-openapi-gen-ts/src/schema/types.ts index 55f3472..970bc70 100644 --- a/oxide-openapi-gen-ts/src/schema/types.ts +++ b/oxide-openapi-gen-ts/src/schema/types.ts @@ -20,26 +20,35 @@ export const schemaToTypes = makeSchemaGenerator({ if (i > 0) w0("| "); w(JSON.stringify(arm)); }); + if (schema.nullable) w0(" | null"); }, - boolean(_, { w0 }) { + boolean(schema, { w0 }) { w0(`boolean`); + if (schema.nullable) w0(" | null"); }, - string(_, { w0 }) { + string(schema, { w0 }) { w0(`string`); + if (schema.nullable) w0(" | null"); }, - date(_, { w0 }) { + date(schema, { w0 }) { w0(`Date`); + if (schema.nullable) w0(" | null"); }, - number(_, { w0 }) { + number(schema, { w0 }) { w0(`number`); + if (schema.nullable) w0(" | null"); }, - integer(_, { w0 }) { + integer(schema, { w0 }) { w0(`number`); + if (schema.nullable) w0(" | null"); }, array(schema, io) { const { w0 } = io; + w0("("); schemaToTypes(schema.items, io); + w0(")"); w0("[]"); + if (schema.nullable) w0(" | null"); }, object(schema, io) { const { w0, w } = io; @@ -66,11 +75,13 @@ export const schemaToTypes = makeSchemaGenerator({ w0(","); } w0("}"); + if (schema.nullable) w0(" | null"); }, oneOf(schema, io) { if (schema.oneOf!.length === 1) { return schemaToTypes(schema.oneOf![0], io); } + io.w0("("); for (const s of schema.oneOf!) { if ("description" in s) { io.w(`/** ${s.description} */`); @@ -79,11 +90,15 @@ export const schemaToTypes = makeSchemaGenerator({ schemaToTypes(s, io); io.w(""); } + io.w0(")"); + if (schema.nullable) io.w0(" | null"); }, allOf(schema, io) { if (schema.allOf!.length === 1) { schemaToTypes(schema.allOf![0], io); + if (schema.nullable) io.w0(" | null"); } else { + // note: in the nexus schema, this arm is never hit for (const s of schema.allOf!) { io.w(`& ${JSON.stringify(s)}`); } diff --git a/oxide-openapi-gen-ts/src/schema/zod.ts b/oxide-openapi-gen-ts/src/schema/zod.ts index 437d2d9..56092ba 100644 --- a/oxide-openapi-gen-ts/src/schema/zod.ts +++ b/oxide-openapi-gen-ts/src/schema/zod.ts @@ -23,6 +23,7 @@ export const schemaToZod = makeSchemaGenerator({ if ("default" in schema) { w0(`.default(${schema.default})`); } + if (schema.nullable) w0(".nullable()"); }, enum(schema, io) { @@ -33,6 +34,7 @@ export const schemaToZod = makeSchemaGenerator({ } else { throw new Error(`Unsupported enum type ${schema.type}`); } + if (schema.nullable) io.w0(".nullable()"); }, string(schema, { w0 }) { @@ -62,17 +64,23 @@ export const schemaToZod = makeSchemaGenerator({ if ("pattern" in schema) { w0(`.regex(${new RegExp(schema.pattern!).toString()})`); } + if (schema.nullable) w0(".nullable()"); }, - date(_, { w0 }) { + date(schema, { w0 }) { w0("z.coerce.date()"); + if (schema.nullable) w0(".nullable()"); }, - number(_, { w0 }) { + number(schema, { w0 }) { w0("z.number()"); + if (schema.nullable) w0(".nullable()"); }, - integer: schemaToZodInt, + integer(schema, io) { + schemaToZodInt(schema, io); + if (schema.nullable) io.w0(".nullable()"); + }, array(schema, io) { const { w0 } = io; @@ -97,6 +105,7 @@ export const schemaToZod = makeSchemaGenerator({ w0("z.unknown()"); } w0(")"); + if (schema.nullable) io.w0(".nullable()"); return; } @@ -110,6 +119,7 @@ export const schemaToZod = makeSchemaGenerator({ w(","); } w0("})"); + if (schema.nullable) io.w0(".nullable()"); }, oneOf(schema, io) { @@ -118,6 +128,7 @@ export const schemaToZod = makeSchemaGenerator({ if (schema.oneOf.length === 1) { schemaToZod(schema.oneOf[0], io); + if (schema.nullable) io.w0(".nullable()"); return; } @@ -134,6 +145,7 @@ export const schemaToZod = makeSchemaGenerator({ (s) => (s as OpenAPIV3.SchemaObject).enum![0] ); w(`z.enum([${enums.map((e) => JSON.stringify(e)).join(", ")}])`); + if (schema.nullable) io.w0(".nullable()"); return; } @@ -143,6 +155,7 @@ export const schemaToZod = makeSchemaGenerator({ w(","); } w("])"); + if (schema.nullable) io.w0(".nullable()"); }, allOf(schema, io) { @@ -169,6 +182,7 @@ export const schemaToZod = makeSchemaGenerator({ if ("default" in schema) { w0(`.default(${JSON.stringify(schema.default)})`); } + if (schema.nullable) io.w0(".nullable()"); }, empty({ w0 }) {