Skip to content

fix: set most enums as optional #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2023
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
4 changes: 2 additions & 2 deletions packages/clients/src/api/baremetal/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ export const marshalRebootServerRequest = (
request: RebootServerRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
boot_type: request.bootType,
boot_type: request.bootType ?? 'unknown_boot_type',
})

export const marshalStartBMCAccessRequest = (
Expand All @@ -594,7 +594,7 @@ export const marshalStartServerRequest = (
request: StartServerRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
boot_type: request.bootType,
boot_type: request.bootType ?? 'unknown_boot_type',
})

export const marshalUpdateIPRequest = (
Expand Down
4 changes: 2 additions & 2 deletions packages/clients/src/api/baremetal/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ export type RebootServerRequest = {
/** ID of the server to reboot */
serverId: string
/** The type of boot */
bootType: ServerBootType
bootType?: ServerBootType
}

export type StartServerRequest = {
Expand All @@ -606,7 +606,7 @@ export type StartServerRequest = {
/** ID of the server to start */
serverId: string
/** The type of boot */
bootType: ServerBootType
bootType?: ServerBootType
}

export type StopServerRequest = {
Expand Down
12 changes: 6 additions & 6 deletions packages/clients/src/api/container/v1beta1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,16 @@ export const marshalCreateContainerRequest = (
): Record<string, unknown> => ({
description: request.description,
environment_variables: request.environmentVariables,
http_option: request.httpOption,
http_option: request.httpOption ?? 'unknown_http_option',
max_concurrency: request.maxConcurrency,
max_scale: request.maxScale,
memory_limit: request.memoryLimit,
min_scale: request.minScale,
name: request.name || randomName('ctnr'),
namespace_id: request.namespaceId,
port: request.port,
privacy: request.privacy,
protocol: request.protocol,
privacy: request.privacy ?? 'unknown_privacy',
protocol: request.protocol ?? 'unknown_protocol',
registry_image: request.registryImage,
secret_environment_variables: request.secretEnvironmentVariables
? request.secretEnvironmentVariables.map(elt =>
Expand Down Expand Up @@ -342,14 +342,14 @@ export const marshalUpdateContainerRequest = (
): Record<string, unknown> => ({
description: request.description,
environment_variables: request.environmentVariables,
http_option: request.httpOption,
http_option: request.httpOption ?? 'unknown_http_option',
max_concurrency: request.maxConcurrency,
max_scale: request.maxScale,
memory_limit: request.memoryLimit,
min_scale: request.minScale,
port: request.port,
privacy: request.privacy,
protocol: request.protocol,
privacy: request.privacy ?? 'unknown_privacy',
protocol: request.protocol ?? 'unknown_protocol',
redeploy: request.redeploy,
registry_image: request.registryImage,
secret_environment_variables: request.secretEnvironmentVariables
Expand Down
12 changes: 6 additions & 6 deletions packages/clients/src/api/container/v1beta1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ export type CreateContainerRequest = {
maxScale?: number
memoryLimit?: number
timeout?: string
privacy: ContainerPrivacy
privacy?: ContainerPrivacy
description?: string
registryImage?: string
maxConcurrency?: number
protocol: ContainerProtocol
protocol?: ContainerProtocol
port?: number
secretEnvironmentVariables?: Array<Secret>
/**
Expand All @@ -307,7 +307,7 @@ export type CreateContainerRequest = {
* to use HTTPS.
* - Enabled: Serve both HTTP and HTTPS traffic.
*/
httpOption: ContainerHttpOption
httpOption?: ContainerHttpOption
}

export type UpdateContainerRequest = {
Expand All @@ -320,11 +320,11 @@ export type UpdateContainerRequest = {
memoryLimit?: number
timeout?: string
redeploy?: boolean
privacy: ContainerPrivacy
privacy?: ContainerPrivacy
description?: string
registryImage?: string
maxConcurrency?: number
protocol: ContainerProtocol
protocol?: ContainerProtocol
port?: number
secretEnvironmentVariables?: Array<Secret>
/**
Expand All @@ -334,7 +334,7 @@ export type UpdateContainerRequest = {
* to use HTTPS.
* - Enabled: Serve both HTTP and HTTPS traffic.
*/
httpOption: ContainerHttpOption
httpOption?: ContainerHttpOption
}

export type DeleteContainerRequest = {
Expand Down
5 changes: 4 additions & 1 deletion packages/clients/src/api/domain/v2beta1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,10 @@ export class DomainV2Beta1GenAPI extends API {
'dnsZone',
request.dnsZone,
)}/raw`,
urlParams: urlParams(['format', request.format]),
urlParams: urlParams([
'format',
request.format ?? 'unknown_raw_format',
]),
},
unmarshalScwFile,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,7 @@ export const marshalRegistrarApiUpdateContactRequest = (
? marshalContactExtensionNL(request.extensionNl, defaults)
: undefined,
fax_number: request.faxNumber,
lang: request.lang,
lang: request.lang ?? 'unknown_language_code',
phone_number: request.phoneNumber,
questions: request.questions
? request.questions.map(elt =>
Expand Down
4 changes: 2 additions & 2 deletions packages/clients/src/api/domain/v2beta1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ export type ExportRawDNSZoneRequest = {
/** The DNS zone to export */
dnsZone: string
/** Format for DNS zone */
format: RawFormat
format?: RawFormat
}

export type ImportRawDNSZoneRequest = {
Expand Down Expand Up @@ -1189,7 +1189,7 @@ export type RegistrarApiUpdateContactRequest = {
country?: string
vatIdentificationCode?: string
companyIdentificationCode?: string
lang: LanguageCode
lang?: LanguageCode
resale?: boolean
/** @deprecated */
questions?: Array<UpdateContactRequestQuestion>
Expand Down
14 changes: 7 additions & 7 deletions packages/clients/src/api/function/v1beta1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,14 +655,14 @@ export const marshalCreateFunctionRequest = (
description: request.description,
environment_variables: request.environmentVariables,
handler: request.handler,
http_option: request.httpOption,
http_option: request.httpOption ?? 'unknown_http_option',
max_scale: request.maxScale,
memory_limit: request.memoryLimit,
min_scale: request.minScale,
name: request.name || randomName('fn'),
namespace_id: request.namespaceId,
privacy: request.privacy,
runtime: request.runtime,
privacy: request.privacy ?? 'unknown_privacy',
runtime: request.runtime ?? 'unknown_runtime',
secret_environment_variables: request.secretEnvironmentVariables
? request.secretEnvironmentVariables.map(elt =>
marshalSecret(elt, defaults),
Expand Down Expand Up @@ -739,7 +739,7 @@ export const marshalCreateTriggerRequest = (
description: request.description,
function_id: request.functionId,
name: request.name,
type: request.type,
type: request.type ?? 'unknown_trigger_type',
...resolveOneOf<unknown>([
{
param: 'nats_failure_handling_policy',
Expand Down Expand Up @@ -800,13 +800,13 @@ export const marshalUpdateFunctionRequest = (
description: request.description,
environment_variables: request.environmentVariables,
handler: request.handler,
http_option: request.httpOption,
http_option: request.httpOption ?? 'unknown_http_option',
max_scale: request.maxScale,
memory_limit: request.memoryLimit,
min_scale: request.minScale,
privacy: request.privacy,
privacy: request.privacy ?? 'unknown_privacy',
redeploy: request.redeploy,
runtime: request.runtime,
runtime: request.runtime ?? 'unknown_runtime',
secret_environment_variables: request.secretEnvironmentVariables
? request.secretEnvironmentVariables.map(elt =>
marshalSecret(elt, defaults),
Expand Down
14 changes: 7 additions & 7 deletions packages/clients/src/api/function/v1beta1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,11 @@ export type CreateFunctionRequest = {
environmentVariables?: Record<string, string>
minScale?: number
maxScale?: number
runtime: FunctionRuntime
runtime?: FunctionRuntime
memoryLimit?: number
timeout?: string
handler?: string
privacy: FunctionPrivacy
privacy?: FunctionPrivacy
description?: string
secretEnvironmentVariables?: Array<Secret>
/**
Expand All @@ -525,7 +525,7 @@ export type CreateFunctionRequest = {
* to use HTTPS.
* - Enabled: Serve both HTTP and HTTPS traffic.
*/
httpOption: FunctionHttpOption
httpOption?: FunctionHttpOption
}

export type UpdateFunctionRequest = {
Expand All @@ -535,12 +535,12 @@ export type UpdateFunctionRequest = {
environmentVariables?: Record<string, string>
minScale?: number
maxScale?: number
runtime: FunctionRuntime
runtime?: FunctionRuntime
memoryLimit?: number
timeout?: string
redeploy?: boolean
handler?: string
privacy: FunctionPrivacy
privacy?: FunctionPrivacy
description?: string
secretEnvironmentVariables?: Array<Secret>
/**
Expand All @@ -550,7 +550,7 @@ export type UpdateFunctionRequest = {
* to use HTTPS.
* - Enabled: Serve both HTTP and HTTPS traffic.
*/
httpOption: FunctionHttpOption
httpOption?: FunctionHttpOption
}

export type DeleteFunctionRequest = {
Expand Down Expand Up @@ -709,7 +709,7 @@ export type CreateTriggerRequest = {
name: string
description: string
functionId: string
type: TriggerType
type?: TriggerType
/**
* One-of ('failureHandlingPolicy'): at most one of
* 'natsFailureHandlingPolicy', 'sqsFailureHandlingPolicy' could be set.
Expand Down
8 changes: 5 additions & 3 deletions packages/clients/src/api/instance/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ export class InstanceV1GenAPI extends API {
* @param request - The request {@link CreateSnapshotRequest}
* @returns A Promise of CreateSnapshotResponse
*/
createSnapshot = (request: Readonly<CreateSnapshotRequest>) =>
createSnapshot = (request: Readonly<CreateSnapshotRequest> = {}) =>
this.client.fetch<CreateSnapshotResponse>(
{
body: JSON.stringify(
Expand Down Expand Up @@ -770,7 +770,7 @@ export class InstanceV1GenAPI extends API {
* @param request - The request {@link CreateVolumeRequest}
* @returns A Promise of CreateVolumeResponse
*/
createVolume = (request: Readonly<CreateVolumeRequest>) =>
createVolume = (request: Readonly<CreateVolumeRequest> = {}) =>
this.client.fetch<CreateVolumeResponse>(
{
body: JSON.stringify(
Expand Down Expand Up @@ -1185,7 +1185,9 @@ export class InstanceV1GenAPI extends API {
* @param request - The request {@link CreatePlacementGroupRequest}
* @returns A Promise of CreatePlacementGroupResponse
*/
createPlacementGroup = (request: Readonly<CreatePlacementGroupRequest>) =>
createPlacementGroup = (
request: Readonly<CreatePlacementGroupRequest> = {},
) =>
this.client.fetch<CreatePlacementGroupResponse>(
{
body: JSON.stringify(
Expand Down
14 changes: 7 additions & 7 deletions packages/clients/src/api/instance/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1662,8 +1662,8 @@ export const marshalCreatePlacementGroupRequest = (
defaults: DefaultValues,
): Record<string, unknown> => ({
name: request.name || randomName('pg'),
policy_mode: request.policyMode,
policy_type: request.policyType,
policy_mode: request.policyMode ?? 'optional',
policy_type: request.policyType ?? 'max_availability',
tags: request.tags,
...resolveOneOf([
{
Expand Down Expand Up @@ -1692,9 +1692,9 @@ export const marshalCreateSecurityGroupRequest = (
): Record<string, unknown> => ({
description: request.description,
enable_default_security: request.enableDefaultSecurity,
inbound_default_policy: request.inboundDefaultPolicy,
inbound_default_policy: request.inboundDefaultPolicy ?? 'accept',
name: request.name || randomName('sg'),
outbound_default_policy: request.outboundDefaultPolicy,
outbound_default_policy: request.outboundDefaultPolicy ?? 'accept',
stateful: request.stateful,
tags: request.tags,
...resolveOneOf([
Expand Down Expand Up @@ -1783,7 +1783,7 @@ export const marshalCreateSnapshotRequest = (
size: request.size,
tags: request.tags,
volume_id: request.volumeId,
volume_type: request.volumeType,
volume_type: request.volumeType ?? 'unknown_volume_type',
...resolveOneOf([
{
default: defaults.defaultProjectId,
Expand All @@ -1804,7 +1804,7 @@ export const marshalCreateVolumeRequest = (
): Record<string, unknown> => ({
name: request.name || randomName('vol'),
tags: request.tags,
volume_type: request.volumeType,
volume_type: request.volumeType ?? 'l_ssd',
...resolveOneOf([
{
default: defaults.defaultProjectId,
Expand Down Expand Up @@ -1845,7 +1845,7 @@ export const marshalServerActionRequest = (
request: ServerActionRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
action: request.action,
action: request.action ?? 'poweron',
name: request.name,
volumes: request.volumes
? Object.entries(request.volumes).reduce(
Expand Down
18 changes: 9 additions & 9 deletions packages/clients/src/api/instance/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ export type ServerActionRequest = {
/** UUID of the server */
serverId: string
/** The action to perform on the server */
action: ServerAction
action?: ServerAction
/**
* The name of the backup you want to create. This field should only be
* specified when performing a backup action.
Expand Down Expand Up @@ -1111,7 +1111,7 @@ export type CreateSnapshotRequest = {
* Overrides the volume_type of the snapshot. If omitted, the volume type of
* the original volume will be used.
*/
volumeType: SnapshotVolumeType
volumeType?: SnapshotVolumeType
/** Bucket name for snapshot imports */
bucket?: string
/** Object key for snapshot imports */
Expand Down Expand Up @@ -1192,7 +1192,7 @@ export type CreateVolumeRequest = {
/** The volume tags */
tags?: Array<string>
/** The volume type */
volumeType: VolumeVolumeType
volumeType?: VolumeVolumeType
/**
* The volume disk size, must be a multiple of 512.
*
Expand Down Expand Up @@ -1310,9 +1310,9 @@ export type CreateSecurityGroupRequest = {
/** Whether the security group is stateful or not */
stateful: boolean
/** Default policy for inbound rules */
inboundDefaultPolicy: SecurityGroupPolicy
inboundDefaultPolicy?: SecurityGroupPolicy
/** Default policy for outbound rules */
outboundDefaultPolicy: SecurityGroupPolicy
outboundDefaultPolicy?: SecurityGroupPolicy
/** True to block SMTP on IPv4 and IPv6 */
enableDefaultSecurity?: boolean
}
Expand Down Expand Up @@ -1440,9 +1440,9 @@ export type CreatePlacementGroupRequest = {
/** The tags of the placement group */
tags?: Array<string>
/** The operating mode of the placement group */
policyMode: PlacementGroupPolicyMode
policyMode?: PlacementGroupPolicyMode
/** The policy type of the placement group */
policyType: PlacementGroupPolicyType
policyType?: PlacementGroupPolicyType
}

export type GetPlacementGroupRequest = {
Expand All @@ -1458,8 +1458,8 @@ export type SetPlacementGroupRequest = {
placementGroupId: string
name: string
organization?: string
policyMode: PlacementGroupPolicyMode
policyType: PlacementGroupPolicyType
policyMode?: PlacementGroupPolicyMode
policyType?: PlacementGroupPolicyType
project?: string
tags?: Array<string>
}
Expand Down
Loading